]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix ap_wps_wpa_cli_action outside VM
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 23 Jul 2015 17:48:33 +0000 (20:48 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 23 Jul 2015 17:48:33 +0000 (20:48 +0300)
Pass absolute path to the daemonized wpa_cli process and add read
privileges for everyone on the action script to make this test case work
better when run without a VM.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_ap_wps.py

index 4890ab9fc3e5afb5c7dcf874426042faf6bedea6..a69c493d894a643dbd41c0c052586fc433ed2a8f 100644 (file)
@@ -2726,12 +2726,10 @@ def _test_ap_wps_er_oom(dev, apdev):
 
 def test_ap_wps_wpa_cli_action(dev, apdev, test_params):
     """WPS events and wpa_cli action script"""
-    pidfile = os.path.join(test_params['logdir'],
-                           'ap_wps_wpa_cli_action.wpa_cli.pid')
-    logfile = os.path.join(test_params['logdir'],
-                           'ap_wps_wpa_cli_action.wpa_cli.res')
-    actionfile = os.path.join(test_params['logdir'],
-                              'ap_wps_wpa_cli_action.wpa_cli.action.sh')
+    logdir = os.path.abspath(test_params['logdir'])
+    pidfile = os.path.join(logdir, 'ap_wps_wpa_cli_action.wpa_cli.pid')
+    logfile = os.path.join(logdir, 'ap_wps_wpa_cli_action.wpa_cli.res')
+    actionfile = os.path.join(logdir, 'ap_wps_wpa_cli_action.wpa_cli.action.sh')
 
     with open(actionfile, 'w') as f:
         f.write('#!/bin/sh\n')
@@ -2741,7 +2739,8 @@ def test_ap_wps_wpa_cli_action(dev, apdev, test_params):
         # eloop SIGALRM signal has been scheduled.
         f.write('if [ $2 = "WPS-SUCCESS" -a -r %s ]; then kill `cat %s`; sleep 1; fi\n' % (pidfile, pidfile))
 
-    os.chmod(actionfile, stat.S_IREAD | stat.S_IEXEC)
+    os.chmod(actionfile, stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC |
+             stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
 
     ssid = "test-wps-conf"
     hostapd.add_ap(apdev[0]['ifname'],