From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pJ75v-00014j-FB for mharc-grub-devel@gnu.org; Sat, 21 Jan 2023 01:11:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJ75s-000142-1g for grub-devel@gnu.org; Sat, 21 Jan 2023 01:11:12 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJ75p-0007ce-Vr for grub-devel@gnu.org; Sat, 21 Jan 2023 01:11:11 -0500 Received: by mail-pl1-x62b.google.com with SMTP id z13so7093999plg.6 for ; Fri, 20 Jan 2023 22:11:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tvw0ohbTQOaPpb3MUD+A4/evM66ZRpMvqrQcYRQThZg=; b=sxxydfxFDTiDT4HZ73VQgKyBFuS7Dkc9sMMUSa3/fEcgPQQwwknKWOeg4CrfIZZJSZ vFRWgDia4DOMM/8ys9fliBDEun8p6nw9tqYShwUt+5eq4G05x7Ofy+TYTFUHEzLr3dgJ akVJZ8x57UyC7aGEifbVuSa1aWlP+k6ylNu1Aq+rIVIwSqhAbc51c3r/6pPtje6+mr5q e/Tl4XBQvDAGpHmAffJgqJRqoULJxo8OR8lMu59yv1zcMOCbtTsC8vX+dLligKhXXHCM bBWNjS3u1sjIaW73lFMigqwgxLzyTtGBYNQORZjPeoa9ZEsujIvijsJK9WsKFc0eT8Be xRKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tvw0ohbTQOaPpb3MUD+A4/evM66ZRpMvqrQcYRQThZg=; b=vcdyUFfRdjfuy3kKlKNNX8dqFXIfr2BblDyBpEV34ISWX3x97d3/e408/UibFEunyk mK+MpXs8o67a+pfAqxgCGxwTNkqbclbVUBGHFnjPWenbIYKOejl3dYn5wUaq+ae1sfVM VVft07ju2Z6pi6OVzEsztuqUq2AK1DnQSg9q8OhpExD6jkNBLi+ZPiyLhqB7OpQmhYFV It4INbG5fkJJn2uNEVkrZN2kDt9s5al0H6TkcPDN9TGEHw1TgY4TkKp62rpBVkuIh30b LZBFcSHTvkp/nd2CvX9el8eKhGDmYxIVIGMiPX15cYtgynSG+q9Ae2f2i2aF5QWwu5oB Hhxg== X-Gm-Message-State: AFqh2krijH2e55cmEHw2paUn/Q9pYBRb+lgK5WuthqnG+fq8+2IyHR3/ fcGBx/L1pNJ8sfELLrr2g0rZsRBUYY7VQI7+ X-Google-Smtp-Source: AMrXdXuNMYaCLnwrDO7HnetN4S8yOZ0xqcIZAs0QHv3RBCHqrW3VPUs5N0R8uwH7CwPHrRipXzcsmw== X-Received: by 2002:a17:902:b18f:b0:193:234:443a with SMTP id s15-20020a170902b18f00b001930234443amr15638406plr.45.1674281468126; Fri, 20 Jan 2023 22:11:08 -0800 (PST) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id u12-20020a17090341cc00b001888cadf8f6sm9241267ple.49.2023.01.20.22.11.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 22:11:07 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH 1/3] tests: Allow turning on shell tracing from environment variables Date: Sat, 21 Jan 2023 00:10:44 -0600 Message-Id: <20230121061046.1619695-2-development@efficientek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230121061046.1619695-1-development@efficientek.com> References: <20230121061046.1619695-1-development@efficientek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=development@efficientek.com; helo=mail-pl1-x62b.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.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2023 06:11:13 -0000 This allows turning on shell tracing for grub-shell and grub-fs-tester when its not practical or not possible to use commandline arguments (eg. from `make check`). Turn on tracing when the envvar is an integer greater than 1, since these can generate a lot of output. Since this change uses the environment variables to set the default value for debug in grub-shell, this allows enabling grub-shell's debug mode which will preserve various generated output files that are helpful for debugging tests. Signed-off-by: Glenn Washburn --- tests/util/grub-fs-tester.in | 2 ++ tests/util/grub-shell.in | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in index cd63941a5f..c9c2d79f22 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -6,6 +6,8 @@ export BLKID_FILE=/dev/null # We can't have this set, or filesystem tests will fail. unset SOURCE_DATE_EPOCH +[ "${GRUB_TEST_DEFAULT_DEBUG:-0}" -gt 1 ] && set -x + fs="$1" GRUBFSTEST="@builddir@/grub-fstest" diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index f5a6e822fd..60494bcf1d 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -216,6 +216,7 @@ esac timeout=60 mkimage_extra_arg= +debug=${GRUB_SHELL_DEFAULT_DEBUG:-$GRUB_TEST_DEFAULT_DEBUG} # Check the arguments. for option in "$@"; do @@ -235,7 +236,7 @@ for option in "$@"; do --no-trim) trim=0 ;; --debug) - debug=1 ;; + debug=$((debug+1)) ;; --modules=*) ms=`echo "$option" | sed -e 's/--modules=//' -e 's/,/ /g'` modules="$modules $ms" ;; @@ -320,6 +321,8 @@ for option in "$@"; do esac done +[ "${debug:-0}" -gt 1 ] && set -x + if [ "x${source}" = x ] ; then tmpfile="$work_directory/testcase.cfg" while read REPLY; do -- 2.34.1