Example #1
0
def test_wpacli_start_p2p_find(monkeypatch):
    def mockreturn(self, *args):
        assert args == (
            'p2p_find',
            'type=progressive',
        )
        return "OK"

    monkeypatch.setattr(WpaCli, "cmd", mockreturn)
    wpacli = WpaCli()
    wpacli.start_p2p_find()
Example #2
0
def test_wpacli_start_p2p_find_negative(monkeypatch):
    def mockreturn(self, *args):
        assert args == (
            'p2p_find',
            'type=progressive',
        )
        return "FAILED"

    monkeypatch.setattr(WpaCli, "cmd", mockreturn)
    wpacli = WpaCli()
    with pytest.raises(WpaException):
        wpacli.start_p2p_find()
Example #3
0
 def create_p2p_interface(self, R2):
     wpacli = WpaCli()
     wpacli.start_p2p_find()
     wpacli.set_device_name(self.config.device_name)
     wpacli.set_device_type(self.config.device_type)
     wpacli.set_p2p_go_ht40()
     wpacli.wfd_subelem_set(0, self.wfd_devinfo())
     wpacli.wfd_subelem_set(1, self.wfd_bssid(0))
     wpacli.wfd_subelem_set(6, self.wfd_sink_info(0, 0))
     wpacli.wfd_subelem_set(7, self.wfd_ext_cap(uibc=False, i2c=False))
     if R2:
         wpacli.wfd_subelem_set(11, self.wfd_devinfo2())
     wpacli.p2p_group_add(self.config.group_name)