* [PATCH 0/5] Netroot updates and multinic test-suite
@ 2009-06-24 18:08 Philippe Seewer
[not found] ` <1245866912-3643-1-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org>
0 siblings, 1 reply; 14+ messages in thread
From: Philippe Seewer @ 2009-06-24 18:08 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Philippe Seewer
This is a first start at a multinic testsuite, some
improvements to netroot and a bugfix.
Patches can be pulled from
git://github.com/seewer/dracut-seewer.git
as well
Philippe Seewer (5):
Bugfix: Fix BOOTIF argument translation
Give the kernel some time to up interfaces
Be a bit more optimistic when setting mtus
Add DAD do dhclient-script
Add multinic test suite
modules.d/40network/dhclient-script | 19 +++-
modules.d/40network/ifup | 3 +-
modules.d/40network/net-genrules.sh | 2 +-
test/TEST-50-MULTINIC/Makefile | 10 ++
test/TEST-50-MULTINIC/client-init | 9 ++
test/TEST-50-MULTINIC/dhcpd.conf | 36 ++++++
test/TEST-50-MULTINIC/exports | 1 +
test/TEST-50-MULTINIC/hard-off.sh | 2 +
test/TEST-50-MULTINIC/hosts | 5 +
test/TEST-50-MULTINIC/server-init | 30 +++++
test/TEST-50-MULTINIC/test.log | 48 ++++++++
test/TEST-50-MULTINIC/test.sh | 225 +++++++++++++++++++++++++++++++++++
12 files changed, 384 insertions(+), 6 deletions(-)
create mode 100644 test/TEST-50-MULTINIC/Makefile
create mode 100755 test/TEST-50-MULTINIC/client-init
create mode 100644 test/TEST-50-MULTINIC/dhcpd.conf
create mode 100644 test/TEST-50-MULTINIC/exports
create mode 100755 test/TEST-50-MULTINIC/hard-off.sh
create mode 100644 test/TEST-50-MULTINIC/hosts
create mode 100755 test/TEST-50-MULTINIC/server-init
create mode 100644 test/TEST-50-MULTINIC/test.log
create mode 100755 test/TEST-50-MULTINIC/test.sh
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 14+ messages in thread[parent not found: <1245866912-3643-1-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org>]
* [PATCH 1/5] Bugfix: Fix BOOTIF argument translation [not found] ` <1245866912-3643-1-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> @ 2009-06-24 18:08 ` Philippe Seewer 2009-06-24 18:08 ` [PATCH 2/5] Give the kernel some time to up interfaces Philippe Seewer ` (4 subsequent siblings) 5 siblings, 0 replies; 14+ messages in thread From: Philippe Seewer @ 2009-06-24 18:08 UTC (permalink / raw) To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Philippe Seewer fix_bootif() in net-genrules stripped the first part off the passed string, resulting in invalid mac addresses. fixed --- modules.d/40network/net-genrules.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh index 3d50435..dbd0474 100755 --- a/modules.d/40network/net-genrules.sh +++ b/modules.d/40network/net-genrules.sh @@ -2,7 +2,7 @@ # pxelinux provides macaddr '-' separated, but we need ':' fix_bootif() { - local macaddr=${1##??-} + local macaddr=${1} local IFS='-' macaddr=$(for i in ${macaddr} ; do echo -n $i:; done) macaddr=${macaddr%:} -- 1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/5] Give the kernel some time to up interfaces [not found] ` <1245866912-3643-1-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> 2009-06-24 18:08 ` [PATCH 1/5] Bugfix: Fix BOOTIF argument translation Philippe Seewer @ 2009-06-24 18:08 ` Philippe Seewer [not found] ` <1245866912-3643-3-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> 2009-06-24 18:08 ` [PATCH 3/5] Be a bit more optimistic when setting mtus Philippe Seewer ` (3 subsequent siblings) 5 siblings, 1 reply; 14+ messages in thread From: Philippe Seewer @ 2009-06-24 18:08 UTC (permalink / raw) To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Philippe Seewer It does not really matter if the kernel needs some time or if the ethernet handshake takes a while. It's a good idea to wait a second after upping an interface to let things settle. --- modules.d/40network/dhclient-script | 2 ++ modules.d/40network/ifup | 3 ++- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/modules.d/40network/dhclient-script b/modules.d/40network/dhclient-script index 5b36a40..9e7eefd 100755 --- a/modules.d/40network/dhclient-script +++ b/modules.d/40network/dhclient-script @@ -52,6 +52,8 @@ netif=$interface case $reason in PREINIT) ip link set $netif up + # Give the kernel some time to up the interface + sleep 1 ;; BOUND) setup_interface diff --git a/modules.d/40network/ifup b/modules.d/40network/ifup index 89017bb..174edca 100755 --- a/modules.d/40network/ifup +++ b/modules.d/40network/ifup @@ -32,8 +32,9 @@ do_dhcp() { # Handle static ip configuration do_static() { -{ + { echo ip link set $netif up + echo sleep 1 echo ip addr flush dev $netif echo ip addr add $ip/$mask dev $netif } > /tmp/net.$netif.up -- 1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <1245866912-3643-3-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org>]
* Re: [PATCH 2/5] Give the kernel some time to up interfaces [not found] ` <1245866912-3643-3-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> @ 2009-06-26 3:02 ` David Dillow [not found] ` <1245985355.30948.14.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org> 0 siblings, 1 reply; 14+ messages in thread From: David Dillow @ 2009-06-26 3:02 UTC (permalink / raw) To: Philippe Seewer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA On Wed, 2009-06-24 at 20:08 +0200, Philippe Seewer wrote: > It does not really matter if the kernel needs some time or if > the ethernet handshake takes a while. It's a good idea to wait > a second after upping an interface to let things settle. Hmm, shouldn't DHCP retries take care of this issue, and the server ARP ping we've been talking about take care of it for static configs? I would be a bit concerned that the backoff of dhclient may slow us down more than a second, but I've not investigated if that is true. I'm not really keen on adding a mandatory delay unless there is no other option. -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <1245985355.30948.14.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>]
* Re: [PATCH 2/5] Give the kernel some time to up interfaces [not found] ` <1245985355.30948.14.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org> @ 2009-06-26 7:07 ` Seewer Philippe 0 siblings, 0 replies; 14+ messages in thread From: Seewer Philippe @ 2009-06-26 7:07 UTC (permalink / raw) To: David Dillow; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA David Dillow wrote: > On Wed, 2009-06-24 at 20:08 +0200, Philippe Seewer wrote: >> It does not really matter if the kernel needs some time or if >> the ethernet handshake takes a while. It's a good idea to wait >> a second after upping an interface to let things settle. > > Hmm, shouldn't DHCP retries take care of this issue, and the server ARP > ping we've been talking about take care of it for static configs? > > I would be a bit concerned that the backoff of dhclient may slow us down > more than a second, but I've not investigated if that is true. > > I'm not really keen on adding a mandatory delay unless there is no other > option. > In the DHCP case, yes we could skip the sleep as dhclient will just retry if the interface isn't ready. But for all other cases, we really should give the hardware some time to initialize. During the years, I've had to use this for different cases, be it slow firmware loading, weird drivers or just hardware that takes longer. I've even had interfaces failing configuration if they didn't get some time to initialize. Another example: My e1000e card actually takes just a bit more than 1 second to got to LOWER_UP when I do modprobe e1000e && ip link set eth0 up So this patch is just plain paranoia to make sure there's enough time between upping the interface and trying to configure it. Yes, we could try to wait for LOWER_UP or something similar, but sleep 1 is simpler and I haven't yet seen a case where that isn't enough and the slow down is negligible. As for other references: Stock isc 4.1 dhclient-scripts do it as well for example. I admit, others doing it doesn't make it right. But it's just a pointer. -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/5] Be a bit more optimistic when setting mtus [not found] ` <1245866912-3643-1-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> 2009-06-24 18:08 ` [PATCH 1/5] Bugfix: Fix BOOTIF argument translation Philippe Seewer 2009-06-24 18:08 ` [PATCH 2/5] Give the kernel some time to up interfaces Philippe Seewer @ 2009-06-24 18:08 ` Philippe Seewer 2009-06-24 18:08 ` [PATCH 4/5] Add DAD do dhclient-script Philippe Seewer ` (2 subsequent siblings) 5 siblings, 0 replies; 14+ messages in thread From: Philippe Seewer @ 2009-06-24 18:08 UTC (permalink / raw) To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Philippe Seewer The usual approach to setting mtus is to set the interface down, set the mtu then set the interface back up again. Modern hardware and/or drivers may support setting this on the fly, so we try this and fall back to the old behaviour it it doesn't work. In addition this patch only allows mtus greater than 576, this is taken from debian/ubuntu dhclient-script. --- modules.d/40network/dhclient-script | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules.d/40network/dhclient-script b/modules.d/40network/dhclient-script index 9e7eefd..6df630d 100755 --- a/modules.d/40network/dhclient-script +++ b/modules.d/40network/dhclient-script @@ -13,10 +13,18 @@ setup_interface() { [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override - if [ -n "$mtu" ] ; then - echo ip link set $netif down - echo ip link set $netif mtu $mtu - echo ip link set $netif up + # Taken from debian dhclient-script: + # The 576 MTU is only used for X.25 and dialup connections + # where the admin wants low latency. Such a low MTU can cause + # problems with UDP traffic, among other things. As such, + # disallow MTUs from 576 and below by default, so that broken + # MTUs are ignored, but higher stuff is allowed (1492, 1500, etc). + if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then + echo "if ! ip link set $netif mtu $mtu ; then" + echo "ip link set $netif down" + echo "ip link set $netif mtu $mtu" + echo "ip link set $netif up" + echo "fi" fi > /tmp/net.$netif.up echo ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif >> /tmp/net.$netif.up -- 1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/5] Add DAD do dhclient-script [not found] ` <1245866912-3643-1-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> ` (2 preceding siblings ...) 2009-06-24 18:08 ` [PATCH 3/5] Be a bit more optimistic when setting mtus Philippe Seewer @ 2009-06-24 18:08 ` Philippe Seewer [not found] ` <1245866912-3643-5-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> 2009-06-24 18:08 ` [PATCH 5/5] Add multinic test suite Philippe Seewer 2009-06-26 3:20 ` [PATCH 0/5] Netroot updates and multinic test-suite David Dillow 5 siblings, 1 reply; 14+ messages in thread From: Philippe Seewer @ 2009-06-24 18:08 UTC (permalink / raw) To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Philippe Seewer The manpage for dhclient-script says: Before actually configuring the address, dhclient-script should somehow ARP for it and exit with a nonzero status if it receives a reply. By using arping in dracut this is very easy, since arping has a specific option to do just that. --- modules.d/40network/dhclient-script | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/modules.d/40network/dhclient-script b/modules.d/40network/dhclient-script index 6df630d..3fb8da6 100755 --- a/modules.d/40network/dhclient-script +++ b/modules.d/40network/dhclient-script @@ -64,6 +64,7 @@ case $reason in sleep 1 ;; BOUND) + arping -q -D -c 2 -I $netif $new_ip_address || exit 1 setup_interface set | while read line; do [ "${line#new_}" = "$line" ] && continue -- 1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <1245866912-3643-5-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org>]
* Re: [PATCH 4/5] Add DAD do dhclient-script [not found] ` <1245866912-3643-5-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> @ 2009-06-24 18:39 ` David Dillow [not found] ` <1245868789.31775.16.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org> 0 siblings, 1 reply; 14+ messages in thread From: David Dillow @ 2009-06-24 18:39 UTC (permalink / raw) To: Philippe Seewer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA On Wed, 2009-06-24 at 20:08 +0200, Philippe Seewer wrote: > The manpage for dhclient-script says: > > Before actually configuring the address, dhclient-script should > somehow ARP for it and exit with a nonzero status if it receives a > reply. > > By using arping in dracut this is very easy, since arping has a > specific option to do just that. > --- a/modules.d/40network/dhclient-script > +++ b/modules.d/40network/dhclient-script > @@ -64,6 +64,7 @@ case $reason in > sleep 1 > ;; > BOUND) > + arping -q -D -c 2 -I $netif $new_ip_address || exit 1 Where's the addition of arping to 40network/install? -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <1245868789.31775.16.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>]
* Re: [PATCH 4/5] Add DAD do dhclient-script [not found] ` <1245868789.31775.16.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org> @ 2009-06-24 19:56 ` Seewer Philippe [not found] ` <4A4284D3.5050007-omB+W0Dpw2o@public.gmane.org> 0 siblings, 1 reply; 14+ messages in thread From: Seewer Philippe @ 2009-06-24 19:56 UTC (permalink / raw) To: David Dillow; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA David Dillow wrote: > On Wed, 2009-06-24 at 20:08 +0200, Philippe Seewer wrote: >> The manpage for dhclient-script says: >> >> Before actually configuring the address, dhclient-script should >> somehow ARP for it and exit with a nonzero status if it receives a >> reply. >> >> By using arping in dracut this is very easy, since arping has a >> specific option to do just that. > >> --- a/modules.d/40network/dhclient-script >> +++ b/modules.d/40network/dhclient-script >> @@ -64,6 +64,7 @@ case $reason in >> sleep 1 >> ;; >> BOUND) >> + arping -q -D -c 2 -I $netif $new_ip_address || exit 1 > > Where's the addition of arping to 40network/install? *sigh* Thanks for noticing, forgot to add it to the commit. Complete Patch below --- modules.d/40network/dhclient-script | 1 + modules.d/40network/install | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/modules.d/40network/dhclient-script b/modules.d/40network/dhclient-script index 6df630d..3fb8da6 100755 --- a/modules.d/40network/dhclient-script +++ b/modules.d/40network/dhclient-script @@ -64,6 +64,7 @@ case $reason in sleep 1 ;; BOUND) + arping -q -D -c 2 -I $netif $new_ip_address || exit 1 setup_interface set | while read line; do [ "${line#new_}" = "$line" ] && continue diff --git a/modules.d/40network/install b/modules.d/40network/install index 0b76cbd..513503c 100755 --- a/modules.d/40network/install +++ b/modules.d/40network/install @@ -1,5 +1,5 @@ #!/bin/bash -dracut_install ip dhclient hostname +dracut_install ip dhclient hostname arping # Include wired net drivers, excluding wireless for modname in $(find "/lib/modules/$kernel/kernel/drivers" -name '*.ko'); do if nm -uPA $modname | grep -q eth_type_trans; then -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <4A4284D3.5050007-omB+W0Dpw2o@public.gmane.org>]
* Re: [PATCH 4/5] Add DAD do dhclient-script [not found] ` <4A4284D3.5050007-omB+W0Dpw2o@public.gmane.org> @ 2009-06-26 2:45 ` David Dillow 0 siblings, 0 replies; 14+ messages in thread From: David Dillow @ 2009-06-26 2:45 UTC (permalink / raw) To: Seewer Philippe; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA On Wed, 2009-06-24 at 21:56 +0200, Seewer Philippe wrote: > David Dillow wrote: > > On Wed, 2009-06-24 at 20:08 +0200, Philippe Seewer wrote: > >> The manpage for dhclient-script says: > >> > >> Before actually configuring the address, dhclient-script should > >> somehow ARP for it and exit with a nonzero status if it receives a > >> reply. > >> > >> By using arping in dracut this is very easy, since arping has a > >> specific option to do just that. > > > >> --- a/modules.d/40network/dhclient-script > >> +++ b/modules.d/40network/dhclient-script > >> @@ -64,6 +64,7 @@ case $reason in > >> sleep 1 > >> ;; > >> BOUND) > >> + arping -q -D -c 2 -I $netif $new_ip_address || exit 1 Also, this seems like it is screaming for a message -- it will confuse the user if it just doesn't work without saying why.... -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 5/5] Add multinic test suite [not found] ` <1245866912-3643-1-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> ` (3 preceding siblings ...) 2009-06-24 18:08 ` [PATCH 4/5] Add DAD do dhclient-script Philippe Seewer @ 2009-06-24 18:08 ` Philippe Seewer [not found] ` <1245866912-3643-6-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> 2009-06-26 3:20 ` [PATCH 0/5] Netroot updates and multinic test-suite David Dillow 5 siblings, 1 reply; 14+ messages in thread From: Philippe Seewer @ 2009-06-24 18:08 UTC (permalink / raw) To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Philippe Seewer This is a start at a test suite for the multinic part of dracut --- test/TEST-50-MULTINIC/Makefile | 10 ++ test/TEST-50-MULTINIC/client-init | 9 ++ test/TEST-50-MULTINIC/dhcpd.conf | 36 ++++++ test/TEST-50-MULTINIC/exports | 1 + test/TEST-50-MULTINIC/hard-off.sh | 2 + test/TEST-50-MULTINIC/hosts | 5 + test/TEST-50-MULTINIC/server-init | 30 +++++ test/TEST-50-MULTINIC/test.log | 48 ++++++++ test/TEST-50-MULTINIC/test.sh | 225 +++++++++++++++++++++++++++++++++++++ 9 files changed, 366 insertions(+), 0 deletions(-) create mode 100644 test/TEST-50-MULTINIC/Makefile create mode 100755 test/TEST-50-MULTINIC/client-init create mode 100644 test/TEST-50-MULTINIC/dhcpd.conf create mode 100644 test/TEST-50-MULTINIC/exports create mode 100755 test/TEST-50-MULTINIC/hard-off.sh create mode 100644 test/TEST-50-MULTINIC/hosts create mode 100755 test/TEST-50-MULTINIC/server-init create mode 100644 test/TEST-50-MULTINIC/test.log create mode 100755 test/TEST-50-MULTINIC/test.sh diff --git a/test/TEST-50-MULTINIC/Makefile b/test/TEST-50-MULTINIC/Makefile new file mode 100644 index 0000000..bc0ddb6 --- /dev/null +++ b/test/TEST-50-MULTINIC/Makefile @@ -0,0 +1,10 @@ +all: + @make -s --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --all +setup: + @make --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +clean: + @basedir=../.. testdir=../ ./test.sh --clean +run: + @basedir=../.. testdir=../ ./test.sh --run diff --git a/test/TEST-50-MULTINIC/client-init b/test/TEST-50-MULTINIC/client-init new file mode 100755 index 0000000..66290c6 --- /dev/null +++ b/test/TEST-50-MULTINIC/client-init @@ -0,0 +1,9 @@ +#!/bin/sh +exec >/dev/console 2>&1 +export TERM=linux +export PS1='initramfs-test:\w\$ ' +stty sane +echo "made it to the rootfs! Powering down." +echo OK $(ls /dev/.initramfs/*.ifcfg) > /dev/sda +#sh -i +poweroff -f diff --git a/test/TEST-50-MULTINIC/dhcpd.conf b/test/TEST-50-MULTINIC/dhcpd.conf new file mode 100644 index 0000000..be8dee7 --- /dev/null +++ b/test/TEST-50-MULTINIC/dhcpd.conf @@ -0,0 +1,36 @@ +ddns-update-style none; + +use-host-decl-names true; + +subnet 192.168.50.0 netmask 255.255.255.0 { + option subnet-mask 255.255.255.0; + option routers 192.168.50.1; + next-server 192.168.50.1; + server-identifier 192.168.50.1; + option domain-name-servers 192.168.50.1; + option domain-search "example.com"; + option domain-name "other.com"; + + group { + host client-if1 { + hardware ethernet 52:54:00:12:34:00; + fixed-address 192.168.50.100; + } + } + + group { + host client-if2 { + hardware ethernet 52:54:00:12:34:01; + fixed-address 192.168.50.101; + } + } + + group { + option root-path "nfs:192.168.50.1:/nfs/client"; + + host client-if3 { + hardware ethernet 52:54:00:12:34:02; + fixed-address 192.168.50.102; + } + } +} diff --git a/test/TEST-50-MULTINIC/exports b/test/TEST-50-MULTINIC/exports new file mode 100644 index 0000000..82b62f0 --- /dev/null +++ b/test/TEST-50-MULTINIC/exports @@ -0,0 +1 @@ +/nfs/client 192.168.50.0/24(ro,insecure,no_subtree_check,no_root_squash) diff --git a/test/TEST-50-MULTINIC/hard-off.sh b/test/TEST-50-MULTINIC/hard-off.sh new file mode 100755 index 0000000..85fd849 --- /dev/null +++ b/test/TEST-50-MULTINIC/hard-off.sh @@ -0,0 +1,2 @@ +#!/bin/sh +getarg rdinitdebug || poweroff -f diff --git a/test/TEST-50-MULTINIC/hosts b/test/TEST-50-MULTINIC/hosts new file mode 100644 index 0000000..d02a4e9 --- /dev/null +++ b/test/TEST-50-MULTINIC/hosts @@ -0,0 +1,5 @@ +127.0.0.1 localhost +192.168.50.1 server +192.168.50.100 client-if1 +192.168.50.101 client-if2 +192.168.50.102 client-if3 diff --git a/test/TEST-50-MULTINIC/server-init b/test/TEST-50-MULTINIC/server-init new file mode 100755 index 0000000..78eab41 --- /dev/null +++ b/test/TEST-50-MULTINIC/server-init @@ -0,0 +1,30 @@ +#!/bin/sh +export TERM=linux +export PS1='nfstest-server:\w\$ ' +stty sane +echo "made it to the rootfs!" +echo server > /proc/sys/kernel/hostname +ip addr add 127.0.0.1/8 dev lo +ip link set lo up +ip addr add 192.168.50.1/24 dev eth0 +ip link set eth0 up +modprobe sunrpc +mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs +[ -x /sbin/portmap ] && portmap +[ -x /sbin/rpcbind ] && rpcbind +modprobe nfsd +mount -t nfsd nfsd /proc/fs/nfsd +exportfs -r +rpc.nfsd +rpc.mountd +rpc.idmapd +exportfs -r +>/var/lib/dhcpd/dhcpd.leases +chmod 777 /var/lib/dhcpd/dhcpd.leases +dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases +#sh -i +# Wait forever for the VM to die +echo "Serving NFS mounts" +while sleep 60; do sleep 60; done +mount -n -o remount,ro / +poweroff -f diff --git a/test/TEST-50-MULTINIC/test.log b/test/TEST-50-MULTINIC/test.log new file mode 100644 index 0000000..f3c0c59 --- /dev/null +++ b/test/TEST-50-MULTINIC/test.log @@ -0,0 +1,48 @@ +60+0 records in +60+0 records out +62914560 bytes (63 MB) copied, 0.158729 s, 396 MB/s +mke2fs 1.41.4 (27-Jan-2009) +Filesystem label= +OS type: Linux +Block size=1024 (log=0) +Fragment size=1024 (log=0) +15360 inodes, 61440 blocks +3072 blocks (5.00%) reserved for the super user +First data block=1 +Maximum filesystem blocks=62914560 +8 block groups +8192 blocks per group, 8192 fragments per group +1920 inodes per group +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345 + +Writing inode tables: 0/8\b\b\b1/8\b\b\b2/8\b\b\b3/8\b\b\b4/8\b\b\b5/8\b\b\b6/8\b\b\b7/8\b\b\bdone +Writing superblocks and filesystem accounting information: done + +This filesystem will be automatically checked every 27 mounts or +180 days, whichever comes first. Use tune2fs -c or -i to override. +ln: creating symbolic link `mnt/bin/sh': File exists +ln: creating symbolic link `mnt/usr/lib64/libnfsidmap_nsswitch.so.0': No such file or directory +ln: creating symbolic link `mnt/nfs/client/bin/sh': File exists + +11804 blocks +W: Possible missing firmware /lib/firmware/kaweth/trigger_code_fix.bin for module kaweth.ko +W: Possible missing firmware /lib/firmware/kaweth/trigger_code.bin for module kaweth.ko +W: Possible missing firmware /lib/firmware/kaweth/new_code_fix.bin for module kaweth.ko +W: Possible missing firmware /lib/firmware/kaweth/new_code.bin for module kaweth.ko +W: Possible missing firmware /lib/firmware/sun/cassini.bin for module cassini.ko +ln: creating symbolic link `/tmp/initramfs.KxYIth/usr/lib64/libnfsidmap_nsswitch.so.0': No such file or directory + +42645 blocks +MULTINIC TEST SETUP: Starting DHCP/NFS server +setsockopt(IP_ADD_MEMBERSHIP): No such device +Could not initialize device 'socket' +Failed to start server +cat: server.pid: Permission denied +Usage: + kill pid ... Send SIGTERM to every process listed. + kill signal pid ... Send a signal to every process listed. + kill -s signal pid ... Send a signal to every process listed. + kill -l List all signal names. + kill -L List all signal names in a nice table. + kill -l signal Convert between signal numbers and names. diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh new file mode 100755 index 0000000..3d43b13 --- /dev/null +++ b/test/TEST-50-MULTINIC/test.sh @@ -0,0 +1,225 @@ +#!/bin/bash +TEST_DESCRIPTION="root filesystem on NFS with multiple nics" + +KVERSION=${KVERSION-$(uname -r)} + +# Uncomment this to debug failures +#DEBUGFAIL="rdinitdebug rdnetdebug" + +run_server() { + # Start server first + echo "MULTINIC TEST SETUP: Starting DHCP/NFS server" + + $testdir/run-qemu -hda server.ext2 -m 512M -nographic \ + -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ + -net socket,mcast=230.0.0.1:1234 \ + -serial udp:127.0.0.1:9999 \ + -kernel /boot/vmlinuz-$KVERSION \ + -append "root=/dev/sda rw quiet console=ttyS0,115200n81" \ + -initrd initramfs.server -pidfile server.pid -daemonize || return 1 + sudo chmod 644 server.pid || return 1 + + # Cleanup the terminal if we have one + tty -s && stty sane + + echo Sleeping 10 seconds to give the server a head start + sleep 10 +} + +client_test() { + local test_name="$1" + local mac1="$2" + local mac2="$3" + local mac3="$4" + local cmdline="$5" + local check="$6" + + echo "CLIENT TEST START: $test_name" + + # Need this so kvm-qemu will boot (needs non-/dev/zero local disk) + if ! dd if=/dev/zero of=client.img bs=1M count=1; then + echo "Unable to make client sda image" 1>&2 + return 1 + fi + + $testdir/run-qemu -hda client.img -m 512M -nographic \ + -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \ + -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ + -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \ + -net socket,mcast=230.0.0.1:1234 \ + -kernel /boot/vmlinuz-$KVERSION \ + -append "$cmdline $DEBUGFAIL ro quiet console=ttyS0,115200n81" \ + -initrd initramfs.testing + + if [[ $? -ne 0 ]] || ! grep -m 1 -q OK client.img; then + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" + return 1 + fi + + + for i in $check ; do + echo $i + if ! grep -m 1 -q net.$i.ifcfg client.img; then + echo "CLIENT TEST END: $test_name [FAILED - BAD IF]" + return 1 + fi + done + + echo "CLIENT TEST END: $test_name [OK]" + return 0 +} + + +test_run() { + if ! run_server; then + echo "Failed to start server" 1>&2 + return 1 + fi + + # Mac Numbering Scheme + # ...:00-02 receive IP adresses all others don't + # ...:02 receives a dhcp root-path + + # PXE Style BOOTIF= + client_test "MULTINIC root=nfs,BOOTIF=" \ + 00 01 02 \ + "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \ + "eth0" || return 1 + + # PXE Style BOOTIF= with dhcp root-path + client_test "MULTINIC root=dhcp BOOTIF=" \ + 00 01 02 \ + "root=dhcp BOOTIF=52-54-00-12-34-02" \ + "eth2" || return 1 + + # Multinic case, where only one nic works + client_test "MULTINIC root=nfs ip=dhcp" \ + FF 00 FE \ + "root=nfs:192.168.50.1:/nfs/client ip=dhcp" \ + "eth1" || return 1 + + # Require two interfaces + client_test "MULTINIC root=nfs ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \ + 00 01 02 \ + "root=nfs:192.168.50.1:/nfs/client ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \ + "eth1 eth2" || return 1 + + # Require three interfaces with dhcp root-path + client_test "MULTINIC root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \ + 00 01 02 \ + "root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \ + "eth0 eth1 eth2" || return 1 +} + +test_setup() { + # Make server root + dd if=/dev/zero of=server.ext2 bs=1M count=60 + mke2fs -F server.ext2 + mkdir mnt + sudo mount -o loop server.ext2 mnt + + kernel=$KVERSION + ( + initdir=mnt + . $basedir/dracut-functions + dracut_install sh ls shutdown poweroff stty cat ps ln ip \ + /lib/terminfo/l/linux dmesg mkdir cp ping exportfs \ + modprobe rpc.nfsd rpc.mountd showmount tcpdump \ + /etc/services sleep mount chmod + which portmap >/dev/null 2>&1 && dracut_install portmap + which rpcbind >/dev/null 2>&1 && dracut_install rpcbind + [ -f /etc/netconfig ] && dracut_install /etc/netconfig + which dhcpd >/dev/null 2>&1 && dracut_install dhcpd + [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd + instmods nfsd sunrpc ipv6 + inst ./server-init /sbin/init + inst ./hosts /etc/hosts + inst ./exports /etc/exports + inst ./dhcpd.conf /etc/dhcpd.conf + dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols + dracut_install rpc.idmapd /etc/idmapd.conf + if ldd $(which rpc.idmapd) |grep -q lib64; then + LIBDIR="/lib64" + else + LIBDIR="/lib" + fi + + dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap*.so* 2>/dev/null ) + dracut_install $(ls {/usr,}$LIBDIR/libnss*.so 2>/dev/null) + ( + cd "$initdir"; + mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind} + mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs} + chmod 777 var/lib/rpcbind var/lib/nfs + ) + inst /etc/nsswitch.conf /etc/nsswitch.conf + inst /etc/passwd /etc/passwd + inst /etc/group /etc/group + for i in /lib*/libnss_files**;do + inst_library $i + done + + /sbin/depmod -a -b "$initdir" $kernel + ldconfig -n -r "$initdir" /lib* /usr/lib* + ) + + # Make client root inside server root + initdir=mnt/nfs/client + mkdir -p $initdir + + ( + . $basedir/dracut-functions + dracut_install sh shutdown poweroff stty cat ps ln ip \ + /lib/terminfo/l/linux mount dmesg mkdir \ + cp ping grep ls + inst ./client-init /sbin/init + ( + cd "$initdir" + mkdir -p dev sys proc etc + mkdir -p var/lib/nfs/rpc_pipefs + ) + inst /etc/nsswitch.conf /etc/nsswitch.conf + inst /etc/passwd /etc/passwd + inst /etc/group /etc/group + for i in /lib*/libnss_files*;do + inst_library $i + done + + ldconfig -n -r "$initdir" /lib* /usr/lib* + ) + + sudo umount mnt + rm -fr mnt + + # Make an overlay with needed tools for the test harness + ( + initdir=overlay + mkdir overlay + . $basedir/dracut-functions + dracut_install poweroff shutdown + inst_simple ./hard-off.sh /emergency/01hard-off.sh + ) + + # Make server's dracut image + $basedir/dracut -l -i overlay / \ + -m "dash udev-rules base rootfs-block debug" \ + -d "ata_piix ext2 sd_mod e1000" \ + -f initramfs.server $KVERSION || return 1 + + # Make client's dracut image + $basedir/dracut -l -i overlay / \ + -m "dash udev-rules base network nfs debug" \ + -d "e1000 nfs sunrpc" \ + -f initramfs.testing $KVERSION || return 1 +} + +test_cleanup() { + if [[ -s server.pid ]]; then + sudo kill -TERM $(cat server.pid) + rm -f server.pid + fi + rm -rf mnt overlay + rm -f server.ext2 client.img initramfs.server initramfs.testing +} + +. $testdir/test-functions -- 1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <1245866912-3643-6-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org>]
* Re: [PATCH 5/5] Add multinic test suite [not found] ` <1245866912-3643-6-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> @ 2009-06-26 2:56 ` David Dillow [not found] ` <1245985005.30948.11.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org> 0 siblings, 1 reply; 14+ messages in thread From: David Dillow @ 2009-06-26 2:56 UTC (permalink / raw) To: Philippe Seewer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA On Wed, 2009-06-24 at 20:08 +0200, Philippe Seewer wrote: > This is a start at a test suite for the multinic part of dracut Seems sane, some minor issues. > diff --git a/test/TEST-50-MULTINIC/test.log b/test/TEST-50-MULTINIC/test.log > new file mode 100644 > index 0000000..f3c0c59 > --- /dev/null > +++ b/test/TEST-50-MULTINIC/test.log This shouldn't be part of the commit... > +MULTINIC TEST SETUP: Starting DHCP/NFS server > +setsockopt(IP_ADD_MEMBERSHIP): No such device > +Could not initialize device 'socket' > +Failed to start server > +cat: server.pid: Permission denied > +Usage: > + kill pid ... Send SIGTERM to every process listed. What's this all about? Does the test suite work? -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <1245985005.30948.11.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>]
* Re: [PATCH 5/5] Add multinic test suite [not found] ` <1245985005.30948.11.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org> @ 2009-06-26 6:43 ` Seewer Philippe 0 siblings, 0 replies; 14+ messages in thread From: Seewer Philippe @ 2009-06-26 6:43 UTC (permalink / raw) To: David Dillow; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA David Dillow wrote: > On Wed, 2009-06-24 at 20:08 +0200, Philippe Seewer wrote: >> This is a start at a test suite for the multinic part of dracut > > Seems sane, some minor issues. > >> diff --git a/test/TEST-50-MULTINIC/test.log b/test/TEST-50-MULTINIC/test.log >> new file mode 100644 >> index 0000000..f3c0c59 >> --- /dev/null >> +++ b/test/TEST-50-MULTINIC/test.log > > This shouldn't be part of the commit... *sigh* Yes. Apologies. >> +MULTINIC TEST SETUP: Starting DHCP/NFS server >> +setsockopt(IP_ADD_MEMBERSHIP): No such device >> +Could not initialize device 'socket' >> +Failed to start server >> +cat: server.pid: Permission denied >> +Usage: >> + kill pid ... Send SIGTERM to every process listed. > > What's this all about? Does the test suite work? That is weird. The server startup code is the same as with the NFS and NDB (except for 512MB allocated instead of 128MB). The only thing I noticed, but that goes for all test-suites, is that if you don't have any local network connections the servers won't start producing exactly your error. Do the other tests run with you? Thanks, Philippe -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/5] Netroot updates and multinic test-suite [not found] ` <1245866912-3643-1-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org> ` (4 preceding siblings ...) 2009-06-24 18:08 ` [PATCH 5/5] Add multinic test suite Philippe Seewer @ 2009-06-26 3:20 ` David Dillow 5 siblings, 0 replies; 14+ messages in thread From: David Dillow @ 2009-06-26 3:20 UTC (permalink / raw) To: Philippe Seewer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA On Wed, 2009-06-24 at 20:08 +0200, Philippe Seewer wrote: > This is a first start at a multinic testsuite, some > improvements to netroot and a bugfix. > > Patches can be pulled from > git://github.com/seewer/dracut-seewer.git > as well The BOOTIF bug fix could go as-is, but I think the rest of the series needs to be respun once the issues are addressed. -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2009-06-26 7:07 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-24 18:08 [PATCH 0/5] Netroot updates and multinic test-suite Philippe Seewer
[not found] ` <1245866912-3643-1-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org>
2009-06-24 18:08 ` [PATCH 1/5] Bugfix: Fix BOOTIF argument translation Philippe Seewer
2009-06-24 18:08 ` [PATCH 2/5] Give the kernel some time to up interfaces Philippe Seewer
[not found] ` <1245866912-3643-3-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org>
2009-06-26 3:02 ` David Dillow
[not found] ` <1245985355.30948.14.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2009-06-26 7:07 ` Seewer Philippe
2009-06-24 18:08 ` [PATCH 3/5] Be a bit more optimistic when setting mtus Philippe Seewer
2009-06-24 18:08 ` [PATCH 4/5] Add DAD do dhclient-script Philippe Seewer
[not found] ` <1245866912-3643-5-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org>
2009-06-24 18:39 ` David Dillow
[not found] ` <1245868789.31775.16.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2009-06-24 19:56 ` Seewer Philippe
[not found] ` <4A4284D3.5050007-omB+W0Dpw2o@public.gmane.org>
2009-06-26 2:45 ` David Dillow
2009-06-24 18:08 ` [PATCH 5/5] Add multinic test suite Philippe Seewer
[not found] ` <1245866912-3643-6-git-send-email-philippe.seewer-omB+W0Dpw2o@public.gmane.org>
2009-06-26 2:56 ` David Dillow
[not found] ` <1245985005.30948.11.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2009-06-26 6:43 ` Seewer Philippe
2009-06-26 3:20 ` [PATCH 0/5] Netroot updates and multinic test-suite David Dillow
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.