[PATCH 16/18] tests: add network to P2P device

Benjamin Berg benjamin at sipsolutions.net
Thu Oct 30 01:24:47 PDT 2025


From: Benjamin Berg <benjamin.berg at intel.com>

If this test is run with a P2P Device Interface, then 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 at intel.com>
---
 tests/hwsim/test_p2p2.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/hwsim/test_p2p2.py b/tests/hwsim/test_p2p2.py
index da944e1adb..946068114d 100644
--- a/tests/hwsim/test_p2p2.py
+++ b/tests/hwsim/test_p2p2.py
@@ -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:
-- 
2.51.0




More information about the Hostap mailing list