[Toybox] [New Toy] - ip

Rob Landley rob at landley.net
Mon Sep 22 06:13:44 PDT 2014


On 09/22/14 07:05, Bastian Bittorf wrote:
> * Rob Landley <rob at landley.net> [22.09.2014 13:48]:
>> I really don't want two implementations of the same functionality. (If I
>> did ip, I was going to do it as a wrapper around "ifconfig" and "route"
>> and similar...)
> 
> the other way around, a wrapper around 'ip' - because
> 'ifconfig','route' etc. implements a subset of 'ip'. sharing code is an
> important goal and now we have a mess 8-( sorry...

So if all you need is "ifconfig" and "route", you have to suck in the
whole ip command with tunnel support and everything?

You're starting with the assumption that ip is the way to do it and
reasoning backwards from your conclusion.

> at the moment, there are no test defined under 'scripts/test' for ifconfig.

Because they require root access and I haven't figured out how I want to
handle that. The old "make chroot" code I did back in 2006 for busybox
was better than nothing, but doesn't help you clean up if failed tests
leave mountpoints or fiddle with your network status. Needing to reboot
your development machine after running a test suite is a bad thing.

Also, ifconfig has the problem of knowing what devices are available. if
you run it on a machine that _only_ has wireless, there's no eth0.
Running it on a machine that only has a wired connection, no wlan0. (And
then off x86 they may have different names entirely...)

What I might do is set up an lxc container with known devices based on
tun/tap. Or maybe set up a qemu instance (again with known devices).
Either would introduce an external dependency to run the root parts of
the test suite, but it's probably my best option...

> i'am really unsure how to 'test' this command. set ip-addresses on a
> dummy-interface and check/screen-scrape the output of ifconfig?

We can require that lo (loopback interface) exists, but that doesn't let
us test all the codepaths. Hence qemu, where we can emulate known devices.

> minor notice: the link to 'ifconfig' on http://landley.net/toybox/status.html
> is wrong/broken, please use http://linux.die.net/man/8/ifconfig

That's actually generated by a script:

http://landley.net/hg/toybox/file/tip/scripts/mkstatus.py

Not sure how to teach that about manual _sections_.  Hmmm...

Rob

 1411391624.0


More information about the Toybox mailing list