* [PATCH v4 03/13] auto-t: remove waitstatus_to_exitcode for better compatibility
@ 2022-03-28 17:28 James Prestwood
0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2022-03-28 17:28 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]
This was added in Python 3.9 which isn't always supported. Instead use
the subprocess module which automatically checks the command output.
---
autotests/testNetconfig/connection_test.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/autotests/testNetconfig/connection_test.py b/autotests/testNetconfig/connection_test.py
index 8eeffbbd..91c6eb6b 100644
--- a/autotests/testNetconfig/connection_test.py
+++ b/autotests/testNetconfig/connection_test.py
@@ -12,6 +12,7 @@ from hostapd import HostapdCLI
import testutil
from config import ctx
import os, time
+import subprocess
class Test(unittest.TestCase):
@@ -40,8 +41,8 @@ class Test(unittest.TestCase):
testutil.test_ifaces_connected()
time.sleep(2)
- ret = os.system('ip addr show ' + device.name + ' | grep \'inet6 3ffe:501:ffff:100::\'')
- self.assertEqual(os.waitstatus_to_exitcode(ret), 0)
+ subprocess.check_output('ip addr show ' + device.name + \
+ ' | grep \'inet6 3ffe:501:ffff:100::\'', shell=True)
device.disconnect()
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-28 17:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 17:28 [PATCH v4 03/13] auto-t: remove waitstatus_to_exitcode for better compatibility James Prestwood
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.