From patchwork Sun Oct 28 12:40:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10658585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 660EB13A9 for ; Sun, 28 Oct 2018 12:42:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5660829C8C for ; Sun, 28 Oct 2018 12:42:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A72929C95; Sun, 28 Oct 2018 12:42:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2C2C929C8C for ; Sun, 28 Oct 2018 12:42:21 +0000 (UTC) Received: from localhost ([::1]:40014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGkOa-0000D4-EO for patchwork-qemu-devel@patchwork.kernel.org; Sun, 28 Oct 2018 08:42:20 -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 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= 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) 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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), ==, boot_menu); } +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, <=, 65535); +} + int main(int argc, char **argv) { QTestState *s; @@ -106,7 +115,8 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); - s = qtest_init("-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8"); + s = qtest_init("-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8" + " -boot reboot-timeout=4294967295"); fw_cfg = pc_fw_cfg_init(s); @@ -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); ret = g_test_run();