Commit b3e9e584 authored by Michael Roth's avatar Michael Roth
Browse files

tests: test-qga, loosen assumptions about host filesystems



QGA skips pseudo-filesystems when querying filesystems via
guest-get-fsinfo. On some hosts, such as travis-ci which uses
containers with simfs filesystems, QGA might not report *any*
filesystems. Our test case assumes there would be at least one,
leading to false error messages in these situations.

Instead, sanity-check values iff we get at least one filesystem.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent 147482ae
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -273,13 +273,15 @@ static void test_qga_get_fsinfo(gconstpointer fix)
    g_assert_nonnull(ret);
    qmp_assert_no_error(ret);

    /* check there is at least a fs */
    /* sanity-check the response if there are any filesystems */
    list = qdict_get_qlist(ret, "return");
    entry = qlist_first(list);
    if (entry) {
        g_assert(qdict_haskey(qobject_to_qdict(entry->value), "name"));
        g_assert(qdict_haskey(qobject_to_qdict(entry->value), "mountpoint"));
        g_assert(qdict_haskey(qobject_to_qdict(entry->value), "type"));
        g_assert(qdict_haskey(qobject_to_qdict(entry->value), "disk"));
    }

    QDECREF(ret);
}