diff mbox

tests: autogo: Use group control interface for GO commands

Message ID 1483004278-11774-1-git-send-email-andrei.otcheretianski@intel.com
State Accepted
Headers show

Commit Message

Andrei Otcheretianski Dec. 29, 2016, 9:37 a.m. UTC
From: Avraham Stern <avraham.stern@intel.com>

The channel switch command is intended for the GO interface, but
it is not sent on the group control interface. For configurations
that use a separate interface for P2P groups, this will fail the test.

Fix this by sending the channel switch command on the group control
interface and waiting for the channel switch event on the global
control interface.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
---
 tests/hwsim/test_p2p_autogo.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jouni Malinen Dec. 30, 2016, 9:55 p.m. UTC | #1
On Thu, Dec 29, 2016 at 11:37:58AM +0200, Andrei Otcheretianski wrote:
> The channel switch command is intended for the GO interface, but
> it is not sent on the group control interface. For configurations
> that use a separate interface for P2P groups, this will fail the test.
> 
> Fix this by sending the channel switch command on the group control
> interface and waiting for the channel switch event on the global
> control interface.

While this sounds like a reasonable change, I'd like to understand how
to reproduce this.. I don't see autogo_chan_switch failing with
mac80211_hwsim.support_p2p_device=1 nor could I get a test case with
HWSIMRadio(use_p2p_device=True)... to fail in this manner either.
Andrei Otcheretianski Jan. 2, 2017, 10:53 a.m. UTC | #2
> -----Original Message-----
> From: Jouni Malinen [mailto:j@w1.fi]
> Sent: Friday, December 30, 2016 23:55
> To: Otcheretianski, Andrei <andrei.otcheretianski@intel.com>
> Cc: hostap@lists.infradead.org; Stern, Avraham <avraham.stern@intel.com>
> Subject: Re: [PATCH] tests: autogo: Use group control interface for GO
> commands
> 
> On Thu, Dec 29, 2016 at 11:37:58AM +0200, Andrei Otcheretianski wrote:
> > The channel switch command is intended for the GO interface, but it is
> > not sent on the group control interface. For configurations that use a
> > separate interface for P2P groups, this will fail the test.
> >
> > Fix this by sending the channel switch command on the group control
> > interface and waiting for the channel switch event on the global
> > control interface.
> 
> While this sounds like a reasonable change, I'd like to understand how to
> reproduce this.. I don't see autogo_chan_switch failing with
> mac80211_hwsim.support_p2p_device=1 nor could I get a test case with
> HWSIMRadio(use_p2p_device=True)... to fail in this manner either.

p2p_device isn't the issue here.  The test is failing when p2p_no_group_iface is 0.
Currently the default in reset() is p2p_no_group_iface = 1, but we reuse some of hwsim tests with real hw internally and use a different config.

Andrei

> 
> --
> Jouni Malinen                                            PGP id EFC895FA
Jouni Malinen Jan. 5, 2017, 2:06 p.m. UTC | #3
On Mon, Jan 02, 2017 at 10:53:05AM +0000, Otcheretianski, Andrei wrote:
> p2p_device isn't the issue here.  The test is failing when p2p_no_group_iface is 0.

Failing? Or being skipped? It does not fail for me even if I set
p2p_go_group_iface=0 on dev[0] (the GO). Sure, it does not run the
actual test, but that's different from failing..

> Currently the default in reset() is p2p_no_group_iface = 1, but we reuse some of hwsim tests with real hw internally and use a different config.

This is not supported or even supposed to work as far as
p2p_no_group_iface parameter is concerned. Number of test cases set this
to 0 when such behavior is tested while some other test cases depend on
the default value being used and will fail if something forces incorrect
p2p_no_group_iface value..

The proper way to run such testing would be to add more test cases to
get the needed coverage for both the p2p_no_group_iface=0 and
p2p_no_group_iface=1 cases without having to do something external to
starts tests with different configuration.
Jouni Malinen Jan. 5, 2017, 4:24 p.m. UTC | #4
On Thu, Dec 29, 2016 at 11:37:58AM +0200, Andrei Otcheretianski wrote:
> The channel switch command is intended for the GO interface, but
> it is not sent on the group control interface. For configurations
> that use a separate interface for P2P groups, this will fail the test.
> 
> Fix this by sending the channel switch command on the group control
> interface and waiting for the channel switch event on the global
> control interface.

Thanks, applied.
diff mbox

Patch

diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py
index b5f5418..1f4d30e 100644
--- a/tests/hwsim/test_p2p_autogo.py
+++ b/tests/hwsim/test_p2p_autogo.py
@@ -326,12 +326,12 @@  def test_autogo_chan_switch(dev):
     """P2P autonomous GO switching channels"""
     autogo(dev[0], freq=2417)
     connect_cli(dev[0], dev[1])
-    res = dev[0].request("CHAN_SWITCH 5 2422")
+    res = dev[0].group_request("CHAN_SWITCH 5 2422")
     if "FAIL" in res:
         # for now, skip test since mac80211_hwsim support is not yet widely
         # deployed
         raise HwsimSkip("Assume mac80211_hwsim did not support channel switching")
-    ev = dev[0].wait_event(["AP-CSA-FINISHED"], timeout=10)
+    ev = dev[0].wait_group_event(["AP-CSA-FINISHED"], timeout=10)
     if ev is None:
         raise Exception("CSA finished event timed out")
     if "freq=2422" not in ev: