]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix skipping of new sigma_dut test cases
authorJouni Malinen <jouni@codeaurora.org>
Fri, 13 Dec 2019 19:19:36 +0000 (21:19 +0200)
committerJouni Malinen <jouni@codeaurora.org>
Fri, 13 Dec 2019 19:19:36 +0000 (21:19 +0200)
start_sigma_dut() can raise an exception and as such, assigning a
variable to its return value within a try block does not work in this
manner when the result is supposed to be used in the finally statement.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_sigma_dut.py

index 779ea749817fd115cd23829b2b584e25f29b8052..68db114da1c71a1ba8efafd22f36bef8c8c3b7b0 100644 (file)
@@ -3515,9 +3515,8 @@ def test_sigma_dut_sae_h2e_loop_forcing(dev, apdev):
     hapd = hostapd.add_ap(apdev[0], params)
 
     ifname = dev[0].ifname
+    sigma = start_sigma_dut(ifname)
     try:
-        sigma = start_sigma_dut(ifname)
-
         sigma_dut_cmd_check("sta_reset_default,interface,%s" % ifname)
         sigma_dut_cmd_check("sta_set_ip_config,interface,%s,dhcp,0,ip,127.0.0.11,mask,255.255.255.0" % ifname)
         sigma_dut_cmd_check("sta_set_security,interface,%s,ssid,%s,passphrase,%s,type,SAE,encpType,aes-ccmp,keymgmttype,wpa2,IgnoreH2E_RSNXE_BSSMemSel,1" % (ifname, "test-sae", "12345678"))
@@ -3545,9 +3544,8 @@ def test_sigma_dut_sae_h2e_enabled_group_rejected(dev, apdev):
     hapd = hostapd.add_ap(apdev[0], params)
 
     ifname = dev[0].ifname
+    sigma = start_sigma_dut(ifname, sae_h2e=True)
     try:
-        sigma = start_sigma_dut(ifname, sae_h2e=True)
-
         sigma_dut_cmd_check("sta_reset_default,interface,%s" % ifname)
         sigma_dut_cmd_check("sta_set_ip_config,interface,%s,dhcp,0,ip,127.0.0.11,mask,255.255.255.0" % ifname)
         sigma_dut_cmd_check("sta_set_security,interface,%s,ssid,%s,passphrase,%s,type,SAE,encpType,aes-ccmp,keymgmttype,wpa2,ECGroupID_RGE,19 123" % (ifname, "test-sae", "12345678"))
@@ -3575,9 +3573,8 @@ def test_sigma_dut_sae_h2e_rsnxe_mismatch(dev, apdev):
     hapd = hostapd.add_ap(apdev[0], params)
 
     ifname = dev[0].ifname
+    sigma = start_sigma_dut(ifname, sae_h2e=True)
     try:
-        sigma = start_sigma_dut(ifname, sae_h2e=True)
-
         sigma_dut_cmd_check("sta_reset_default,interface,%s" % ifname)
         sigma_dut_cmd_check("sta_set_ip_config,interface,%s,dhcp,0,ip,127.0.0.11,mask,255.255.255.0" % ifname)
         sigma_dut_cmd_check("sta_set_security,interface,%s,ssid,%s,passphrase,%s,type,SAE,encpType,aes-ccmp,keymgmttype,wpa2,RSNXE_Content,EapolM2:F40100" % (ifname, "test-sae", "12345678"))