From nobody Tue Nov 4 18:51:44 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530651726508192.14364973287343; Tue, 3 Jul 2018 14:02:06 -0700 (PDT) Received: from localhost ([::1]:42633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faSQz-0006LS-CS for importer@patchew.org; Tue, 03 Jul 2018 17:02:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faSJ0-0008QS-Pq for qemu-devel@nongnu.org; Tue, 03 Jul 2018 16:53:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1faSIy-00010l-Kk for qemu-devel@nongnu.org; Tue, 03 Jul 2018 16:53:46 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48386 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1faSIy-00010P-Fo for qemu-devel@nongnu.org; Tue, 03 Jul 2018 16:53:44 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w63KnBw5132823 for ; Tue, 3 Jul 2018 16:53:43 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 2k0gcs0cy0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 03 Jul 2018 16:53:43 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Jul 2018 14:53:43 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 3 Jul 2018 14:53:39 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w63Krc8t12124566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Jul 2018 13:53:39 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE6EB7805E; Tue, 3 Jul 2018 14:53:38 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2BF97805C; Tue, 3 Jul 2018 14:53:38 -0600 (MDT) Received: from localhost (unknown [9.53.92.156]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 3 Jul 2018 14:53:38 -0600 (MDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Tue, 3 Jul 2018 15:52:12 -0500 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180703205221.24788-1-mdroth@linux.vnet.ibm.com> References: <20180703205221.24788-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18070320-0012-0000-0000-000016869C4B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009303; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01056103; UDB=6.00541730; IPR=6.00834026; MB=3.00021980; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-03 20:53:41 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070320-0013-0000-0000-0000538B80E1 Message-Id: <20180703205221.24788-6-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-03_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807030235 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id w63KnBw5132823 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PULL 05/14] test-qga: add trivial tests for some commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Tom=C3=A1=C5=A1 Golembiovsk=C3=BD These commands did not get their tests in the original commits: - guest-get-host-name - guest-get-timezone - guest-get-users Trivial tests that mostly only call the commands were added. Signed-off-by: Tom=C3=A1=C5=A1 Golembiovsk=C3=BD Reviewed-by: Marc-Andr=C3=A9 Lureau * replace QDECREF() with qobject_unref() Signed-off-by: Michael Roth --- tests/test-qga.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++= ++ 1 file changed, 54 insertions(+) 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); } =20 +static void test_qga_guest_get_host_name(gconstpointer fix) +{ + const TestFixture *fixture =3D fix; + QDict *ret, *val; + + ret =3D qmp_fd(fixture->fd, "{'execute': 'guest-get-host-name'}"); + g_assert_nonnull(ret); + qmp_assert_no_error(ret); + + val =3D 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 =3D fix; + QDict *ret, *val; + + ret =3D 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 =3D 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 =3D fix; + QDict *ret; + QList *val; + + ret =3D 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 =3D 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); =20 ret =3D g_test_run(); =20 --=20 2.11.0