From nobody Thu Nov 6 10:37:33 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; dkim=fail; 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 1540730574696809.7712818949261; Sun, 28 Oct 2018 05:42:54 -0700 (PDT) Received: from localhost ([::1]:40014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGkP7-0000D4-Iv for importer@patchew.org; Sun, 28 Oct 2018 08:42:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGkMh-0006pX-2v for qemu-devel@nongnu.org; Sun, 28 Oct 2018 08:40:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGkMd-0002I6-Af for qemu-devel@nongnu.org; Sun, 28 Oct 2018 08:40:21 -0400 Received: from m12-12.163.com ([220.181.12.12]:34789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGkMc-00028d-Fs for qemu-devel@nongnu.org; Sun, 28 Oct 2018 08:40:19 -0400 Received: from ubuntu.localdomain (unknown [183.159.66.97]) by smtp8 (Coremail) with SMTP id DMCowABXB4MnrtVbZkS8WA--.19674S4; Sun, 28 Oct 2018 20:40:09 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=blzKWckMVzXfC4NCCR Xg5ys0lwF1hTLJaUAlKHKONEQ=; b=Y2sHEtMb+PmtYawL86U+Ve8AeGvc3JMQs3 bYMkBQ9DsKjoQZo4mPRshpWc2klnTAjyLOBj4O3jT7cY514B5S+l/eQnXwwZNUPs sAU9FXpZfm3XJ6srZC8gzdT3m4w6X+ibLOudl8dc2Uw6w8nN3PbhvhfWjQxhLVCV tK2FoleIQ= From: Li Qiang To: pbonzini@redhat.com, thuth@redhat.com, lvivier@redhat.com Date: Sun, 28 Oct 2018 05:40:04 -0700 Message-Id: <20181028124004.30494-3-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181028124004.30494-1-liq3ea@163.com> References: <20181028124004.30494-1-liq3ea@163.com> X-CM-TRANSID: DMCowABXB4MnrtVbZkS8WA--.19674S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw1fJw1kKw47AryrKFy8Zrb_yoW8GF4kpr yj9FnFkrZ5JF4aqr13Gr1qqr4fKr9rCw48CF4qqr40yw1UCr1qqa18CasYg3WDWFWIvFs8 ZF1vqF13Kr4DJaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jjg4fUUUUU= X-Originating-IP: [183.159.66.97] X-CM-SenderInfo: 5oltjvrd6rljoofrz/xtbBLwrtbVUMGiniBAAAsp X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.12 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 , philmd@redhat.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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c index 1c5103fe1c..37765f15f8 100644 --- a/tests/fw_cfg-test.c +++ b/tests/fw_cfg-test.c @@ -99,6 +99,15 @@ 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; + + qfw_cfg_get_file(fw_cfg, "etc/boot-fail-wait", + &reboot_timeout, sizeof(reboot_timeout)); + g_assert_cmpint(reboot_timeout, <=3D, 65535); +} + int main(int argc, char **argv) { QTestState *s; @@ -106,7 +115,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=3D4294967295"); =20 fw_cfg =3D pc_fw_cfg_init(s); =20 @@ -125,6 +135,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