From 40c62e6e8d815ee99d6fa29ac7c4a22cea5be68b Mon Sep 17 00:00:00 2001 From: Jonathan Afek Date: Thu, 23 Jun 2016 20:16:29 +0300 Subject: [PATCH] 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 --- tests/hwsim/test_wpas_ctrl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index eb5d11318..8a22106d4 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/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-"""