* [Qemu-devel] [PATCH] tests: Silence migration-test 'bad' test
@ 2018-03-06 17:30 Dr. David Alan Gilbert (git)
2018-03-07 5:10 ` Peter Xu
2018-03-09 15:12 ` Dr. David Alan Gilbert
0 siblings, 2 replies; 3+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-03-06 17:30 UTC (permalink / raw)
To: qemu-devel, quintela; +Cc: peterx, peter.maydell
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
In 2c9bb29703c I added a migration test that purposely fails;
unfortunately it prints a copy of the failure message to stderr
which makes the output a bit messy.
Hide stderr for that test.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
tests/migration-test.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/tests/migration-test.c b/tests/migration-test.c
index 74f9361bdd..422bf1afdf 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -382,7 +382,7 @@ static void migrate_start_postcopy(QTestState *who)
}
static void test_migrate_start(QTestState **from, QTestState **to,
- const char *uri)
+ const char *uri, bool hide_stderr)
{
gchar *cmd_src, *cmd_dst;
char *bootpath = g_strdup_printf("%s/bootsect", tmpfs);
@@ -427,6 +427,17 @@ static void test_migrate_start(QTestState **from, QTestState **to,
g_free(bootpath);
+ if (hide_stderr) {
+ gchar *tmp;
+ tmp = g_strdup_printf("%s 2>/dev/null", cmd_src);
+ g_free(cmd_src);
+ cmd_src = tmp;
+
+ tmp = g_strdup_printf("%s 2>/dev/null", cmd_dst);
+ g_free(cmd_dst);
+ cmd_dst = tmp;
+ }
+
*from = qtest_start(cmd_src);
g_free(cmd_src);
@@ -518,7 +529,7 @@ static void test_migrate(void)
char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
QTestState *from, *to;
- test_migrate_start(&from, &to, uri);
+ test_migrate_start(&from, &to, uri, false);
migrate_set_capability(from, "postcopy-ram", "true");
migrate_set_capability(to, "postcopy-ram", "true");
@@ -560,7 +571,7 @@ static void test_baddest(void)
const char *status;
bool failed;
- test_migrate_start(&from, &to, "tcp:0:0");
+ test_migrate_start(&from, &to, "tcp:0:0", true);
migrate(from, "tcp:0:0");
do {
rsp = wait_command(from, "{ 'execute': 'query-migrate' }");
--
2.14.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] tests: Silence migration-test 'bad' test
2018-03-06 17:30 [Qemu-devel] [PATCH] tests: Silence migration-test 'bad' test Dr. David Alan Gilbert (git)
@ 2018-03-07 5:10 ` Peter Xu
2018-03-09 15:12 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: Peter Xu @ 2018-03-07 5:10 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: qemu-devel, quintela, peter.maydell
On Tue, Mar 06, 2018 at 05:30:42PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> In 2c9bb29703c I added a migration test that purposely fails;
> unfortunately it prints a copy of the failure message to stderr
> which makes the output a bit messy.
>
> Hide stderr for that test.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> tests/migration-test.c | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/tests/migration-test.c b/tests/migration-test.c
> index 74f9361bdd..422bf1afdf 100644
> --- a/tests/migration-test.c
> +++ b/tests/migration-test.c
> @@ -382,7 +382,7 @@ static void migrate_start_postcopy(QTestState *who)
> }
>
> static void test_migrate_start(QTestState **from, QTestState **to,
> - const char *uri)
> + const char *uri, bool hide_stderr)
> {
> gchar *cmd_src, *cmd_dst;
> char *bootpath = g_strdup_printf("%s/bootsect", tmpfs);
> @@ -427,6 +427,17 @@ static void test_migrate_start(QTestState **from, QTestState **to,
>
> g_free(bootpath);
>
> + if (hide_stderr) {
> + gchar *tmp;
> + tmp = g_strdup_printf("%s 2>/dev/null", cmd_src);
> + g_free(cmd_src);
> + cmd_src = tmp;
> +
> + tmp = g_strdup_printf("%s 2>/dev/null", cmd_dst);
> + g_free(cmd_dst);
> + cmd_dst = tmp;
I thought this would affect QTEST_LOG in
qtest_init_without_qmp_handshake() but I was wrong. I think that's
because that "/dev/fd/2" is a string passed to QEMU process, so only
the stderr of test process is closed while we kept the QTEST_LOG
there, which seems to be ideal.
Reviewed-by: Peter Xu <peterx@redhat.com>
Tested-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] tests: Silence migration-test 'bad' test
2018-03-06 17:30 [Qemu-devel] [PATCH] tests: Silence migration-test 'bad' test Dr. David Alan Gilbert (git)
2018-03-07 5:10 ` Peter Xu
@ 2018-03-09 15:12 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2018-03-09 15:12 UTC (permalink / raw)
To: qemu-devel, quintela; +Cc: peterx, peter.maydell
* Dr. David Alan Gilbert (git) (dgilbert@redhat.com) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> In 2c9bb29703c I added a migration test that purposely fails;
> unfortunately it prints a copy of the failure message to stderr
> which makes the output a bit messy.
>
> Hide stderr for that test.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Queued
> ---
> tests/migration-test.c | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/tests/migration-test.c b/tests/migration-test.c
> index 74f9361bdd..422bf1afdf 100644
> --- a/tests/migration-test.c
> +++ b/tests/migration-test.c
> @@ -382,7 +382,7 @@ static void migrate_start_postcopy(QTestState *who)
> }
>
> static void test_migrate_start(QTestState **from, QTestState **to,
> - const char *uri)
> + const char *uri, bool hide_stderr)
> {
> gchar *cmd_src, *cmd_dst;
> char *bootpath = g_strdup_printf("%s/bootsect", tmpfs);
> @@ -427,6 +427,17 @@ static void test_migrate_start(QTestState **from, QTestState **to,
>
> g_free(bootpath);
>
> + if (hide_stderr) {
> + gchar *tmp;
> + tmp = g_strdup_printf("%s 2>/dev/null", cmd_src);
> + g_free(cmd_src);
> + cmd_src = tmp;
> +
> + tmp = g_strdup_printf("%s 2>/dev/null", cmd_dst);
> + g_free(cmd_dst);
> + cmd_dst = tmp;
> + }
> +
> *from = qtest_start(cmd_src);
> g_free(cmd_src);
>
> @@ -518,7 +529,7 @@ static void test_migrate(void)
> char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
> QTestState *from, *to;
>
> - test_migrate_start(&from, &to, uri);
> + test_migrate_start(&from, &to, uri, false);
>
> migrate_set_capability(from, "postcopy-ram", "true");
> migrate_set_capability(to, "postcopy-ram", "true");
> @@ -560,7 +571,7 @@ static void test_baddest(void)
> const char *status;
> bool failed;
>
> - test_migrate_start(&from, &to, "tcp:0:0");
> + test_migrate_start(&from, &to, "tcp:0:0", true);
> migrate(from, "tcp:0:0");
> do {
> rsp = wait_command(from, "{ 'execute': 'query-migrate' }");
> --
> 2.14.3
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-09 15:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-06 17:30 [Qemu-devel] [PATCH] tests: Silence migration-test 'bad' test Dr. David Alan Gilbert (git)
2018-03-07 5:10 ` Peter Xu
2018-03-09 15:12 ` Dr. David Alan Gilbert
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.