aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-01-07 20:30:50 (GMT)
committerJouni Malinen <j@w1.fi>2017-01-07 22:10:57 (GMT)
commitddff4f3c5e6c4bce65f6014e316a6732aa382fd7 (patch)
tree92d30169d0f831d431b3601f52eb46a70f446680 /tests
parent54736d835831469d379da01ccf3a3690ba8eea0e (diff)
downloadhostap-ddff4f3c5e6c4bce65f6014e316a6732aa382fd7.zip
hostap-ddff4f3c5e6c4bce65f6014e316a6732aa382fd7.tar.gz
hostap-ddff4f3c5e6c4bce65f6014e316a6732aa382fd7.tar.bz2
tests: Use logdir for config file in wpas_config_file
This reduces use of /tmp for test case specific dynamically created files. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_wpas_config.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/hwsim/test_wpas_config.py b/tests/hwsim/test_wpas_config.py
index 4110916..5d29026 100644
--- a/tests/hwsim/test_wpas_config.py
+++ b/tests/hwsim/test_wpas_config.py
@@ -40,11 +40,18 @@ def check_config(config):
raise Exception("Missing ip_addr_end")
return data
-def test_wpas_config_file(dev):
+def test_wpas_config_file(dev, apdev, params):
"""wpa_supplicant config file parsing/writing"""
- config = "/tmp/test_wpas_config_file.conf"
+ config = os.path.join(params['logdir'], 'wpas_config_file.conf')
if os.path.exists(config):
- os.remove(config)
+ try:
+ os.remove(config)
+ except:
+ pass
+ try:
+ os.rmdir(config)
+ except:
+ pass
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
try:
@@ -148,14 +155,6 @@ def test_wpas_config_file(dev):
finally:
try:
- os.remove(config)
- except:
- pass
- try:
- os.remove(config + ".tmp")
- except:
- pass
- try:
os.rmdir(config)
except:
pass