tests: Use cmd_execute() in find_wpas_process()
authorJonathan Afek <jonathan@wizery.com>
Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 27 Jun 2016 18:10:35 +0000 (21:10 +0300)
The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "ps ax" so that this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
tests/hwsim/test_ap_psk.py

index ac63837..55f3eda 100644 (file)
@@ -1666,8 +1666,7 @@ def test_ap_wpa2_psk_supp_proto_gtk_not_encrypted(dev, apdev):
 
 def find_wpas_process(dev):
     ifname = dev.ifname
-    cmd = subprocess.Popen(['ps', 'ax'], stdout=subprocess.PIPE)
-    (data,err) = cmd.communicate()
+    err, data = dev.cmd_execute(['ps', 'ax'])
     for l in data.splitlines():
         if "wpa_supplicant" not in l:
             continue