From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyf6k-0007JC-Lh for kexec@lists.infradead.org; Thu, 23 Jul 2020 17:34:16 +0000 Received: by mail-pf1-x441.google.com with SMTP id a24so3342483pfc.10 for ; Thu, 23 Jul 2020 10:34:14 -0700 (PDT) Subject: Re: [PATCH v2 02/18] selftest/firmware: Add selftest timeout in settings References: <20200722193020.2676422-1-keescook@chromium.org> <20200722193020.2676422-3-keescook@chromium.org> From: Scott Branden Message-ID: <577f52ba-a514-558d-7041-e65ea9974917@broadcom.com> Date: Thu, 23 Jul 2020 10:34:06 -0700 MIME-Version: 1.0 In-Reply-To: <20200722193020.2676422-3-keescook@chromium.org> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Kees Cook , Greg Kroah-Hartman Cc: linux-efi@vger.kernel.org, "Rafael J. Wysocki" , Peter Zijlstra , linux-fsdevel@vger.kernel.org, Stephen Boyd , SeongJae Park , Mimi Zohar , David Howells , Tushar Sugandhi , Peter Jones , linux-kselftest@vger.kernel.org, "Joel Fernandes (Google)" , Shuah Khan , Ard Biesheuvel , Thomas Cedeno , linux-security-module@vger.kernel.org, Anders Roxell , Paul Moore , Mauro Carvalho Chehab , Michael Ellerman , Nayna Jain , Matthew Garrett , James Morris , Lakshmi Ramasubramanian , Aaron Goidel , "Serge E. Hallyn" , Wenwen Wang , selinux@vger.kernel.org, Hans de Goede , Alexander Viro , Matthieu Baerts , KP Singh , Eric Paris , linux-integrity@vger.kernel.org, Florent Revest , Andrea Righi , Dmitry Kasatkin , Stephen Smalley , Randy Dunlap , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Luis Chamberlain , Eric Biederman , Dave Olsthoorn , Jessica Yu , Casey Schaufler , Joe Perches , Andrew Morton , Thiago Jung Bauermann works. On 2020-07-22 12:30 p.m., Kees Cook wrote: > The firmware tests would always time out for me. Add a correct timeout, > including details on how the value was reached. Additionally allow the > test harness to skip comments in settings files and report how long a > given timeout was. > > Signed-off-by: Kees Cook Acked-by: Scott Branden > --- > tools/testing/selftests/firmware/settings | 8 ++++++++ > tools/testing/selftests/kselftest/runner.sh | 6 +++++- > 2 files changed, 13 insertions(+), 1 deletion(-) > create mode 100644 tools/testing/selftests/firmware/settings > > diff --git a/tools/testing/selftests/firmware/settings b/tools/testing/selftests/firmware/settings > new file mode 100644 > index 000000000000..085e664ee093 > --- /dev/null > +++ b/tools/testing/selftests/firmware/settings > @@ -0,0 +1,8 @@ > +# The async firmware timeout is set to 1 second (but ends up being effectively > +# 2 seconds). There are 3 test configs, each done with and without firmware > +# present, each with 2 "nowait" functions tested 5 times. Expected time for a > +# normal execution should be 2 * 3 * 2 * 2 * 5 = 120 seconds for those alone. > +# Additionally, fw_fallback may take 5 seconds for internal timeouts in each > +# of the 3 configs, so at least another 15 seconds are needed. Add another > +# 10 seconds for each testing config: 120 + 15 + 30 > +timeout=165 > diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh > index 676b3a8b114d..cd5ddf979f15 100644 > --- a/tools/testing/selftests/kselftest/runner.sh > +++ b/tools/testing/selftests/kselftest/runner.sh > @@ -53,6 +53,10 @@ run_one() > settings="$BASE_DIR/$DIR/settings" > if [ -r "$settings" ] ; then > while read line ; do > + # Skip comments. > + if echo "$line" | grep -q '^#'; then > + continue > + fi > field=$(echo "$line" | cut -d= -f1) > value=$(echo "$line" | cut -d= -f2-) > eval "kselftest_$field"="$value" > @@ -80,7 +84,7 @@ run_one() > echo "not ok $test_num $TEST_HDR_MSG # SKIP" > elif [ $rc -eq $timeout_rc ]; then \ > echo "#" > - echo "not ok $test_num $TEST_HDR_MSG # TIMEOUT" > + echo "not ok $test_num $TEST_HDR_MSG # TIMEOUT $kselftest_timeout seconds" > else > echo "not ok $test_num $TEST_HDR_MSG # exit=$rc" > fi) _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec