Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nIHNM-0003ay-Pb for mharc-grub-devel@gnu.org; Thu, 10 Feb 2022 16:53:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIHNL-0003X7-CX for grub-devel@gnu.org; Thu, 10 Feb 2022 16:53:15 -0500 Received: from [2607:f8b0:4864:20::82a] (port=39519 helo=mail-qt1-x82a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIHNJ-0008IA-6N for grub-devel@gnu.org; Thu, 10 Feb 2022 16:53:15 -0500 Received: by mail-qt1-x82a.google.com with SMTP id e16so6968315qtq.6 for ; Thu, 10 Feb 2022 13:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OlZAFGsIi82+LUgXOyoEOfopptaUYuYVT1pdcpPYK4c=; b=UxR4Ww4fqCLuInnozPEO5WoTalQ76aGBY+3S0DHq6VHmtfD8dvWIWYTxKTgfvVTGqP 9xuupVGEuIFbz44dtahVCWfn7bYzxv0KBANT5P8rGT904+cnwsHAIbgpWZ/tBY1lix4B 3x0uJ3CYUQAU+S3RWU/5TIEXaY4GNdFR1fBDF04NToTgpSvL8zjcrQ5JulrIR0ixLC4o e0fti7ympbIPgqM/Ii0UYXMvZYt1S6Hz9ToW3oj14pt02F0ffaRuDFDgHtprdn9SKtS5 eN2aOSHSVl/O+ifWpQZHJN1+zMinhi4OAR52tbHfmVzEyUULLEMRFQlph8jpzlGxW2tT CZHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OlZAFGsIi82+LUgXOyoEOfopptaUYuYVT1pdcpPYK4c=; b=XGI3YiXMpkJ1RuxCylyDIgK2Nk5ePksnmdKnPV0XdlD3E3/nF+bEEJ0sTT5lXqQYzK tjhOaoP7PWQkVLM/ji1I9VVx6ZX3AXfCmSEAiEb8OefSZDgcZtL31Pj5wFtXbIlobNhX FHV9k+mznO6diRGNsFs2cUjMQ8B99QADRVrDtWZQBy8gwtuW/OXcyq6LAbPzS2ikhSiq RpH5I5vaf+eugiy/umO4qf66sD6d+xj4C8AvcV5udcY/IztAtXXK6ARjp13QsE/6h/et EZiXtLDE/2cyO1o7EHTkkuBRR91TQvw8iWzsQnegstHBtPkIRSzSU7AutqZV52jyo7rg VNAA== X-Gm-Message-State: AOAM532ZzTbmn/gjDkTjsxymN3/KTruxzctQzMS59cT3VxohxURpedlM 7ehgmmCo6DCsdzoMSEL/HHl3Zg== X-Google-Smtp-Source: ABdhPJyy8WUDH7Hf7D4oNwDH3zhPq4b/j4/sMZpH1M+YapqXWtpDfv46m5LjLUvAq97BOPqHnqkdiQ== X-Received: by 2002:a05:622a:1a18:: with SMTP id f24mr6390984qtb.158.1644529992362; Thu, 10 Feb 2022 13:53:12 -0800 (PST) Received: from localhost.localdomain (garza.riseup.net. [198.252.153.109]) by smtp.gmail.com with ESMTPSA id j15sm11740363qta.83.2022.02.10.13.53.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 13:53:12 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH v3 08/15] grub-shell: Only cleanup working directory file if QEMU does not fail or timeout Date: Thu, 10 Feb 2022 15:51:25 -0600 Message-Id: <250cdc08a47c441436a9e02b81dc8290785e0b7b.1644528774.git.development@efficientek.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::82a (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::82a; envelope-from=development@efficientek.com; helo=mail-qt1-x82a.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2022 21:53:15 -0000 This keeps the generated files to aid in diagnosing the source of the failure. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 3ba539c70..96869184c 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -533,8 +533,6 @@ elif [ x$boot = xemu ]; then (cd "$rootdir"; tar cf "$roottar" .) setup_qemu_logger @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 setup_qemu_logger timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -${device}"${isofile}" ${bootdev} > "$work_directory/qemu-pipe" || ret=$? @@ -543,8 +541,16 @@ fi wait rm -f "$work_directory/qemu-pipe" +if [ "$ret" -ne 0 ]; then + # If QEMU failure, keep generated files to reproduce + exit $ret +fi + if [ x$boot = xcoreboot ]; then test -n "$debug" || rm -f "${imgfile}" +elif [ x$boot = xemu ]; then + test -n "$debug" || rm -rf "$rootdir" + test -n "$debug" || rm -f "$roottar" fi test -n "$debug" || rm -f "${isofile}" test -n "$debug" || rm -rf "${rom_directory}" -- 2.27.0