aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-07-05 08:21:25 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-07-05 08:21:25 +0100
commit8beb8cc64da2868acec270e4becb9fea8f9093dc (patch)
treee52359adc3fb84e4fab87ef7306ae4fe6f0cd4d9 /tests
parentfe8d2d5737ab20ed0118863f5eb888cae37122ab (diff)
parent73e1d8eb9b738cef3dee2da26bb669b1092a4c12 (diff)
Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2018-07-03-tag' into staging
qemu-ga patch queue for soft-freeze * add systemd suspend support * add used/total space stats for guest-get-fsinfo * fixes for guest-get-fsinfo over PCI bridges * MSI installer and schema doc fixes * guard against unbounded allocations in guest-file-read * add some additional qga test cases # gpg: Signature made Tue 03 Jul 2018 21:45:32 BST # gpg: using RSA key 3353C9CEF108B584 # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" # gpg: aka "Michael Roth <mdroth@utexas.edu>" # gpg: aka "Michael Roth <mdroth@linux.vnet.ibm.com>" # Primary key fingerprint: CEAC C9E1 5534 EBAB B82D 3FA0 3353 C9CE F108 B584 * remotes/mdroth/tags/qga-pull-2018-07-03-tag: qga: removing bios_supports_mode qga: systemd hibernate/suspend/hybrid-sleep support qga: removing switch statements, adding run_process_child qga: guest_suspend: decoupling pm-utils and sys logic qga: bios_supports_mode: decoupling pm-utils and sys logic qga: refactoring qmp_guest_suspend_* functions qemu-ga: make get-fsinfo work over pci bridges qga-win: Fixing msi upgrade disallow in WiX file qga/schema: fix documentation for GuestOSInfo test-qga: add trivial tests for some commands qga-win: add driver path usage to GuestFilesystemInfo qga: add mountpoint usage info to GuestFilesystemInfo qga: check bytes count read by guest-file-read qga: unset frozen state if no mount points are frozen Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-qga.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/test-qga.c b/tests/test-qga.c
index 30c9643257..350f27812a 100644
--- a/tests/test-qga.c
+++ b/tests/test-qga.c
@@ -854,6 +854,54 @@ static void test_qga_guest_exec_invalid(gconstpointer fix)
qobject_unref(ret);
}
+static void test_qga_guest_get_host_name(gconstpointer fix)
+{
+ const TestFixture *fixture = fix;
+ QDict *ret, *val;
+
+ ret = qmp_fd(fixture->fd, "{'execute': 'guest-get-host-name'}");
+ g_assert_nonnull(ret);
+ qmp_assert_no_error(ret);
+
+ val = qdict_get_qdict(ret, "return");
+ g_assert(qdict_haskey(val, "host-name"));
+
+ qobject_unref(ret);
+}
+
+static void test_qga_guest_get_timezone(gconstpointer fix)
+{
+ const TestFixture *fixture = fix;
+ QDict *ret, *val;
+
+ ret = qmp_fd(fixture->fd, "{'execute': 'guest-get-timezone'}");
+ g_assert_nonnull(ret);
+ qmp_assert_no_error(ret);
+
+ /* Make sure there's at least offset */
+ val = qdict_get_qdict(ret, "return");
+ g_assert(qdict_haskey(val, "offset"));
+
+ qobject_unref(ret);
+}
+
+static void test_qga_guest_get_users(gconstpointer fix)
+{
+ const TestFixture *fixture = fix;
+ QDict *ret;
+ QList *val;
+
+ ret = qmp_fd(fixture->fd, "{'execute': 'guest-get-users'}");
+ g_assert_nonnull(ret);
+ qmp_assert_no_error(ret);
+
+ /* There is not much to test here */
+ val = qdict_get_qlist(ret, "return");
+ g_assert_nonnull(val);
+
+ qobject_unref(ret);
+}
+
static void test_qga_guest_get_osinfo(gconstpointer data)
{
TestFixture fixture;
@@ -946,6 +994,12 @@ int main(int argc, char **argv)
test_qga_guest_exec_invalid);
g_test_add_data_func("/qga/guest-get-osinfo", &fix,
test_qga_guest_get_osinfo);
+ g_test_add_data_func("/qga/guest-get-host-name", &fix,
+ test_qga_guest_get_host_name);
+ g_test_add_data_func("/qga/guest-get-timezone", &fix,
+ test_qga_guest_get_timezone);
+ g_test_add_data_func("/qga/guest-get-users", &fix,
+ test_qga_guest_get_users);
ret = g_test_run();