net-test: work around UML crashes during shutdown
Sometimes the tests all pass, but UML crashes during the shutdown process itself:
As such we can't actually rely on the /proc/exitcode returned value.
Before this change (rarely):
##### 0 failed tests.
reboot: System halted
../kernel/tests/net/test/run_net_test.sh: line 431: 61682 Aborted (core dumped)
$KERNEL_BINARY umid=net_test mem=512M $blockdevice=$ROOTFS $netconfig $consolemode $cmdline 1>&2
stty: standard input: Inappropriate ioctl for device
Returning exit code 134.
With this change and an extra 'echo 134 > /proc/exitcode' at end of net_test.sh
(to simulate a UML crash):
##### 0 failed tests.
epollctl add err fd 3, Operation not permitted
epollctl add err fd 19, Operation not permitted
reboot: System halted
Warning: UML appears to have crashed after successfully executing the tests.
Info: retrieved exit code 0.
Returning exit code 0.
Normally:
##### 0 failed tests.
epollctl add err fd 3, Operation not permitted
epollctl add err fd 19, Operation not permitted
reboot: System halted
Info: retrieved exit code 0.
Returning exit code 0.
(I don't know why the epollctl add errors show up - but they don't appear to hurt.)
Some useful docs about UML kernel command line options at:
http://user-mode-linux.sourceforge.net/old/input.html
https://www.kernel.org/doc/html/latest/virt/uml/user_mode_linux_howto_v2.html
Tested: see above
Signed-off-by: Maciej Żenczykowski <[email protected]>
Change-Id: I37a67f140b5fa022f3dde97fbe45373df1a9a20d
Merged-In: I37a67f140b5fa022f3dde97fbe45373df1a9a20d
(cherrypicked from 0c89e40ce29b1908c546619e30e04fe5a6e6c6d2)
2 files changed