From 82146a863dc689d43333511da7305df1207a2d96 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 11 Apr 2014 23:56:57 +0300 Subject: [PATCH] tests: ctrl_iface LOG_LEVEL Signed-off-by: Jouni Malinen --- tests/hwsim/test_wpas_ctrl.py | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index 1b0364294..2a6542d4e 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -639,3 +639,45 @@ def test_wpas_ctrl_blacklist(dev): raise Exception("BLACKLIST clear failed") if dev[0].request("BLACKLIST") != "": raise Exception("Unexpected blacklist contents") + +def test_wpas_ctrl_log_level(dev): + """wpa_supplicant ctrl_iface LOG_LEVEL""" + level = dev[2].request("LOG_LEVEL") + if "Current level: MSGDUMP" not in level: + raise Exception("Unexpected debug level(1): " + level) + if "Timestamp: 1" not in level: + raise Exception("Unexpected timestamp(1): " + level) + + if "OK" not in dev[2].request("LOG_LEVEL MSGDUMP 0"): + raise Exception("LOG_LEVEL failed") + level = dev[2].request("LOG_LEVEL") + if "Current level: MSGDUMP" not in level: + raise Exception("Unexpected debug level(2): " + level) + if "Timestamp: 0" not in level: + raise Exception("Unexpected timestamp(2): " + level) + + if "OK" not in dev[2].request("LOG_LEVEL MSGDUMP 1"): + raise Exception("LOG_LEVEL failed") + level = dev[2].request("LOG_LEVEL") + if "Current level: MSGDUMP" not in level: + raise Exception("Unexpected debug level(3): " + level) + if "Timestamp: 1" not in level: + raise Exception("Unexpected timestamp(3): " + level) + + if "FAIL" not in dev[2].request("LOG_LEVEL FOO"): + raise Exception("Invalid LOG_LEVEL accepted") + + for lev in [ "EXCESSIVE", "MSGDUMP", "DEBUG", "INFO", "WARNING", "ERROR" ]: + if "OK" not in dev[2].request("LOG_LEVEL " + lev): + raise Exception("LOG_LEVEL failed for " + lev) + level = dev[2].request("LOG_LEVEL") + if "Current level: " + lev not in level: + raise Exception("Unexpected debug level: " + level) + + if "OK" not in dev[2].request("LOG_LEVEL MSGDUMP 1"): + raise Exception("LOG_LEVEL failed") + level = dev[2].request("LOG_LEVEL") + if "Current level: MSGDUMP" not in level: + raise Exception("Unexpected debug level(3): " + level) + if "Timestamp: 1" not in level: + raise Exception("Unexpected timestamp(3): " + level)