Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lCw1b-0006Gn-4H for mharc-grub-devel@gnu.org; Thu, 18 Feb 2021 22:00:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCw1Z-0006DS-Dw for grub-devel@gnu.org; Thu, 18 Feb 2021 22:00:09 -0500 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]:34413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCw1X-0005Xw-12 for grub-devel@gnu.org; Thu, 18 Feb 2021 22:00:08 -0500 Received: by mail-qk1-x72d.google.com with SMTP id t63so4374173qkc.1 for ; Thu, 18 Feb 2021 19:00:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f/x80Qr5gVIc/tQMYbeXNFZu3wzW+kHE/zNX2gMu1ec=; b=XLe9P/t7+4jSJkQPVNRKHiphbDjKmIisbHwDNhvMOFPmDxYwx+j3kyZ45e9Q7ztDy8 17j2LN+MgCksh64QfTUSu/qqDTgE0Sqyqj6aMAA6FK1jHiZWF4qcxVVgBHSL3mzWKvEb 64TfmuhE/jEeigfXwXuzFwpUlL4EbulRlz91LYOiHZVbZl8myjdgoYrEw3FqMsfDA06M 4zevAb4dnfdkB2qCoE7YNqjVFaBOie/3bBUlFYsO9++SzRwLtwqy5wL4PTpQVUYVbYGr M0tEnLCKQ7OAp+m1ipgRgE/Xg9gp2eQQ9xWGTFzIdVCTnKcQtKbXtQrE2NB2fsuotAZs 99zg== 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:mime-version:content-transfer-encoding; bh=f/x80Qr5gVIc/tQMYbeXNFZu3wzW+kHE/zNX2gMu1ec=; b=dTh3ufw77jUGEyZJx9gG7bO0Q69R76S5etqBB7RbJhkRHp1ZvOgHHwzgxXbHRUNvNQ 1ETGXm4/ZmmEUCnYl3RHCbFEcXeZZsSGvVAQRcvZGRmxqb/ssN87grByhGTR8hPUnDow BJOH6FZsYeLfJ94VB6yLlyYdTWMR684ayulKNh5VkbASUqBg2QAnlFbIWCm9CYKjZ5zO /X/Due4ZlMqhRicwnqKgknepI2KoQCKjJJY/D6ODhbVJUrxKk6xABP34NKaIPtByhjCE 3Z8D1fdvyuJBdsN1hAfWkgJc0UE5/VK9oZnFP7CYG/a80f3sCyr1JJ8jlrLAlElkNVbv op4g== X-Gm-Message-State: AOAM532UHDVZLQJi7xgLx9xe88HBBn3mJ+gREq6nA/jgfxW7WLgRpsSD qg0G8vh68R+eLN8GqaHa7UjurAOY5UbxBA== X-Google-Smtp-Source: ABdhPJwBBO85Bblgo903VwWw72IyxsN7eF8DUsnk3CMQPHMxxGuBPSTiJ4T3m9uMiHzS/0eryJa/qQ== X-Received: by 2002:a37:b96:: with SMTP id 144mr7859576qkl.314.1613703605752; Thu, 18 Feb 2021 19:00:05 -0800 (PST) Received: from localhost.localdomain ([2605:a601:aac5:3700:c323:c101:d96b:34f1]) by smtp.gmail.com with ESMTPSA id b17sm2468294qtq.56.2021.02.18.19.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 19:00:05 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org Cc: Daniel Kiper , Glenn Washburn Subject: [CI 11/17] grub-shell: Set exit status to qemu exit status Date: Thu, 18 Feb 2021 20:59:30 -0600 Message-Id: <3f9a6982e2b5e4769672b90a172f44c45c324469.1613698435.git.development@efficientek.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::72d; envelope-from=development@efficientek.com; helo=mail-qk1-x72d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2021 03:00:10 -0000 This allows us to test if unexpected output in test scripts is because of a bug in grub, because there was an error in qemu, or qemu was killed due to a timeout. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index c6d7860e9..40c62b9fd 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -498,6 +498,9 @@ copy_extra_files() { done } +ret=0 +mkfifo "$work_directory/qemu-pipe" +cat < "$work_directory/qemu-pipe" | tr -d "\r" | tee "${goutfile}" | do_trim & if [ x$boot = xnet ]; then netdir="$work_directory/netdir" mkdir -p "$netdir" @@ -505,7 +508,7 @@ if [ x$boot = xnet ]; then cp "${cfgfile}" "$netdir/boot/grub/grub.cfg" cp "${source}" "$netdir/boot/grub/testcase.cfg" [ -z "$files" ] || copy_extra_files "$netdir" $files - timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/${grub_modinfo_target_cpu}-${grub_modinfo_platform}/core.$netbootext" -net nic | cat | tr -d "\r" | tee "${goutfile}" | do_trim + timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/${grub_modinfo_target_cpu}-${grub_modinfo_platform}/core.$netbootext" -net nic > "$work_directory/qemu-pipe" || ret=$? elif [ x$boot = xemu ]; then rootdir="$work_directory/rootdir" grubdir="$rootdir/boot/grub" @@ -524,11 +527,11 @@ elif [ x$boot = xemu ]; then [ -z "$files" ] || copy_extra_files "$rootdir" $files roottar="$work_directory/root.tar" (cd "$rootdir"; tar cf "$roottar" .) - @builddir@/grub-core/grub-emu -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | tee "${goutfile}" | do_trim + @builddir@/grub-core/grub-emu -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" > "$work_directory/qemu-pipe" || ret=$? test -n "$debug" || rm -rf "$rootdir" test -n "$debug" || rm -f "$roottar" else - timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -${device}"${isofile}" ${bootdev} | cat | tr -d "\r" | tee "${goutfile}" | do_trim + timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -${device}"${isofile}" ${bootdev} > "$work_directory/qemu-pipe" || ret=$? fi if [ x$boot = xcoreboot ]; then test -n "$debug" || rm -f "${imgfile}" @@ -536,6 +539,7 @@ fi test -n "$debug" || rm -f "${isofile}" test -n "$debug" || rm -rf "${rom_directory}" test -n "$debug" || rm -f "${tmpfile}" "${cfgfile}" -exit 0 +rm -f "$work_directory/qemu-pipe" +exit $ret -- 2.27.0