diff mbox series

tests: Fix ap_ft_r0_key_expiration test

Message ID 20210121154037.32654-4-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series tests: Fix ap_ft_r0_key_expiration test | expand

Commit Message

Andrei Otcheretianski Jan. 21, 2021, 3:40 p.m. UTC
The test configures ft_r0_key_lifetime parameter, however ft_params
already contain the r0_key_lifetime. Since both options are accepted by
hostapd and set the same field, one of them gets overwritten.
As the dictionary enumeration order is not guaranteed in python, the
test may sporadically fail.
Fix that by explicitely removing the unneeded parameter.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
---
 tests/hwsim/test_ap_ft.py | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jouni Malinen Feb. 6, 2021, 10:14 a.m. UTC | #1
On Thu, Jan 21, 2021 at 05:40:35PM +0200, Andrei Otcheretianski wrote:
> The test configures ft_r0_key_lifetime parameter, however ft_params
> already contain the r0_key_lifetime. Since both options are accepted by
> hostapd and set the same field, one of them gets overwritten.
> As the dictionary enumeration order is not guaranteed in python, the
> test may sporadically fail.
> Fix that by explicitely removing the unneeded parameter.

Thanks, applied.
diff mbox series

Patch

diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py
index 12d4c1395e..1598c89a67 100644
--- a/tests/hwsim/test_ap_ft.py
+++ b/tests/hwsim/test_ap_ft.py
@@ -3352,9 +3352,11 @@  def test_ap_ft_r0_key_expiration(dev, apdev):
     passphrase = "12345678"
 
     params = ft_params1(ssid=ssid, passphrase=passphrase)
+    params.pop('r0_key_lifetime', None)
     params['ft_r0_key_lifetime'] = "2"
     hapd0 = hostapd.add_ap(apdev[0], params)
     params = ft_params2(ssid=ssid, passphrase=passphrase)
+    params.pop('r0_key_lifetime', None)
     params['ft_r0_key_lifetime'] = "2"
     hapd1 = hostapd.add_ap(apdev[1], params)