From owner-svn-src-head@freebsd.org Mon Sep 14 08:51:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C30E13F746F; Mon, 14 Sep 2020 08:51:18 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bqg7p4qstz4Qc6; Mon, 14 Sep 2020 08:51:18 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 893B414640; Mon, 14 Sep 2020 08:51:18 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08E8pINS073514; Mon, 14 Sep 2020 08:51:18 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08E8pICq073513; Mon, 14 Sep 2020 08:51:18 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009140851.08E8pICq073513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 14 Sep 2020 08:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365708 - head/sbin/pfctl/tests X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sbin/pfctl/tests X-SVN-Commit-Revision: 365708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 08:51:18 -0000 Author: arichardson Date: Mon Sep 14 08:51:18 2020 New Revision: 365708 URL: https://svnweb.freebsd.org/changeset/base/365708 Log: pfctl_test: avoid 200 calls to atf_get_srcdir I have been trying to reduce the time that testsuite runs take for CheriBSD on QEMU (currently about 22 hours). One of the slowest tests is pfctl_test: Just listing the available test cases currently takes 98 seconds on a CheriBSD RISC-V system due to all the processes being spawned. This trivial patch reduces the time to 92 seconds. The better solution would be to rewrite the test in C/C++ which I may do as a follow-up change. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D26417 Modified: head/sbin/pfctl/tests/pfctl_test.sh Modified: head/sbin/pfctl/tests/pfctl_test.sh ============================================================================== --- head/sbin/pfctl/tests/pfctl_test.sh Mon Sep 14 06:26:36 2020 (r365707) +++ head/sbin/pfctl/tests/pfctl_test.sh Mon Sep 14 08:51:18 2020 (r365708) @@ -24,21 +24,22 @@ pftests="0001 0002 0003 0004 0005 0006 0007 0008 0009 0079 0081 0082 0084 0085 0087 0088 0089 0090 0091 0092 0094 0095 0096 0097 0098 0100 0101 0102 0104 1001 1002 1003 1004 1005" -. $(atf_get_srcdir)/files/pfctl_test_descr.sh +atf_srcdir=$(atf_get_srcdir) +. "${atf_srcdir}/files/pfctl_test_descr.sh" for i in ${pftests} ; do atf_test_case "pf${i}" eval "pf${i}_head () { atf_set descr \"$(pf${i}_descr)\" ; }" eval "pf${i}_body () { \ kldstat -m pf || atf_skip \"pf(4) is not loaded\" && \ - cd $(atf_get_srcdir)/files && \ + cd ${atf_srcdir}/files && \ atf_check -o file:pf${i}.ok \ pfctl -o none -nvf - < pf${i}.in ; }" atf_test_case "selfpf${i}" eval "selfpf${i}_head () { atf_set descr \"self$(pf${i}_descr)\" ; }" eval "selfpf${i}_body () { \ - cd $(atf_get_srcdir)/files && \ + cd ${atf_srcdir}/files && \ atf_check -o file:pf${i}.ok \ pfctl -o none -nvf - < pf${i}.ok ; }" done