From: Jouni Malinen Date: Sun, 7 Dec 2014 22:30:18 +0000 (+0200) Subject: tests: SAVE_CONFIG error cases X-Git-Tag: hostap_2_4~882 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80cb4634639df87d0977f12dd50796909ac13839;p=thirdparty%2Fhostap.git tests: SAVE_CONFIG error cases Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_wpas_config.py b/tests/hwsim/test_wpas_config.py index e9d13889b..223b4287a 100644 --- a/tests/hwsim/test_wpas_config.py +++ b/tests/hwsim/test_wpas_config.py @@ -113,5 +113,20 @@ def test_wpas_config_file(dev): logger.debug(data2) 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: subprocess.call(['sudo', 'rm', config])