From c9a9ae07e6522577008bc63ba6a0e1843daa6d8a Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Mon, 6 Aug 2018 11:49:12 -0400 Subject: [PATCH] e2e: Ensure that sysrq-trigger is enabled before use On Ubuntu (and, presumably, other distros too), the default configuration prohibits some sysrq operations. Before performing sysrq operations in the e2e testing, ensure that all operations are permitted. --- test/e2e/lifecycle/reboot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/lifecycle/reboot.go b/test/e2e/lifecycle/reboot.go index c7cf5cad4e..57df7d1d2d 100644 --- a/test/e2e/lifecycle/reboot.go +++ b/test/e2e/lifecycle/reboot.go @@ -98,13 +98,13 @@ var _ = SIGDescribe("Reboot [Disruptive] [Feature:Reboot]", func() { It("each node by ordering unclean reboot and ensure they function upon restart", func() { // unclean shutdown and restart // We sleep 10 seconds to give some time for ssh command to cleanly finish before the node is shutdown. - testReboot(f.ClientSet, "nohup sh -c 'sleep 10 && echo b | sudo tee /proc/sysrq-trigger' >/dev/null 2>&1 &", nil) + testReboot(f.ClientSet, "nohup sh -c 'echo 1 | sudo tee /proc/sys/kernel/sysrq && sleep 10 && echo b | sudo tee /proc/sysrq-trigger' >/dev/null 2>&1 &", nil) }) It("each node by triggering kernel panic and ensure they function upon restart", func() { // kernel panic // We sleep 10 seconds to give some time for ssh command to cleanly finish before kernel panic is triggered. - testReboot(f.ClientSet, "nohup sh -c 'sleep 10 && echo c | sudo tee /proc/sysrq-trigger' >/dev/null 2>&1 &", nil) + testReboot(f.ClientSet, "nohup sh -c 'echo 1 | sudo tee /proc/sys/kernel/sysrq && sleep 10 && echo c | sudo tee /proc/sysrq-trigger' >/dev/null 2>&1 &", nil) }) It("each node by switching off the network interface and ensure they function upon switch on", func() {