Author: kp
Date: Thu Apr 18 10:54:08 2019
New Revision: 346347
URL: https://svnweb.freebsd.org/changeset/base/346347

Log:
  pf tests: Fail the test if we can't set the rules
  
  The test should fail if pf rules can't be set. This is helpful both
  while writing tests and to verify that pfctl works as expected.
  
  MFC after:    1 week
  Event:                Aberdeen hackathon 2019

Modified:
  head/tests/sys/netpfil/pf/utils.subr

Modified: head/tests/sys/netpfil/pf/utils.subr
==============================================================================
--- head/tests/sys/netpfil/pf/utils.subr        Thu Apr 18 05:40:50 2019        
(r346346)
+++ head/tests/sys/netpfil/pf/utils.subr        Thu Apr 18 10:54:08 2019        
(r346347)
@@ -40,6 +40,10 @@ pft_set_rules()
                printf "$1\n"
                shift
        done | jexec ${jname} pfctl -f -
+       if [ $? -ne 0 ];
+       then
+               atf_fail "Failed to set PF rules in ${jname}"
+       fi
 }
 
 pft_cleanup()
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to