Commit 5a6de4d2 authored by Chris Glass's avatar Chris Glass

Do not use ifupdown commands

The ifupdown commands (ifup and ifdown) are not useful on many modern distributions. Instead, the "ip link set" set of commands are standard linux utilities and should be available everywhere (see http://baturin.org/docs/iproute2/). ipupdown utilities have the added quirk that they return 0 on failure, which makes the changed line fail silently in case ifdown didn't bring the network down. After the interface was brought back up, renew DHCP requests to ensure the network is actually useable. Signed-off-by: 's avatarChris Glass <chris.glass@canonical.com>
parent 20f27a77
...@@ -110,7 +110,7 @@ var _ = SIGDescribe("Reboot [Disruptive] [Feature:Reboot]", func() { ...@@ -110,7 +110,7 @@ var _ = SIGDescribe("Reboot [Disruptive] [Feature:Reboot]", func() {
It("each node by switching off the network interface and ensure they function upon switch on", func() { It("each node by switching off the network interface and ensure they function upon switch on", func() {
// switch the network interface off for a while to simulate a network outage // switch the network interface off for a while to simulate a network outage
// We sleep 10 seconds to give some time for ssh command to cleanly finish before network is down. // We sleep 10 seconds to give some time for ssh command to cleanly finish before network is down.
testReboot(f.ClientSet, "nohup sh -c 'sleep 10 && (sudo ifdown eth0 || sudo ip link set eth0 down) && sleep 120 && (sudo ifup eth0 || sudo ip link set eth0 up)' >/dev/null 2>&1 &", nil) testReboot(f.ClientSet, "nohup sh -c 'sleep 10 && sudo ip link set eth0 down && sleep 120 && sudo ip link set eth0 up && (sudo dhclient || true)' >/dev/null 2>&1 &", nil)
}) })
It("each node by dropping all inbound packets for a while and ensure they function afterwards", func() { It("each node by dropping all inbound packets for a while and ensure they function afterwards", func() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment