]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Add network to P2P device
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 30 Oct 2025 08:24:47 +0000 (09:24 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 13 Dec 2025 20:20:11 +0000 (22:20 +0200)
If this test is run with a P2P Device Interface, the network must be
specified in the commands. Change the test to use the appropriate
functions so that it works in all cases.

Fixes: 24a33f7ca4cf ("tests: Verify P2P2 PCC Auto GO and PCC client join")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
tests/hwsim/test_p2p2.py

index e71d8c4cb169d66a26e9761316636d060b181b9a..cd1f2bf99feafbc252b613a3fb2ecde4e2fbcfdb 100644 (file)
@@ -411,11 +411,11 @@ def test_p2p_pcc_auto_go_and_pcc_client_join(dev, apdev):
     time.sleep(2)
 
     cli = dev[0]
-    id2 = cli.add_network()
-    cli.set_network_quoted(id2, "ssid", res['ssid'])
-    cli.set_network_quoted(id2, "psk", res['passphrase'])
-    cli.set_network(id2, "mode", "0")
-    cli.set_network(id2, "disabled", "2")
+    id2 = cli.p2pdev_add_network()
+    cli.p2pdev_set_network_quoted(id2, "ssid", res['ssid'])
+    cli.p2pdev_set_network_quoted(id2, "psk", res['passphrase'])
+    cli.p2pdev_set_network(id2, "mode", "0")
+    cli.p2pdev_set_network(id2, "disabled", "2")
     cmd = "P2P_GROUP_ADD persistent=" + str(id2) + " p2p2 p2pmode=2 freq=2437"
     id0 = dev[0].global_request(cmd)
     if "FAIL" in id0: