From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 1/2] test-runner: run iwmon if --log is used
Date: Wed, 06 Nov 2019 13:38:14 -0800 [thread overview]
Message-ID: <20191106213815.20555-1-prestwoj@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]
Now that execute_program handles logging automatically its trivial
to add iwmon to the test and get monitor logs as well as normal
process output.
---
tools/test-runner.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 00989391..1c807aea 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -1592,6 +1592,18 @@ static void terminate_iwd(pid_t iwd_pid)
kill_process(iwd_pid);
}
+static pid_t start_monitor(const char *test_name)
+{
+ char *argv[4];
+
+ argv[0] = "iwmon";
+ argv[1] = "--nortnl";
+ argv[2] = "--nowiphy";
+ argv[3] = NULL;
+
+ return execute_program(argv, environ, false, test_name);
+}
+
static bool create_tmpfs_extra_stuff(char **tmpfs_extra_stuff)
{
size_t i = 0;
@@ -2004,6 +2016,7 @@ static void create_network_and_run_tests(void *data, void *user_data)
pid_t medium_pid = -1;
pid_t ofono_pid = -1;
pid_t phonesim_pid = -1;
+ pid_t monitor_pid = -1;
char *config_dir_path;
char *iwd_config_dir;
char **tmpfs_extra_stuff = NULL;
@@ -2149,6 +2162,9 @@ static void create_network_and_run_tests(void *data, void *user_data)
l_queue_foreach(wiphy_list, wiphy_up, NULL);
}
+ if (log)
+ monitor_pid = start_monitor(test_name);
+
if (check_verbosity("tls"))
setenv("IWD_TLS_DEBUG", "on", true);
@@ -2233,6 +2249,9 @@ static void create_network_and_run_tests(void *data, void *user_data)
stop_phonesim(phonesim_pid);
}
+ if (monitor_pid > 0)
+ kill_process(monitor_pid);
+
exit_hostapd:
destroy_hostapd_instances(hostapd_pids);
--
2.17.1
next reply other threads:[~2019-11-06 21:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 21:38 James Prestwood [this message]
2019-11-06 21:38 ` [PATCH 2/2] test-runner: fix logging directory name James Prestwood
2019-11-06 21:41 ` James Prestwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191106213815.20555-1-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.