From patchwork Sat Apr 20 15:59:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10910371 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 A6B6B1515 for ; Sat, 20 Apr 2019 16:02:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 985ED28C94 for ; Sat, 20 Apr 2019 16:02:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C69728C96; Sat, 20 Apr 2019 16:02:03 +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=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 45D1C28C94 for ; Sat, 20 Apr 2019 16:02:03 +0000 (UTC) Received: from localhost ([127.0.0.1]:42822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsRG-0007PT-GI for patchwork-qemu-devel@patchwork.kernel.org; Sat, 20 Apr 2019 12:02:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsPK-0005w9-73 for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHsPJ-0008Fy-A8 for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:02 -0400 Received: from m12-11.163.com ([220.181.12.11]:33864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHsPI-0008F3-4s for qemu-devel@nongnu.org; Sat, 20 Apr 2019 12:00:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=w4ygKr81NYHHj0JHeC mMA9n1b8fxsPI3UkzRPp2GlvU=; b=jp9HjPVsY8Snt97LB1FHL2YEcDpWnOfEFi ta8Uwku8yYxE1EAZNef/iiRRskYYcJco6dA1TALpAoDk7l37blOHbjwnJprzqvjp FF59xmbFgP+dwJ5liT0NIUtgOhK4gG6tIsGsHqPgqjJGZNKdirlGBPV0tflaa3cQ yDOGtVuyo= Received: from localhost.localdomain (unknown [183.159.69.175]) by smtp7 (Coremail) with SMTP id C8CowACX_I34QbtcELxpBQ--.29437S3; Sat, 20 Apr 2019 23:59:55 +0800 (CST) From: Li Qiang To: jslaby@suse.cz, pbonzini@redhat.com Date: Sat, 20 Apr 2019 08:59:47 -0700 Message-Id: <20190420155949.130968-2-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190420155949.130968-1-liq3ea@163.com> References: <20190420155949.130968-1-liq3ea@163.com> X-CM-TRANSID: C8CowACX_I34QbtcELxpBQ--.29437S3 X-Coremail-Antispam: 1Uf129KBjvJXoWrZF48CF17GFyxAFW3Ar1xuFg_yoW8JF13pF 1Uu3WYkrZ5JFZFqr13Gr1qqr1ftr97Cw18JrZxXFWjyw48Xr1DKa10ka4Fgrn8JF48Xanx Z3ZYqF43KF1DXaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UQNVkUUUUU= X-Originating-IP: [183.159.69.175] X-CM-SenderInfo: 5oltjvrd6rljoofrz/1tbiKRmcbVXlqvAo4QABsj X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.11 Subject: [Qemu-devel] [PATCH v2 1/3] tests: fw_cfg: add splash time 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+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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c index 9f75dbb5f4..de8e81ea9d 100644 --- a/tests/fw_cfg-test.c +++ b/tests/fw_cfg-test.c @@ -192,6 +192,24 @@ static void test_fw_cfg_reboot_timeout(void) qtest_quit(s); } +static void test_fw_cfg_splash_time(void) +{ + QFWCFG *fw_cfg; + QTestState *s; + uint16_t splash_time = 0; + size_t filesize; + + s = qtest_init("-boot splash-time=12"); + fw_cfg = pc_fw_cfg_init(s); + + filesize = qfw_cfg_get_file(fw_cfg, "etc/boot-menu-wait", + &splash_time, sizeof(splash_time)); + g_assert_cmpint(filesize, ==, sizeof(splash_time)); + g_assert_cmpint(splash_time, ==, 12); + pc_fw_cfg_uninit(fw_cfg); + qtest_quit(s); +} + int main(int argc, char **argv) { int ret; @@ -214,6 +232,7 @@ int main(int argc, char **argv) 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); + qtest_add_func("fw_cfg/splash_time", test_fw_cfg_splash_time); ret = g_test_run();