From patchwork Tue Oct 30 04:28:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10660455 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 90B7B13A4 for ; Tue, 30 Oct 2018 04:30:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FAEA2A183 for ; Tue, 30 Oct 2018 04:30:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73C532A18E; Tue, 30 Oct 2018 04:30:36 +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_ADSP_CUSTOM_MED, 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 2D6022A183 for ; Tue, 30 Oct 2018 04:30:36 +0000 (UTC) Received: from localhost ([::1]:50685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHLfn-0003UO-Fu for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Oct 2018 00:30:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHLeX-0002Ww-Tt for qemu-devel@nongnu.org; Tue, 30 Oct 2018 00:29:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHLeT-0001oF-9n for qemu-devel@nongnu.org; Tue, 30 Oct 2018 00:29:16 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:38847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHLeP-0001k6-1I for qemu-devel@nongnu.org; Tue, 30 Oct 2018 00:29:11 -0400 Received: by mail-pg1-x541.google.com with SMTP id f8-v6so4975248pgq.5 for ; Mon, 29 Oct 2018 21:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NaJfmgLGSXqRTJYxDStGL9uHcp2CbcbfdoDgygrcGss=; b=CQhGTrEuLUEHbGio+YaTnpXKZxXSBoAYZIgorP5/fJjUGnLqzkabirChd4JrOvAZo/ GF4hxkM+rIyqWGtKeOXOSYzCtPVdvsD6GIvQvUkmdfuRYXDD92Y+g9VcI4/Z6crOjNeu UONuf7OkxuGZVNIi9/XaKJW0+7Qg4zy/msPSXWMNnacwL9t0hzHtkr5zr6rk9QO0xTLa KM8fHqxDNCvp2o7nae9Y+5Qa/Pg3A2cKmR40+EyhfA3i2hR3g+PqBYaCz01ZvFvP6lp8 6HQu4Rbudv58KqG0to6r5uetfcHFYJn5rlejGm3hYkwZQMl7C6hoSv7EFOJKwwDPe/xr hm7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NaJfmgLGSXqRTJYxDStGL9uHcp2CbcbfdoDgygrcGss=; b=XagMdlhWZYtKdX6uimXP2b4Xs2+bdGKTFjvvPGIYAgy5UgW92LLobA/F/Pv+3yfmlj TwJKO7+Ve/1GpqkKM52yfkm3jMzNipGgA+E+Of7Sn7LRL29rt30lf9pkR07iho/H6EFJ YlnGRvzcHLP5LsRgreGJWuyfvtgCsF6OHXtcoQBHbdlnC93ugXMleyGQMxOCRk+OTuuX T2/sVRmx48R5GfiKNV1jW9BrzMzdDhZa58nd5jiUtRWed6Kj7lpoVkQ9RyFL0/BhutrL MAFZV2IGcFiE48MUXgxi0KMLPZ9TW2AROHXHMWJjSJLixuNQVUqrVTCz23bkDDfv7PBD BgbA== X-Gm-Message-State: AGRZ1gLDwFOoto3v01kQrsn+T8rgm1rmdOT/4J7n8DYwfDBHheDJ/vb3 YvwNE0yDZ5OQne3JurDsBkM= X-Google-Smtp-Source: AJdET5faqCbZVANavJFdp2+DdhMdZNFmkrQtWSY+PHITtkeiUQBaR9D5fJHX/KUL5L74wnRQDAoxWQ== X-Received: by 2002:a63:c40c:: with SMTP id h12-v6mr16377980pgd.298.1540873747681; Mon, 29 Oct 2018 21:29:07 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.65]) by smtp.gmail.com with ESMTPSA id 64-v6sm48233059pfq.10.2018.10.29.21.29.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 21:29:07 -0700 (PDT) From: Li Qiang To: pbonzini@redhat.com, thuth@redhat.com, lvivier@redhat.com, philmd@redhat.com Date: Mon, 29 Oct 2018 21:28:52 -0700 Message-Id: <1540873732-3503-3-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1540873732-3503-1-git-send-email-liq3ea@gmail.com> References: <1540873732-3503-1-git-send-email-liq3ea@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 Subject: [Qemu-devel] [PATCH v2 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 , 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c index 1c5103fe1c..aeabd17ec0 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; @@ -125,6 +134,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();