Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nIHNR-0003pA-98 for mharc-grub-devel@gnu.org; Thu, 10 Feb 2022 16:53:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIHNQ-0003mF-Bi for grub-devel@gnu.org; Thu, 10 Feb 2022 16:53:20 -0500 Received: from [2607:f8b0:4864:20::72e] (port=34320 helo=mail-qk1-x72e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIHNO-0008Ih-6T for grub-devel@gnu.org; Thu, 10 Feb 2022 16:53:19 -0500 Received: by mail-qk1-x72e.google.com with SMTP id bs32so6388782qkb.1 for ; Thu, 10 Feb 2022 13:53:17 -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=SDvX7ODr2xxYEUF8/CyX1vBcmC350oa94ne/xcAKZrs=; b=b47EWYvYBIe6zvYjmuZSmH76Qgyb2nH1cWKWFOHW8X9v7NcDuUs8cBkKkMCqJBDxFz SCYEQtyY01MgrxBmEMB3EAKWpJd4q2ky7lqVFf+WVOFJJRP43skQEhQUDcbtouO+EjDP LZTxSQDb+Gzr9XmsUBY4kL47h0iFYyF9ju+hYXs4VMgn03bTCvn1tKYSq2gGMAC20hvA xkwlkghqUPb+yR2zEFarMAWegNJ8XzhEZo5yr/1TY+e6+a7ystKb0pyK3NOiMC5mia6q EFEHQRj4Txc34p3WBlZdbrcHopFyeoUqmhIindgRhEW5RuTGPyb7hKDTIGlNugKstwXx AI+g== 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=SDvX7ODr2xxYEUF8/CyX1vBcmC350oa94ne/xcAKZrs=; b=js1Ihc3H7pv2/PqUXoz5yN/BZFYAe2HywEffBSf0aYEEJ6J4qO99EEi+0zwmTVCySj 2lz77SHI47QzsTUENaARg6JAZEW2ZB8gLpH7GG8qf8GOtLsxM+kgumyVPJYb/wV+028z 5FbkDK9mbDP+OLdeCBv729kkvWW5Cwq610+pzzYBFK+6KPYmQ7MFgdRl+z1rjOn5rjn9 6cekDJLmq8ZI7IFMsT5zQQ9FtzvCUYH1SSUduSqbVFUakBAHwouqLlhM4JaIYQUlVJw8 kN2r6vv4/f8otVkCK2JG8Xz7rt7MBp28hymnoy+8H1wDd8zqYXqgudZzRFlsITTnrgos u2wA== X-Gm-Message-State: AOAM530y2YybH4FEUJmiaPAyDqovMi9vS7vwIns9XLMoW+Y4ktsefRKD 14tBl2ycyipwCoGUbP72boje6A== X-Google-Smtp-Source: ABdhPJxKApH3PznvDwbvRzjtb3zR2C41VYxDYOCKHFdEgFcTrI32vS/HnoJ/2UZsUuGZkMolixNuxQ== X-Received: by 2002:a05:620a:280b:: with SMTP id f11mr4979111qkp.736.1644529997371; Thu, 10 Feb 2022 13:53:17 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 13:53:17 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH v3 09/15] grub-shell: Create run.sh in working directory for easily running test again Date: Thu, 10 Feb 2022 15:51:26 -0600 Message-Id: <39c6078bdd716560024f8c678657e7e9176c741f.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::72e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=development@efficientek.com; helo=mail-qk1-x72e.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:20 -0000 Now it becomes trivial to re-run a test from the output in its working directory. This also makes it easy to send a reproducible failing test to the mailing list. This has allowed a a refactor so that the duplicated code to call QEMU has be condensed (eg. the use of timeout and file descriptor redirection). Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 96869184c..48c7fde48 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -511,8 +511,10 @@ 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 - setup_qemu_logger - 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=$? + cat >"$work_directory/run.sh" < "$work_directory/qemu-pipe" || ret=$? + cat >"$work_directory/run.sh" <"$work_directory/run.sh" < "$work_directory/qemu-pipe" || ret=$? + chmod +x "$work_directory/run.sh" + timeout -s KILL $timeout "$work_directory/run.sh" > "$work_directory/qemu-pipe" || ret=$? fi wait @@ -555,6 +569,7 @@ fi test -n "$debug" || rm -f "${isofile}" test -n "$debug" || rm -rf "${rom_directory}" test -n "$debug" || rm -f "${tmpfile}" "${cfgfile}" "${goutfile}" +test -n "$debug" || rm -f "$work_directory/run.sh" exit $ret -- 2.27.0