tests: SAVE_CONFIG error cases
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
76b7694177
commit
80cb463463
1 changed files with 15 additions and 0 deletions
|
@ -113,5 +113,20 @@ def test_wpas_config_file(dev):
|
||||||
logger.debug(data2)
|
logger.debug(data2)
|
||||||
raise Exception("Unexpected configuration change")
|
raise Exception("Unexpected configuration change")
|
||||||
|
|
||||||
|
wpas.request("SET update_config 0")
|
||||||
|
if "OK" in wpas.request("SAVE_CONFIG"):
|
||||||
|
raise Exception("SAVE_CONFIG succeeded unexpectedly")
|
||||||
|
if "OK" in wpas.global_request("SAVE_CONFIG"):
|
||||||
|
raise Exception("SAVE_CONFIG (global) succeeded unexpectedly")
|
||||||
|
|
||||||
|
# symlink config file to itself to break writing
|
||||||
|
subprocess.call(['rm', config])
|
||||||
|
subprocess.call(['ln', '-s', config, config])
|
||||||
|
wpas.request("SET update_config 1")
|
||||||
|
if "OK" in wpas.request("SAVE_CONFIG"):
|
||||||
|
raise Exception("SAVE_CONFIG succeeded unexpectedly")
|
||||||
|
if "OK" in wpas.global_request("SAVE_CONFIG"):
|
||||||
|
raise Exception("SAVE_CONFIG (global) succeeded unexpectedly")
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
subprocess.call(['sudo', 'rm', config])
|
subprocess.call(['sudo', 'rm', config])
|
||||||
|
|
Loading…
Reference in a new issue