From 23c024b9c1bad42b978f005c99b9817363aed9de Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 4 May 2018 23:56:32 +0300 Subject: [PATCH] tests: Do not fail if driver supports power saving Couple of "invalid value" tests started to fail now that mac80211_hwsim actually accepts power save configuration. Fix these by running the same command for more code coverage, but in a way that ignores the result of the operation (succeeds with older kernel versions and fails with newer). Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_set.py | 4 +++- tests/hwsim/test_wpas_ctrl.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_p2p_set.py b/tests/hwsim/test_p2p_set.py index a96b57289..0bdc859b1 100644 --- a/tests/hwsim/test_p2p_set.py +++ b/tests/hwsim/test_p2p_set.py @@ -19,7 +19,6 @@ def test_p2p_set(dev): "noa 0,0,-1", "noa 0,0,1", "noa 255,10,20", - "ps 1", "ps 2", "oppps 1", "ctwindow 1", @@ -36,6 +35,9 @@ def test_p2p_set(dev): "ssid_postfix 123456789012345678901234" ]: if "FAIL" not in dev[0].request("P2P_SET " + cmd): raise Exception("Invalid P2P_SET accepted: " + cmd) + dev[0].request("P2P_SET ps 1") + if "OK" not in dev[0].request("P2P_SET ps 0"): + raise Exception("P2P_SET ps 0 failed unexpectedly") def test_p2p_set_discoverability(dev): """P2P_SET discoverability""" diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index 15928f5e3..f8b501a1f 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -922,7 +922,6 @@ def test_wpas_ctrl_set(dev): "ampdu 0", "radio_disable 0", "ps 10", - "ps 1", "dot11RSNAConfigPMKLifetime 0", "dot11RSNAConfigPMKReauthThreshold 101", "dot11RSNAConfigSATimeout 0", @@ -934,6 +933,10 @@ def test_wpas_ctrl_set(dev): if "FAIL" not in dev[0].request("SET " + val): raise Exception("Unexpected SET success for " + val) + vals = [ "ps 1" ] + for val in vals: + dev[0].request("SET " + val) + vals = [ "EAPOL::heldPeriod 60", "EAPOL::authPeriod 30", "EAPOL::startPeriod 30",