auto-t: remove ifconfig call from testScan
James Prestwood
PATCH 1/2 auto-t: remove ifconfig call from testScan
ifconfig isn't available by default in several linux distros so instead use 'ip' which seems to be much more widespread.
--- autotests/testScan/remove_iface_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
autotests/testScan/remove_iface_test.py +1 -1
@@ -18,7 +18,7 @@ class Test(unittest.TestCase): device.autoconnect = True device.scan(wait=False) - os.system('ifconfig %s down' % device.name) + os.system('ip link set dev %s down' % device.name) @classmethod def setUpClass(cls):
Signature · 1 line
2.34.1
Denis Kenzior
Hi James,
Quoted 6 lines · James Prestwood
ifconfig isn't available by default in several linux distros so instead use 'ip' which seems to be much more widespread.
--- autotests/testScan/remove_iface_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Both applied, thanks.
Regards,
-Denis
James Prestwood
PATCH 2/2 test-runner: only remove /tmp files if they exist
In reply to James PrestwoodThis bit of code was throwing exceptions if a test cleaned up files that test-runner was expecting to clean up. Specifically testHotspot swaps out main.conf and PSK files many times. This led to the exception being thrown, caught, and ignored but further on test-runner would print:
"File _X_ not cleaned up!"
Now the files will be checked if they exist before trying to remove it.
--- tools/run-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/run-tests +1 -1
@@ -861,7 +861,7 @@ def post_test(ctx, to_copy): for f in to_copy: if os.path.isdir('/tmp/' + f): shutil.rmtree('/tmp/' + f) - else: + elif os.path.exists('/tmp/' + f): os.remove('/tmp/' + f) Process(['ip', 'link', 'set', 'lo', 'down']).wait()
Signature · 1 line
2.34.1