[PATCH] station: fail if trying to scan while connecting
by James Prestwood
If a scan is requested during the middle of a connection we should
return busy instead of attempting the scan. The kernel ends up coming
back with not supported in this case, which is misleading and
difficult to debug.
---
src/station.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/station.c b/src/station.c
index 76cf20a1..0da352c3 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2751,6 +2751,9 @@ static struct l_dbus_message *station_dbus_scan(struct l_dbus *dbus,
if (station->dbus_scan_id)
return dbus_error_busy(message);
+ if (station->state == STATION_STATE_CONNECTING)
+ return dbus_error_busy(message);
+
station->dbus_scan_id = station_scan_trigger(station, NULL,
station_dbus_scan_triggered,
new_scan_results,
--
2.17.1
2 years, 6 months
[PATCH] test-runner: move ofono/phonesim logs into test dir
by James Prestwood
These two processes are executed per-test so they can be passed the
test name and have the logs stored only in tests that actually need
them rather than at the top level.
---
tools/test-runner.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 075f56d6..5e10f542 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -940,7 +940,7 @@ static void start_loopback(void)
loopback_started = true;
}
-static pid_t start_phonesim(void)
+static pid_t start_phonesim(const char *test_name)
{
char *argv[5];
@@ -954,7 +954,7 @@ static pid_t start_phonesim(void)
setenv("OFONO_PHONESIM_CONFIG", "/tmp/phonesim.conf", true);
- return execute_program(argv, environ, false, NULL);
+ return execute_program(argv, environ, false, test_name);
}
static void stop_phonesim(pid_t pid)
@@ -962,7 +962,7 @@ static void stop_phonesim(pid_t pid)
kill_process(pid);
}
-static pid_t start_ofono(void)
+static pid_t start_ofono(const char *test_name)
{
char *argv[5];
bool verbose = check_verbosity(BIN_OFONO);
@@ -980,7 +980,7 @@ static pid_t start_ofono(void)
start_loopback();
- return execute_program(argv, environ, false, NULL);
+ return execute_program(argv, environ, false, test_name);
}
static void stop_ofono(pid_t pid)
@@ -2205,8 +2205,8 @@ static void create_network_and_run_tests(void *data, void *user_data)
}
if (ofono_req) {
- phonesim_pid = start_phonesim();
- ofono_pid = start_ofono();
+ phonesim_pid = start_phonesim(test_name);
+ ofono_pid = start_ofono(test_name);
}
set_wiphy_list(wiphy_list);
--
2.17.1
2 years, 6 months
[PATCH] auto-t: fix intermittent failures in testEAP-MSCHAPV2
by James Prestwood
Occationally autoconnect would start which was not expected in the
test. This is fixed by disabling autoconnect in the provisioning files.
---
autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-1.8021x | 3 +++
autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-2.8021x | 3 +++
autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-3.8021x | 3 +++
autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-4.8021x | 3 +++
4 files changed, 12 insertions(+)
diff --git a/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-1.8021x b/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-1.8021x
index 1cbdc821..55eb431d 100644
--- a/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-1.8021x
+++ b/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-1.8021x
@@ -2,3 +2,6 @@
EAP-Method=MSCHAPV2
EAP-Identity=domain\\User
EAP-Password=Password
+
+[Settings]
+AutoConnect=false
diff --git a/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-2.8021x b/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-2.8021x
index 04ff213a..a2c58b33 100644
--- a/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-2.8021x
+++ b/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-2.8021x
@@ -2,3 +2,6 @@
EAP-Method=MSCHAPV2
EAP-Identity=domain\\User
EAP-Password-Hash=a4f49c406510bdcab6824ee7c30fd852
+
+[Settings]
+AutoConnect=false
diff --git a/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-3.8021x b/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-3.8021x
index 56390d76..2c18c8fd 100644
--- a/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-3.8021x
+++ b/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-3.8021x
@@ -1,3 +1,6 @@
[Security]
EAP-Method=MSCHAPV2
EAP-Identity=domain\\User
+
+[Settings]
+AutoConnect=false
diff --git a/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-4.8021x b/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-4.8021x
index 39820dff..d7528b38 100644
--- a/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-4.8021x
+++ b/autotests/testEAP-MSCHAPV2/ssidEAP-MSCHAPV2-4.8021x
@@ -1,2 +1,5 @@
[Security]
EAP-Method=MSCHAPV2
+
+[Settings]
+AutoConnect=false
--
2.17.1
2 years, 6 months
[PATCH 1/5] auto-t: add ctrl_interface to testOWE
by James Prestwood
This is now required for any test using HostapdCLI
---
autotests/testOWE/ssidGroup20.conf | 1 +
autotests/testOWE/ssidOWE.conf | 1 +
2 files changed, 2 insertions(+)
diff --git a/autotests/testOWE/ssidGroup20.conf b/autotests/testOWE/ssidGroup20.conf
index 72f84091..afd5c0a4 100644
--- a/autotests/testOWE/ssidGroup20.conf
+++ b/autotests/testOWE/ssidGroup20.conf
@@ -1,3 +1,4 @@
+ctrl_interface=/var/run/hostapd
hw_mode=g
channel=1
ssid=ssidGroup20
diff --git a/autotests/testOWE/ssidOWE.conf b/autotests/testOWE/ssidOWE.conf
index b9c79d82..a0a4f26c 100644
--- a/autotests/testOWE/ssidOWE.conf
+++ b/autotests/testOWE/ssidOWE.conf
@@ -1,3 +1,4 @@
+ctrl_interface=/var/run/hostapd
hw_mode=g
channel=1
ssid=ssidOWE
--
2.17.1
2 years, 6 months
[PATCH] test-runner: erase valgrind log after each test
by James Prestwood
After changing the valgrind log to --log-fd, it appears that
the log file just gets appended, where before it was overwritten.
This makes test print out all previous tests valgrind results.
Now after printing out the valgrind info we can erase the file
for the next test.
---
tools/test-runner.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 043e8cc7..075f56d6 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -2226,10 +2226,14 @@ static void create_network_and_run_tests(void *data, void *user_data)
terminate_iwd(iwd_pid);
/* /tmp/valgrind.log will only exist without logging turned on */
- if (valgrind && !log)
+ if (valgrind && !log) {
if (system("cat /tmp/valgrind.log"))
l_info("cat /tmp/valgrind.log failed");
+ if (system("echo \"\" > /tmp/valgrind.log"))
+ l_info("Failed to reset /tmp/valgrind.log");
+ }
+
if (log) {
L_AUTO_FREE_VAR(char *, dmesg);
L_AUTO_FREE_VAR(char *, kernel_log);
--
2.17.1
2 years, 6 months
[PATCH] test-runner: make --log take a required argument
by James Prestwood
This was a mistake in the original implementation. Since test-runner
is always run from the tools directory using --log with no directory
specified would result in many log files being put into the iwd tree.
Instead we can make --log take a required argument so its more
obvious where all the logs are going to go.
---
tools/test-runner.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 82f009ae..043e8cc7 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -3044,12 +3044,9 @@ static void usage(void)
" test is specified\n"
"\t\t\t\tthe 'shell' test"
" will be used\n"
- "\t-l, --log [dir] Directory used for log output. "
- "If no directory\n"
- "\t\t\t\tis specified the "
- "current directory will be used\n"
- "\t\t\t\tThis option sets --verbose on "
- "all apps");
+ "\t-l, --log <dir> Directory used for log output. "
+ "This option sets \n"
+ "\t\t\t\t--verbose on all apps");
l_info("Commands:\n"
"\t-A, --auto-tests <dirs> Comma separated list of the "
"test configuration\n\t\t\t\t"
@@ -3069,7 +3066,7 @@ static const struct option main_options[] = {
{ "valgrind", no_argument, NULL, 'V' },
{ "hw", required_argument, NULL, 'w' },
{ "shell", optional_argument, NULL, 's' },
- { "log", optional_argument, NULL, 'l' },
+ { "log", required_argument, NULL, 'l' },
{ "help", no_argument, NULL, 'h' },
{ }
};
@@ -3100,7 +3097,7 @@ int main(int argc, char *argv[])
for (;;) {
int opt;
- opt = getopt_long(argc, argv, "A:q:k:v:g:UVldh", main_options,
+ opt = getopt_long(argc, argv, "A:q:k:v:g:l:UVdh", main_options,
NULL);
if (opt < 0)
break;
--
2.17.1
2 years, 6 months
[PATCH] resolve: fix runtime error if netconfig is not enabled
by James Prestwood
If the resolve module was not enabled in the config file, IWD fails
to start since resolve_init was returning -EINVAL. Since netconfig
is optional, we just return successfully here.
---
src/resolve.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/resolve.c b/src/resolve.c
index 83ac3547..fea9c2bd 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -427,8 +427,9 @@ void __resolve_set_config(struct l_settings *config)
static int resolve_init(void)
{
+ /* This module is not enabled in config */
if (!method.ops)
- return -EINVAL;
+ return 0;
if (method.ops->init)
method.data = method.ops->init();
--
2.17.1
2 years, 6 months