Merge pull request #67023 from OddBloke/sysrq

Automatic merge from submit-queue (batch tested with PRs 66196, 67016, 66807, 67023). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

e2e: Ensure that sysrq-trigger is enabled before use

**What this PR does / why we need it**:

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.

```release-note
NONE
```
pull/8/head
Kubernetes Submit Queue 2018-08-07 11:44:13 -07:00 committed by GitHub
commit 733a381ec4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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() { It("each node by ordering unclean reboot and ensure they function upon restart", func() {
// unclean shutdown and restart // unclean shutdown and restart
// We sleep 10 seconds to give some time for ssh command to cleanly finish before the node is shutdown. // 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() { It("each node by triggering kernel panic and ensure they function upon restart", func() {
// kernel panic // kernel panic
// We sleep 10 seconds to give some time for ssh command to cleanly finish before kernel panic is triggered. // 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() { It("each node by switching off the network interface and ensure they function upon switch on", func() {