Skip to content

Commit

Permalink
Merge pull request kubernetes#10703 from jszczepkowski/e2e-restart
Browse files Browse the repository at this point in the history
Fixed flakiness of firewall cases of e2e reboot test.
  • Loading branch information
yujuhong committed Jul 6, 2015
2 parents c8f8e5f + 1bd0c1b commit 934af8f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/e2e/reboot.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,17 @@ var _ = Describe("Reboot", func() {
It("each node by dropping all inbound packets for a while and ensure they function afterwards", func() {
// tell the firewall to drop all inbound packets for a while
// We sleep 10 seconds to give some time for ssh command to cleanly finish before starting dropping inbound packets.
testReboot(c, "nohup sh -c 'sleep 10 && sudo iptables -A INPUT -j DROP && sleep 120 && sudo iptables -D INPUT -j DROP' >/dev/null 2>&1 &")
// We still accept packages send from localhost to prevent monit from restarting kubelet.
testReboot(c, "nohup sh -c 'sleep 10 && sudo iptables -A INPUT -s 127.0.0.1 -j ACCEPT && sudo iptables -A INPUT -j DROP && "+
" sleep 120 && sudo iptables -D INPUT -j DROP && sudo iptables -D INPUT -s 127.0.0.1 -j ACCEPT' >/dev/null 2>&1 &")
})

It("each node by dropping all outbound packets for a while and ensure they function afterwards", func() {
// tell the firewall to drop all outbound packets for a while
// We sleep 10 seconds to give some time for ssh command to cleanly finish before starting dropping outbound packets.
testReboot(c, "nohup sh -c 'sleep 10 && sudo iptables -A OUTPUT -j DROP && sleep 120 && sudo iptables -D OUTPUT -j DROP' >/dev/null 2>&1 &")
// We still accept packages send to localhost to prevent monit from restarting kubelet.
testReboot(c, "nohup sh -c 'sleep 10 && sudo iptables -A OUTPUT -s 127.0.0.1 -j ACCEPT && sudo iptables -A OUTPUT -j DROP && "+
" sleep 120 && sudo iptables -D OUTPUT -j DROP && sudo iptables -D OUTPUT -s 127.0.0.1 -j ACCEPT' >/dev/null 2>&1 &")
})
})

Expand Down

0 comments on commit 934af8f

Please sign in to comment.