qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: qemu-devel@nongnu.org, lekiravi@yandex-team.ru
Cc: Jason Wang <jasowang@redhat.com>
Subject: [PATCH 4/5] Revert "tests: Add tests for query-netdev command"
Date: Fri,  2 Apr 2021 16:15:18 +0800	[thread overview]
Message-ID: <20210402081519.78878-5-jasowang@redhat.com> (raw)
In-Reply-To: <20210402081519.78878-1-jasowang@redhat.com>

Several issues has been reported for query-netdev series. Consider
it's late in the rc, this reverts commitThis reverts commit
3c3b656885473ef0d699290ba966177f17839aa5.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 tests/qtest/meson.build         |   3 -
 tests/qtest/test-query-netdev.c | 120 --------------------------------
 2 files changed, 123 deletions(-)
 delete mode 100644 tests/qtest/test-query-netdev.c

diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 902cfef7cb..420cd9986e 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -33,9 +33,6 @@ qtests_generic = \
 if config_host.has_key('CONFIG_MODULES')
   qtests_generic += [ 'modules-test' ]
 endif
-if slirp.found()
-  qtests_generic += [ 'test-query-netdev' ]
-endif
 
 qtests_pci = \
   (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) +                  \
diff --git a/tests/qtest/test-query-netdev.c b/tests/qtest/test-query-netdev.c
deleted file mode 100644
index 1118537a9f..0000000000
--- a/tests/qtest/test-query-netdev.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * QTest testcase for the query-netdev
- *
- * Copyright Yandex N.V., 2019
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- */
-
-#include "qemu/osdep.h"
-
-#include "libqos/libqtest.h"
-#include "qapi/qmp/qdict.h"
-#include "qapi/qmp/qlist.h"
-
-/*
- * Events can get in the way of responses we are actually waiting for.
- */
-GCC_FMT_ATTR(2, 3)
-static QObject *wait_command(QTestState *who, const char *command, ...)
-{
-    va_list ap;
-    QDict *response;
-    QObject *result;
-
-    va_start(ap, command);
-    qtest_qmp_vsend(who, command, ap);
-    va_end(ap);
-
-    response = qtest_qmp_receive(who);
-
-    result = qdict_get(response, "return");
-    g_assert(result);
-    qobject_ref(result);
-    qobject_unref(response);
-
-    return result;
-}
-
-static void qmp_query_netdev_no_error(QTestState *qts, size_t netdevs_count)
-{
-    QObject *resp;
-    QList *netdevs;
-
-    resp = wait_command(qts, "{'execute': 'query-netdev'}");
-
-    netdevs = qobject_to(QList, resp);
-    g_assert(netdevs);
-    g_assert(qlist_size(netdevs) == netdevs_count);
-
-    qobject_unref(resp);
-}
-
-static void test_query_netdev(void)
-{
-    const char *arch = qtest_get_arch();
-    QObject *resp;
-    QTestState *state;
-
-    /* Choosing machine for platforms without default one */
-    if (g_str_equal(arch, "arm") ||
-        g_str_equal(arch, "aarch64")) {
-        state = qtest_init(
-            "-nodefaults "
-            "-M virt "
-            "-netdev user,id=slirp0");
-    } else if (g_str_equal(arch, "tricore")) {
-        state = qtest_init(
-            "-nodefaults "
-            "-M tricore_testboard "
-            "-netdev user,id=slirp0");
-    } else if (g_str_equal(arch, "avr")) {
-        state = qtest_init(
-            "-nodefaults "
-            "-M mega2560 "
-            "-netdev user,id=slirp0");
-    } else if (g_str_equal(arch, "rx")) {
-        state = qtest_init(
-            "-nodefaults "
-            "-M gdbsim-r5f562n8 "
-            "-netdev user,id=slirp0");
-    } else {
-        state = qtest_init(
-            "-nodefaults "
-            "-netdev user,id=slirp0");
-    }
-    g_assert(state);
-
-    qmp_query_netdev_no_error(state, 1);
-
-    resp = wait_command(state,
-        "{'execute': 'netdev_add', 'arguments': {"
-        " 'id': 'slirp1',"
-        " 'type': 'user'}}");
-    qobject_unref(resp);
-
-    qmp_query_netdev_no_error(state, 2);
-
-    resp = wait_command(state,
-        "{'execute': 'netdev_del', 'arguments': {"
-        " 'id': 'slirp1'}}");
-    qobject_unref(resp);
-
-    qmp_query_netdev_no_error(state, 1);
-
-    qtest_quit(state);
-}
-
-int main(int argc, char **argv)
-{
-    int ret = 0;
-    g_test_init(&argc, &argv, NULL);
-
-    qtest_add_func("/net/qapi/query_netdev", test_query_netdev);
-
-    ret = g_test_run();
-
-    return ret;
-}
-- 
2.24.3 (Apple Git-128)



  parent reply	other threads:[~2021-04-02  8:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02  8:15 [PATCH 0/5] Revert query-netdev command for 6.0 Jason Wang
2021-04-02  8:15 ` [PATCH 1/5] Revert "net: Do not fill legacy info_str for backends" Jason Wang
2021-04-02  8:15 ` [PATCH 2/5] Revert "hmp: Use QAPI NetdevInfo in hmp_info_network" Jason Wang
2021-04-02  8:15 ` [PATCH 3/5] Revert "net: Move NetClientState.info_str to dynamic allocations" Jason Wang
2021-04-02  9:00   ` Jason Wang
2021-04-02  8:15 ` Jason Wang [this message]
2021-04-02  8:15 ` [PATCH 5/5] Revert "qapi: net: Add query-netdev command" Jason Wang
2021-04-06  4:05 ` [PATCH 0/5] Revert query-netdev command for 6.0 Jason Wang

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=20210402081519.78878-5-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=lekiravi@yandex-team.ru \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).