[PATCH] station: get neighbor reports early
by James Prestwood
Waiting to request neighbor reports until we are in need of a roam
delays the roam time, and probably isn't as reliable since we are
most likely in a low RSSI state. Instead the neighbor report can
be requested immediately after connecting, saved, and used if/when
a roam is needed. The existing behavior is maintained if the early
neighbor report fails where a neighbor report is requested at the
time of the roam.
The code which parses the reports was factored out and shared
between the existing (late) neighbor report callback and the early
neighbor report callback.
---
src/station.c | 140 +++++++++++++++++++++++++++++++++-----------------
1 file changed, 94 insertions(+), 46 deletions(-)
diff --git a/src/station.c b/src/station.c
index db36b748..8bd3e147 100644
--- a/src/station.c
+++ b/src/station.c
@@ -95,6 +95,9 @@ struct station {
struct netconfig *netconfig;
+ /* Set of frequencies to scan first when attempting a roam */
+ struct scan_freq_set *roam_freqs;
+
bool preparing_roam : 1;
bool roam_scan_full : 1;
bool signal_low : 1;
@@ -1306,6 +1309,9 @@ static void station_reset_connection_state(struct station *station)
station->connected_bss = NULL;
station->connected_network = NULL;
+ if (station->roam_freqs)
+ scan_freq_set_free(station->roam_freqs);
+
l_dbus_property_changed(dbus, netdev_get_path(station->netdev),
IWD_STATION_INTERFACE, "ConnectedNetwork");
l_dbus_property_changed(dbus, network_get_path(network),
@@ -1879,40 +1885,15 @@ static uint32_t station_freq_from_neighbor_report(const uint8_t *country,
return freq;
}
-static void station_neighbor_report_cb(struct netdev *netdev, int err,
- const uint8_t *reports,
- size_t reports_len, void *user_data)
+static void parse_neighbor_report(struct station *station,
+ const uint8_t *reports, size_t reports_len,
+ struct scan_freq_set **set)
{
- struct station *station = user_data;
struct ie_tlv_iter iter;
int count_md = 0, count_no_md = 0;
struct scan_freq_set *freq_set_md, *freq_set_no_md;
uint32_t current_freq = 0;
struct handshake_state *hs = netdev_get_handshake(station->netdev);
- int r;
-
- l_debug("ifindex: %u, error: %d(%s)",
- netdev_get_ifindex(station->netdev),
- err, err < 0 ? strerror(-err) : "");
-
- /*
- * Check if we're still attempting to roam -- if dbus Disconnect
- * had been called in the meantime we just abort the attempt.
- */
- if (!station->preparing_roam || err == -ENODEV)
- return;
-
- if (!reports || err) {
- r = station_roam_scan_known_freqs(station);
-
- if (r == -ENODATA)
- l_debug("no neighbor report results or known freqs");
-
- if (r < 0)
- station_roam_failed(station);
-
- return;
- }
freq_set_md = scan_freq_set_new();
freq_set_no_md = scan_freq_set_new();
@@ -2000,17 +1981,53 @@ static void station_neighbor_report_cb(struct netdev *netdev, int err,
*/
if (count_md) {
scan_freq_set_add(freq_set_md, current_freq);
-
- r = station_roam_scan(station, freq_set_md);
+ *set = freq_set_md;
+ scan_freq_set_free(freq_set_no_md);
} else if (count_no_md) {
scan_freq_set_add(freq_set_no_md, current_freq);
-
- r = station_roam_scan(station, freq_set_no_md);
+ *set = freq_set_no_md;
+ scan_freq_set_free(freq_set_md);
} else
- r = station_roam_scan(station, NULL);
+ *set = NULL;
+}
+
+static void station_neighbor_report_cb(struct netdev *netdev, int err,
+ const uint8_t *reports,
+ size_t reports_len, void *user_data)
+{
+ struct station *station = user_data;
+ struct scan_freq_set *freq_set;
+ int r;
+
+ l_debug("ifindex: %u, error: %d(%s)",
+ netdev_get_ifindex(station->netdev),
+ err, err < 0 ? strerror(-err) : "");
+
+ /*
+ * Check if we're still attempting to roam -- if dbus Disconnect
+ * had been called in the meantime we just abort the attempt.
+ */
+ if (!station->preparing_roam || err == -ENODEV)
+ return;
+
+ if (!reports || err) {
+ r = station_roam_scan_known_freqs(station);
+
+ if (r == -ENODATA)
+ l_debug("no neighbor report results or known freqs");
+
+ if (r < 0)
+ station_roam_failed(station);
+
+ return;
+ }
+
+ parse_neighbor_report(station, reports, reports_len, &freq_set);
+
+ r = station_roam_scan(station, freq_set);
- scan_freq_set_free(freq_set_md);
- scan_freq_set_free(freq_set_no_md);
+ if (freq_set)
+ scan_freq_set_free(freq_set);
if (r < 0)
station_roam_failed(station);
@@ -2028,19 +2045,24 @@ static void station_roam_trigger_cb(struct l_timeout *timeout, void *user_data)
station->preparing_roam = true;
/*
- * If current BSS supports Neighbor Reports, narrow the scan down
- * to channels occupied by known neighbors in the ESS. This isn't
- * 100% reliable as the neighbor lists are not required to be
- * complete or current. It is likely still better than doing a
- * full scan. 10.11.10.1: "A neighbor report may not be exhaustive
- * either by choice, or due to the fact that there may be neighbor
- * APs not known to the AP."
+ * First try to use the neighbor report requested after connecting. If
+ * none were obtained request a neighbor report now. If that fails,
+ * scan any known frequencies.
*/
- if (station->connected_bss->cap_rm_neighbor_report &&
- !station->roam_no_orig_ap)
- if (!netdev_neighbor_report_req(station->netdev,
- station_neighbor_report_cb))
+ if (station->roam_freqs) {
+ if (station_roam_scan(station, station->roam_freqs) == 0) {
+ l_debug("Using cached neighbor report for roam");
return;
+ }
+
+ } else if (station->connected_bss->cap_rm_neighbor_report &&
+ !station->roam_no_orig_ap) {
+ if (netdev_neighbor_report_req(station->netdev,
+ station_neighbor_report_cb) == 0) {
+ l_debug("Requesting neighbor report for roam");
+ return;
+ }
+ }
r = station_roam_scan_known_freqs(station);
if (r == -ENODATA)
@@ -2317,6 +2339,23 @@ static void station_connect_dbus_reply(struct station *station,
dbus_pending_reply(&station->connect_pending, reply);
}
+static void station_early_neighbor_report_cb(struct netdev *netdev, int err,
+ const uint8_t *reports,
+ size_t reports_len, void *user_data)
+{
+ struct station *station = user_data;
+
+ l_debug("ifindex: %u, error: %d(%s)",
+ netdev_get_ifindex(station->netdev),
+ err, err < 0 ? strerror(-err) : "");
+
+ if (!reports || err)
+ return;
+
+ parse_neighbor_report(station, reports, reports_len,
+ &station->roam_freqs);
+}
+
static void station_connect_cb(struct netdev *netdev, enum netdev_result result,
void *event_data, void *user_data)
{
@@ -2361,6 +2400,15 @@ static void station_connect_cb(struct netdev *netdev, enum netdev_result result,
return;
}
+ /*
+ * Get a neighbor report now so future roams can avoid waiting for
+ * a report at that time
+ */
+ if (station->connected_bss->cap_rm_neighbor_report) {
+ if (netdev_neighbor_report_req(station->netdev,
+ station_early_neighbor_report_cb) < 0)
+ l_warn("Could not request neighbor report");
+ }
network_connected(station->connected_network);
if (station->netconfig)
--
2.26.2
3 months, 2 weeks
[PATCH] ap: Fix handshake state gtk not being set
by Jonathan Liu
handshake_state_set_authenticator_ie must be called to set group_cipher
in struct handshake_shake before handshake_set_gtk_state, otherwise
handshake_set_gtk_state is unable to determine the key length to set
handshake state gtk.
Fixes: 4bc20a097965 ("ap: Start EAP-WSC authentication with WSC enrollees")
---
src/ap.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/ap.c b/src/ap.c
index 4d0d5686..d9e7e404 100644
--- a/src/ap.c
+++ b/src/ap.c
@@ -702,7 +702,8 @@ static uint32_t ap_send_mgmt_frame(struct ap_state *ap,
callback, user_data, NULL, NULL);
}
-static void ap_start_handshake(struct sta_state *sta, bool use_eapol_start)
+static void ap_start_handshake(struct sta_state *sta, bool use_eapol_start,
+ const uint8_t *gtk_rsc)
{
struct ap_state *ap = sta->ap;
const uint8_t *own_addr = netdev_get_address(ap->netdev);
@@ -722,6 +723,10 @@ static void ap_start_handshake(struct sta_state *sta, bool use_eapol_start)
ie_build_rsne(&rsn, bss_rsne);
handshake_state_set_authenticator_ie(sta->hs, bss_rsne);
+ if (gtk_rsc)
+ handshake_state_set_gtk(sta->hs, sta->ap->gtk,
+ sta->ap->gtk_index, gtk_rsc);
+
sta->sm = eapol_sm_new(sta->hs);
if (!sta->sm) {
ap_stop_handshake(sta);
@@ -774,12 +779,7 @@ static void ap_start_rsna(struct sta_state *sta, const uint8_t *gtk_rsc)
handshake_state_set_event_func(sta->hs, ap_handshake_event, sta);
handshake_state_set_supplicant_ie(sta->hs, sta->assoc_rsne);
handshake_state_set_pmk(sta->hs, sta->ap->config->psk, 32);
-
- if (gtk_rsc)
- handshake_state_set_gtk(sta->hs, sta->ap->gtk,
- sta->ap->gtk_index, gtk_rsc);
-
- ap_start_handshake(sta, false);
+ ap_start_handshake(sta, false, gtk_rsc);
}
static void ap_gtk_query_cb(struct l_genl_msg *msg, void *user_data)
@@ -924,7 +924,7 @@ static void ap_start_eap_wsc(struct sta_state *sta)
handshake_state_set_event_func(sta->hs, ap_wsc_handshake_event, sta);
handshake_state_set_8021x_config(sta->hs, sta->wsc_settings);
- ap_start_handshake(sta, wait_for_eapol_start);
+ ap_start_handshake(sta, wait_for_eapol_start, NULL);
}
static struct l_genl_msg *ap_build_cmd_del_key(struct ap_state *ap)
--
2.29.2
3 months, 2 weeks
[PATCH v2] test-runner: add option to specify subtests to run
by James Prestwood
You can now specify a limited list of subtests to run out of a
full auto-test using --sub-tests,-S. This option is limited in
that it is only meant to be used with a single autotest (since
it doesn't make much sense otherwise).
The subtest can be specified both with or without the file
extension.
Example usage:
./test-runner -A testAP -S failure_test,dhcp_test.py
This will only run the two subtests and exclude any other *.py
tests present in the test directory.
---
tools/test-runner | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
v2:
* Fixed list split/join problems
diff --git a/tools/test-runner b/tools/test-runner
index b4840fa4..97d0e32c 100755
--- a/tools/test-runner
+++ b/tools/test-runner
@@ -892,6 +892,18 @@ def pre_test(ctx, test):
else:
shutil.copy(f, '/tmp')
+ # Prune down any subtests if needed
+ if ctx.args.sub_tests:
+ ctx.args.sub_tests = ctx.args.sub_tests.split(',')
+ pruned = []
+
+ for s in subtests:
+ # Allow test name both with and without the extension
+ if s in ctx.args.sub_tests or os.path.splitext(s)[0] in ctx.args.sub_tests:
+ pruned.append(s)
+
+ subtests = pruned
+
ctx.start_dbus_monitor()
ctx.start_radios()
ctx.start_hostapd()
@@ -996,6 +1008,10 @@ def run_auto_tests(ctx, args):
try:
copied, subtests = pre_test(ctx, test)
+ if len(subtests) < 1:
+ dbg("No tests to run")
+ exit()
+
rqueue = multiprocessing.Queue()
p = multiprocessing.Process(target=start_test, args=(ctx, subtests, rqueue))
p.start()
@@ -1060,6 +1076,7 @@ def run_tests():
parser.add_argument('--log-uid')
parser.add_argument('--hw')
parser.add_argument('--monitor')
+ parser.add_argument('--sub_tests')
args = parser.parse_args(options)
@@ -1128,6 +1145,9 @@ class Main:
help='Use physical adapters for tests (passthrough)')
self.parser.add_argument('--monitor', '-m', type=str,
help='Enables iwmon output to file')
+ self.parser.add_argument('--sub-tests', '-S', metavar='<subtests>',
+ type=str, nargs=1, help='List of subtests to run',
+ default=None, dest='sub_tests')
# Prevent --autotest/--unittest from being used together
auto_unit_group = self.parser.add_mutually_exclusive_group()
@@ -1153,10 +1173,25 @@ class Main:
self.args = self.parser.parse_args()
+ if self.args.auto_tests:
+ self.args.auto_tests = self.args.auto_tests[0].split(',')
+
+ if self.args.sub_tests:
+ self.args.sub_tests = self.args.sub_tests[0].split(',')
+
if self.args.log and self.args.unit_tests:
dbg("Cannot use --log with --unit-tests")
quit()
+ if self.args.sub_tests:
+ if not self.args.auto_tests:
+ dbg("--sub-tests must be used with --auto-tests")
+ quit()
+
+ if len(self.args.auto_tests) > 1:
+ dbg("--sub-tests must be used with a single auto test")
+ quit()
+
def start(self):
usb_adapters = None
@@ -1220,6 +1255,9 @@ class Main:
if self.args.auto_tests:
options += ' --auto_tests %s' % ','.join(self.args.auto_tests)
+ if self.args.sub_tests:
+ options += ' --sub_tests %s' % ','.join(self.args.sub_tests)
+
if self.args.log:
if os.environ.get('SUDO_GID', None) is None:
print("--log can only be used as root user")
@@ -1242,6 +1280,7 @@ class Main:
denylist = [
'auto_tests',
+ 'sub_tests',
'qemu',
'kernel'
]
--
2.26.2
3 months, 3 weeks
[PATCH] test-runner: add option to specify subtests to run
by James Prestwood
You can now specify a limited list of subtests to run out of a
full auto-test using --sub-tests,-S. This option is limited in
that it is only meant to be used with a single autotest (since
it doesn't make much sense otherwise).
The subtest can be specified both with or without the file
extension.
Example usage:
./test-runner -A testAP -S failure_test,dhcp_test.py
This will only run the two subtests and exclude any other *.py
tests present in the test directory.
---
tools/test-runner | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/tools/test-runner b/tools/test-runner
index b4840fa4..d140b253 100755
--- a/tools/test-runner
+++ b/tools/test-runner
@@ -892,6 +892,18 @@ def pre_test(ctx, test):
else:
shutil.copy(f, '/tmp')
+ # Prune down any subtests if needed
+ if ctx.args.sub_tests:
+ ctx.args.sub_tests = ','.join(ctx.args.sub_tests)
+ pruned = []
+
+ for s in subtests:
+ # Allow test name both with and without the extension
+ if s in ctx.args.sub_tests or os.path.splitext(s)[0] in ctx.args.sub_tests:
+ pruned.append(s)
+
+ subtests = pruned
+
ctx.start_dbus_monitor()
ctx.start_radios()
ctx.start_hostapd()
@@ -996,6 +1008,10 @@ def run_auto_tests(ctx, args):
try:
copied, subtests = pre_test(ctx, test)
+ if len(subtests) < 1:
+ dbg("No tests to run")
+ exit()
+
rqueue = multiprocessing.Queue()
p = multiprocessing.Process(target=start_test, args=(ctx, subtests, rqueue))
p.start()
@@ -1060,6 +1076,7 @@ def run_tests():
parser.add_argument('--log-uid')
parser.add_argument('--hw')
parser.add_argument('--monitor')
+ parser.add_argument('--sub_tests')
args = parser.parse_args(options)
@@ -1128,6 +1145,9 @@ class Main:
help='Use physical adapters for tests (passthrough)')
self.parser.add_argument('--monitor', '-m', type=str,
help='Enables iwmon output to file')
+ self.parser.add_argument('--sub-tests', '-S', metavar='<subtests>',
+ type=str, nargs=1, help='List of subtests to run',
+ default=None, dest='sub_tests')
# Prevent --autotest/--unittest from being used together
auto_unit_group = self.parser.add_mutually_exclusive_group()
@@ -1153,10 +1173,22 @@ class Main:
self.args = self.parser.parse_args()
+ if self.args.auto_tests:
+ self.args.auto_tests = self.args.auto_tests[0].split(',')
+
if self.args.log and self.args.unit_tests:
dbg("Cannot use --log with --unit-tests")
quit()
+ if self.args.sub_tests:
+ if not self.args.auto_tests:
+ dbg("--sub-tests must be used with --auto-tests")
+ quit()
+
+ if len(self.args.auto_tests) > 1:
+ dbg("--sub-tests must be used with a single auto test")
+ quit()
+
def start(self):
usb_adapters = None
@@ -1220,6 +1252,9 @@ class Main:
if self.args.auto_tests:
options += ' --auto_tests %s' % ','.join(self.args.auto_tests)
+ if self.args.sub_tests:
+ options += ' --sub_tests %s' % ','.join(self.args.sub_tests)
+
if self.args.log:
if os.environ.get('SUDO_GID', None) is None:
print("--log can only be used as root user")
@@ -1242,6 +1277,7 @@ class Main:
denylist = [
'auto_tests',
+ 'sub_tests',
'qemu',
'kernel'
]
--
2.26.2
3 months, 3 weeks
"Multiple sessions detected" during WSC connection
by Bruce Johnson
I received the error "Multiple sessions detected" from iwctl after running
"iwctl wsc wlan0 push-button". The same Wi-Fi card was working with WSC on
the same Wi-Fi router when I tried it a week or so ago, and I have since
reformatted the disk of the computer with the Wi-Fi client station. After
looking at the source of wsc.c, I believe I have bumped into something the
code doesn't anticipate correctly in the case of a mesh Wi-Fi installation.
I was trying to pair a Qualcomm Atheros QCA986x/988x with an Amplifi HD
Wi-Fi router that has an Amplifi mesh extender. Both units are running with
SSID "topcog" on 2.4 GHz and 5 GHz, and they each have an additional SSID,
"topcog_5ghz". It looks like iwd gave the pairing a thumbs-down because it
was getting the same offer from two different BSSIDs for SSID "topcog" in
the 5 GHz band. When I unplugged the extender and tried the pairing again,
it succeeded.
I've attached the relevant journal entries with debug turned on. If I can
do additional testing, please let me know. I'm not doing dev work on iwd,
but since I'm building my project using OpenEmbedded, it shouldn't be too
hard for me to stick in some debug code.
The source shows that I'm building with release 1.6 (git hash ad97f4f9).
Thanks!
--
Bruce A. Johnson
Herndon, Virginia
3 months, 3 weeks
[PATCH 1/3] station/wsc: remove beacon loss handling
by James Prestwood
Modern kernels ~5.4+ have changed the way lost beacons are
reported and effectively make the lost beacon event useless
because it is immediately followed by a disconnect event. This
does now allow IWD enough time to do much of anything before
the disconnect comes in and we are forced to fully re-connect
to a different AP.
---
src/station.c | 26 --------------------------
src/wsc.c | 3 ---
2 files changed, 29 deletions(-)
diff --git a/src/station.c b/src/station.c
index eb254bf6..db36b748 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2085,29 +2085,6 @@ static bool station_cannot_roam(struct station *station)
station->state == STATION_STATE_ROAMING;
}
-static void station_lost_beacon(struct station *station)
-{
- l_debug("%u", netdev_get_ifindex(station->netdev));
-
- if (station->state != STATION_STATE_ROAMING &&
- station->state != STATION_STATE_CONNECTED)
- return;
-
- /*
- * Tell the roam mechanism to not bother requesting Neighbor Reports,
- * preauthenticating or performing other over-the-DS type of
- * authentication to target AP, even while station->connected_bss is
- * still non-NULL. The current connection is in a serious condition
- * and we might wasting our time with those mechanisms.
- */
- station->roam_no_orig_ap = true;
-
- if (station_cannot_roam(station))
- return;
-
- station_roam_trigger_cb(NULL, station);
-}
-
#define WNM_REQUEST_MODE_PREFERRED_CANDIDATE_LIST (1 << 0)
#define WNM_REQUEST_MODE_TERMINATION_IMMINENT (1 << 3)
#define WNM_REQUEST_MODE_ESS_DISASSOCIATION_IMMINENT (1 << 4)
@@ -2235,9 +2212,6 @@ static void station_netdev_event(struct netdev *netdev, enum netdev_event event,
case NETDEV_EVENT_ASSOCIATING:
l_debug("Associating");
break;
- case NETDEV_EVENT_LOST_BEACON:
- station_lost_beacon(station);
- break;
case NETDEV_EVENT_DISCONNECT_BY_AP:
case NETDEV_EVENT_DISCONNECT_BY_SME:
station_disconnect_event(station, event_data);
diff --git a/src/wsc.c b/src/wsc.c
index 66ddb8bf..aec9900c 100644
--- a/src/wsc.c
+++ b/src/wsc.c
@@ -247,9 +247,6 @@ static void wsc_enrollee_netdev_event(struct netdev *netdev,
case NETDEV_EVENT_AUTHENTICATING:
case NETDEV_EVENT_ASSOCIATING:
break;
- case NETDEV_EVENT_LOST_BEACON:
- l_debug("Lost beacon");
- break;
case NETDEV_EVENT_DISCONNECT_BY_AP:
l_debug("Disconnect by AP");
wsc_enrollee_connect_cb(wsce->netdev,
--
2.26.2
3 months, 3 weeks
[PATCH 1/4] doc: add man pages for AP provisioning files
by James Prestwood
---
Makefile.am | 6 +++--
src/iwd.ap.rst | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 2 deletions(-)
create mode 100644 src/iwd.ap.rst
diff --git a/Makefile.am b/Makefile.am
index d49833b7..1f0b0d30 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -171,7 +171,8 @@ man_MANS =
endif
manual_pages = src/iwd.8 src/iwd.debug.7 src/iwd.config.5 src/iwd.network.5 \
- client/iwctl.1 monitor/iwmon.1 wired/ead.8 tools/hwsim.1
+ src/iwd.ap.5 client/iwctl.1 monitor/iwmon.1 wired/ead.8 \
+ tools/hwsim.1
eap_sources = src/eap.c src/eap.h src/eap-private.h \
src/eap-md5.c \
@@ -263,7 +264,8 @@ systemd_network_DATA += src/80-iwd.link
endif
if MANUAL_PAGES
-man_MANS += src/iwd.8 src/iwd.debug.7 src/iwd.config.5 src/iwd.network.5
+man_MANS += src/iwd.8 src/iwd.debug.7 src/iwd.config.5 src/iwd.network.5 \
+ src/iwd.ap.5
endif
endif
diff --git a/src/iwd.ap.rst b/src/iwd.ap.rst
new file mode 100644
index 00000000..939bf99d
--- /dev/null
+++ b/src/iwd.ap.rst
@@ -0,0 +1,62 @@
+============
+ iwd.ap
+============
+
+--------------------------------------
+Configuration of IWD access point
+--------------------------------------
+
+:Author: James Prestwood <prestwoj(a)gmail.com>
+:Copyright: 2020 Intel Corporation
+:Version: iwd
+:Date: 20 October 2020
+:Manual section: 5
+:Manual group: Linux Connectivity
+
+NAME
+====
+iwd.ap - Access point provisioning files
+
+SYNOPSIS
+========
+
+Description of access point provisioning files.
+
+DESCRIPTION
+===========
+
+An access point provisioning files define the configuration of an IWD access
+point. These files live in *$STATE_DIRECTORY*/ap (/var/lib/iwd/ap by default).
+
+FILE FORMAT
+===========
+
+See *iwd.network* for details on the file format.
+
+SETTINGS
+========
+
+The settings are split into several categories. Each category has a group
+associated with it and described in separate tables below.
+
+Network Authentication Settings
+-------------------------------
+
+The group ``[Security]`` contains settings for Wi-Fi security and authentication
+configuration.
+
+.. list-table::
+ :header-rows: 0
+ :stub-columns: 0
+ :widths: 20 80
+ :align: left
+
+ * - Passphrase
+ - 8..63 character string
+
+ Passphrase to be used with this access point.
+
+SEE ALSO
+========
+
+iwd(8), iwd.network(5)
--
2.26.2
3 months, 3 weeks
[PATCH 1/3] auto-t: add copy_to_ap utility
by James Prestwood
---
autotests/util/iwd.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
index 3ffd9f23..775fc6a5 100755
--- a/autotests/util/iwd.py
+++ b/autotests/util/iwd.py
@@ -1036,6 +1036,7 @@ class IWD(AsyncOpAbstract):
def clear_storage(storage_dir=IWD_STORAGE_DIR):
os.system('rm -rf ' + storage_dir + '/*')
os.system('rm -rf ' + storage_dir + '/hotspot/*')
+ os.system('rm -rf ' + storage_dir + '/ap/*')
@staticmethod
def create_in_storage(file_name, file_content):
@@ -1063,6 +1064,13 @@ class IWD(AsyncOpAbstract):
shutil.copy(source, IWD_STORAGE_DIR + "/hotspot")
+ @staticmethod
+ def copy_to_ap(source):
+ if not os.path.exists(IWD_STORAGE_DIR + "/ap"):
+ os.mkdir(IWD_STORAGE_DIR + "/ap")
+
+ IWD.copy_to_storage(source, IWD_STORAGE_DIR + '/ap/')
+
@staticmethod
def remove_from_storage(file_name):
os.system('rm -rf ' + IWD_STORAGE_DIR + '/\'' + file_name + '\'')
--
2.26.2
3 months, 3 weeks
[PATCH] auto-t: remove more /var/lib/iwd references
by James Prestwood
The address randomization test was using a /var/lib/iwd which
is no longer specially mounted or used for IWD storage. Instead
use /tmp/iwd.
---
autotests/testAddressRandomization/connection_test.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/autotests/testAddressRandomization/connection_test.py b/autotests/testAddressRandomization/connection_test.py
index 10d1b35b..d9806f8a 100644
--- a/autotests/testAddressRandomization/connection_test.py
+++ b/autotests/testAddressRandomization/connection_test.py
@@ -54,7 +54,7 @@ class Test(unittest.TestCase):
wd.wait_for_object_condition(device, condition)
# 1. Test per-network deterministic MAC generation
- os.system('cat pernetwork.psk > /var/lib/iwd/ssidCCMP.psk')
+ os.system('cat pernetwork.psk > /tmp/iwd/ssidCCMP.psk')
new_addr = self.try_connection(wd)
self.assertNotEqual(perm_addr, new_addr)
# try again to ensure the generation was deterministic
@@ -62,7 +62,7 @@ class Test(unittest.TestCase):
self.assertEqual(new_addr, new_addr2)
# 2. Test FullAddressRandomization
- os.system('cat full_random.psk > /var/lib/iwd/ssidCCMP.psk')
+ os.system('cat full_random.psk > /tmp/iwd/ssidCCMP.psk')
new_addr = self.try_connection(wd)
self.assertNotEqual(perm_addr, new_addr)
# try again to make sure the generation was random
@@ -70,7 +70,7 @@ class Test(unittest.TestCase):
self.assertNotEqual(new_addr, new_addr2)
# 3. Test AddressOverride
- os.system('cat override.psk > /var/lib/iwd/ssidCCMP.psk')
+ os.system('cat override.psk > /tmp/iwd/ssidCCMP.psk')
new_addr = self.try_connection(wd)
self.assertEqual(new_addr, 'e6:f6:38:a9:02:02')
--
2.26.2
3 months, 3 weeks