Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Sep 2020 08:51:18 +0000 (UTC)
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365708 - head/sbin/pfctl/tests
Message-ID:  <202009140851.08E8pICq073513@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009140851.08E8pICq073513>