Browse Source

tests: Use cmd_execute() for ip addr add/del

The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "ip addr add/del .." so that this would also work on remote
setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
Jonathan Afek 8 years ago
parent
commit
40c62e6e8d
1 changed files with 4 additions and 4 deletions
  1. 4 4
      tests/hwsim/test_wpas_ctrl.py

+ 4 - 4
tests/hwsim/test_wpas_ctrl.py

@@ -1259,14 +1259,14 @@ def test_wpas_ctrl_roam(dev, apdev):
 def test_wpas_ctrl_ipaddr(dev, apdev):
     """wpa_supplicant IP address in STATUS"""
     try:
-        subprocess.call(['ip', 'addr', 'add', '10.174.65.207/32', 'dev',
-                         dev[0].ifname])
+        dev[0].cmd_execute(['ip', 'addr', 'add', '10.174.65.207/32', 'dev',
+                            dev[0].ifname])
         ipaddr = dev[0].get_status_field('ip_address')
         if ipaddr != '10.174.65.207':
             raise Exception("IP address not in STATUS output")
     finally:
-        subprocess.call(['ip', 'addr', 'del', '10.174.65.207/32', 'dev',
-                         dev[0].ifname])
+        dev[0].cmd_execute(['ip', 'addr', 'del', '10.174.65.207/32', 'dev',
+                            dev[0].ifname])
 
 def test_wpas_ctrl_rsp(dev, apdev):
     """wpa_supplicant ctrl_iface CTRL-RSP-"""