eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit e7d941dc3cb6f77bcab614666ee99339d90d9289
parent b60f564bedb3b4266d331aca9b82edf07f0531fb
Author: James Prestwood <prestwoj@gmail.com>
Date:   Fri,  5 Feb 2021 10:09:10 -0800

auto-t: make spoof_frame more robust

Sometimes scan results can come in with a MAC address which
should be in the first index of addrs[] (42:xx:xx:xx:xx:xx).
This causes a failure to lookup the radio path.

There was also a failure path added if the radio cannot be
found rather than rely on DBus to fail with a None path.

The arguments to SendFrame were also changed to use the
ByteArray DBus type rather than python's internal bytearray.
This shouldn't have any effect, but its more consistent with
how DBus arguments should be used.

Diffstat:
Mautotests/util/hwsim.py | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/autotests/util/hwsim.py b/autotests/util/hwsim.py @@ -330,15 +330,19 @@ class Hwsim(iwd.AsyncOpAbstract): obj = objects[path] for interface in obj: if interface == HWSIM_INTERFACE_INTERFACE: - if obj[interface]['Address'] == radio.addresses[0]: + if obj[interface]['Address'] == radio.addresses[0] or \ + obj[interface]['Address'] == radio.addresses[1]: radio_path = path break + if not radio_path: + raise Exception("Could not find radio %s" % radio.path) + iface = dbus.Interface(self._bus.get_object(HWSIM_SERVICE, radio_path), HWSIM_INTERFACE_INTERFACE) - iface.SendFrame(bytearray.fromhex(station.replace(':', '')), - freq, -30, bytearray.fromhex(frame)) + iface.SendFrame(dbus.ByteArray.fromhex(station.replace(':', '')), + freq, -30, dbus.ByteArray.fromhex(frame)) def get_radio(self, name): for path in self.radios: