From nobody Mon Feb 9 19:29:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=163.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552962776219213.12969850639854; Mon, 18 Mar 2019 19:32:56 -0700 (PDT) Received: from localhost ([127.0.0.1]:50423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h64Yb-0003la-6S for importer@patchew.org; Mon, 18 Mar 2019 22:32:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h64Wt-00039J-PX for qemu-devel@nongnu.org; Mon, 18 Mar 2019 22:31:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h64Ws-0001Og-JK for qemu-devel@nongnu.org; Mon, 18 Mar 2019 22:31:03 -0400 Received: from m12-15.163.com ([220.181.12.15]:56406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h64Wo-00010B-2A for qemu-devel@nongnu.org; Mon, 18 Mar 2019 22:31:01 -0400 Received: from test-VirtualBox.hz.ali.com (unknown [42.120.75.35]) by smtp11 (Coremail) with SMTP id D8CowADnLW1GVJBc54WfAw--.32058S4; Tue, 19 Mar 2019 10:30:35 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=0eB1+QBlWbXGCAw+qu CruIPOxFUUvrx83fsJBBdsAeE=; b=CnVPcckZCgurxIw42hRPY8YT0WsEM+S06Z j16O0/xOC20VyKQaweiv8za7j0qEy6YHBQYTUC58xz8Ejxi6V11d/W65ZwE7xnbN ZA2CI9hqIAZ49lL6BVKVrMva0iNrBb1lpQbGdCuViGFaCXRLGcGrDtyaoDpO+T49 2cGMU4hag= From: Li Qiang To: thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com, philmd@redhat.com, lersek@redhat.com, kraxel@redhat.com Date: Tue, 19 Mar 2019 10:30:30 +0800 Message-Id: <20190319023030.947-3-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190319023030.947-1-liq3ea@163.com> References: <20190319023030.947-1-liq3ea@163.com> X-CM-TRANSID: D8CowADnLW1GVJBc54WfAw--.32058S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7KF1UCFykXw4fCF45CF1xXwb_yoW8XrWUpr yj93WqkrZ5JF4aqr13GrnrXr1ftr97Cr48CFWqqFWIyw18Gr1qqa18CasYgF1DWFWIvFs8 Z3WktF15Krs8JaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UgeOXUUUUU= X-Originating-IP: [42.120.75.35] X-CM-SenderInfo: 5oltjvrd6rljoofrz/xtbBoQt8bVQHD-cdDgAAsD X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.15 Subject: [Qemu-devel] [PATCH 2/2] tests: fw_cfg: add reboot_timeout test case 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: Li Qiang , liq3ea@gmail.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Li Qiang --- tests/fw_cfg-test.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c index 1c5103fe1c..551b51e38f 100644 --- a/tests/fw_cfg-test.c +++ b/tests/fw_cfg-test.c @@ -99,6 +99,17 @@ static void test_fw_cfg_boot_menu(void) g_assert_cmpint(qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_MENU), =3D=3D, boo= t_menu); } =20 +static void test_fw_cfg_reboot_timeout(void) +{ + uint32_t reboot_timeout =3D 0; + size_t filesize; + + filesize =3D qfw_cfg_get_file(fw_cfg, "etc/boot-fail-wait", + &reboot_timeout, sizeof(reboot_timeout)); + g_assert_cmpint(filesize, =3D=3D, sizeof(reboot_timeout)); + g_assert_cmpint(reboot_timeout, =3D=3D, 15); +} + int main(int argc, char **argv) { QTestState *s; @@ -106,7 +117,8 @@ int main(int argc, char **argv) =20 g_test_init(&argc, &argv, NULL); =20 - s =3D qtest_init("-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8"); + s =3D qtest_init("-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8 " + "-boot reboot-timeout=3D15"); =20 fw_cfg =3D pc_fw_cfg_init(s); =20 @@ -125,6 +137,7 @@ int main(int argc, char **argv) qtest_add_func("fw_cfg/max_cpus", test_fw_cfg_max_cpus); qtest_add_func("fw_cfg/numa", test_fw_cfg_numa); qtest_add_func("fw_cfg/boot_menu", test_fw_cfg_boot_menu); + qtest_add_func("fw_cfg/reboot_timeout", test_fw_cfg_reboot_timeout); =20 ret =3D g_test_run(); =20 --=20 2.17.1