From 30410dbb5bb698c0737587c1e10a9d305a02ac70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Sat, 7 Sep 2019 14:35:39 -0700 Subject: net-test: fix leak_test.py on 5.1+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We only actually care about the value not becoming negative, older kernels (with fix) treated negative as minimum, newer ones treat it as maximum (but positive). As such a >= min works on both. Tested: by running leak_test on 5.1.21 Bug: 140201217 Signed-off-by: Maciej Żenczykowski Change-Id: I4d8c76e09b072ce3beae7e0076ebbd9d3f69e96b --- net/test/leak_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/test/leak_test.py b/net/test/leak_test.py index 4659046..8a42611 100755 --- a/net/test/leak_test.py +++ b/net/test/leak_test.py @@ -65,13 +65,13 @@ class ForceSocketBufferOptionTest(net_test.NetworkTest): s.setsockopt(SOL_SOCKET, force_option, val) self.assertEquals(2 * val, s.getsockopt(SOL_SOCKET, option)) - # Check that the force option sets the minimum value instead of a negative - # value on integer overflow. Because the kernel multiplies passed-in values - # by 2, pick a value that becomes a small negative number if treated as - # unsigned. + # Check that the force option sets at least the minimum value instead + # of a negative value on integer overflow. Because the kernel multiplies + # passed-in values by 2, pick a value that becomes a small negative number + # if treated as unsigned. bogusval = 2 ** 31 - val s.setsockopt(SOL_SOCKET, force_option, bogusval) - self.assertEquals(minbuf, s.getsockopt(SOL_SOCKET, option)) + self.assertLessEqual(minbuf, s.getsockopt(SOL_SOCKET, option)) def testRcvBufForce(self): self.CheckForceSocketBufferOption(SO_RCVBUF, self.SO_RCVBUFFORCE) -- cgit v1.2.3 From cfa88f7f574b27acfd6174d9a6ce77759ca3507b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Mon, 2 Sep 2019 09:33:34 -0700 Subject: net-test: shutdown after 1 second on panic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding kernel command line option 'panic=1' causes a panic to reboot the system after 1 second. However the pre-existing '-no-reboot' flag causes a reboot signal to terminate QEMU instead of rebooting it. (and it doesn't hurt UML either) This fixes a problem where on panic you have to 'CTRL+A exit' from qemu. It does not yet get rid of the occasional panic instead of clean shutdown problem that I have not been able to track down the cause of. Tested: via 'echo c > /proc/sysrq-trigger' on both UML and QEMU. Bug: 140201217 Signed-off-by: Maciej Żenczykowski Change-Id: I0e6646fb843300d2f714aac8b65159dd2001ef16 --- net/test/run_net_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/test/run_net_test.sh b/net/test/run_net_test.sh index 4d46f3a..73383d8 100755 --- a/net/test/run_net_test.sh +++ b/net/test/run_net_test.sh @@ -277,7 +277,7 @@ if (( verbose == 1 )); then cmdline="$cmdline verbose=1" fi -cmdline="$cmdline init=/sbin/net_test.sh" +cmdline="$cmdline panic=1 init=/sbin/net_test.sh" cmdline="$cmdline net_test_args=\"$test_args\" net_test_mode=$testmode" if [ "$ARCH" == "um" ]; then -- cgit v1.2.3 From 32699ef34e5e8a0c0891d8d9d3caabdd97c15424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Mon, 2 Sep 2019 09:33:51 -0700 Subject: net-test: change UML console detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a non-functional console on newer kernels under QEMU. (they appear to have /dev/tty0) Tested: on both UML and QEMU Bug: 140201217 Signed-off-by: Maciej Żenczykowski Change-Id: I8eec04a64e709de7a970de2b08ce5e6487830f96 --- net/test/net_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/test/net_test.sh b/net/test/net_test.sh index 45fa8e4..9b9773e 100755 --- a/net/test/net_test.sh +++ b/net/test/net_test.sh @@ -32,8 +32,8 @@ if [[ "$(tty)" == '/dev/console' ]]; then ARCH="${ARCH//_/-}" # setsid + /dev/tty{,AMA,S}0 allows bash's job control to work, ie. Ctrl+C/Z - if [[ -c '/dev/tty0' ]]; then - # exists in UML, does not exist on graphics/vga/curses-less QEMU + if [[ -e '/proc/exitcode' ]]; then + # exists only in UML CON='/dev/tty0' hostname "uml-${ARCH}" elif [[ -c '/dev/ttyAMA0' ]]; then -- cgit v1.2.3