Author: asomers
Date: Fri Dec  7 00:27:38 2018
New Revision: 341667
URL: https://svnweb.freebsd.org/changeset/base/341667

Log:
  geom tests: Fix cleanup of ATF tests since r341392
  
  r341392 changed common test cleanup routines in a way that allowed them to
  be used by TAP tests as well as ATF tests.  However, a late change made
  during code review resulted in cleanup being broken for ATF tests, which
  source geom_subr.sh separately during the body and cleanup phases of the
  test.  The result was that md(4) devices wouldn't get cleaned up.
  
  MFC after:    2 weeks
  X-MFC-With:   341392

Modified:
  head/tests/sys/geom/class/eli/conf.sh
  head/tests/sys/geom/class/geom_subr.sh

Modified: head/tests/sys/geom/class/eli/conf.sh
==============================================================================
--- head/tests/sys/geom/class/eli/conf.sh       Fri Dec  7 00:00:12 2018        
(r341666)
+++ head/tests/sys/geom/class/eli/conf.sh       Fri Dec  7 00:27:38 2018        
(r341667)
@@ -4,7 +4,6 @@
 class="eli"
 base=$(atf_get ident)
 MAX_SECSIZE=8192
-TEST_MDS_FILE=md.devs
 
 attach_md()
 {

Modified: head/tests/sys/geom/class/geom_subr.sh
==============================================================================
--- head/tests/sys/geom/class/geom_subr.sh      Fri Dec  7 00:00:12 2018        
(r341666)
+++ head/tests/sys/geom/class/geom_subr.sh      Fri Dec  7 00:27:38 2018        
(r341667)
@@ -1,8 +1,7 @@
 #!/bin/sh
 # $FreeBSD$
 
-# NOTE: existence is sanity-checked in 
`geom_verify_temp_mds_file_existence(..)`
-TEST_MDS_FILE="$(mktemp test_mds.${0##*/}.XXXXXXXX)"
+TEST_MDS_FILE="${TMPDIR}/test_mds.$(basename $0)"
 
 devwait()
 {
@@ -47,14 +46,6 @@ geom_test_cleanup()
        fi
 }
 
-geom_verify_temp_mds_file_existence()
-{
-       if [ ! -f $TEST_MDS_FILE ]; then
-               echo "test md(4) devices file creation unsuccessful"
-               return 1
-       fi
-}
-
 geom_load_class_if_needed()
 {
        local class=$1
@@ -71,9 +62,6 @@ geom_load_class_if_needed()
 
 geom_atf_test_setup()
 {
-       if ! error_message=$(geom_verify_temp_mds_file_existence); then
-               atf_skip "$error_message"
-       fi
        if ! error_message=$(geom_load_class_if_needed $class); then
                atf_skip "$error_message"
        fi
@@ -81,10 +69,6 @@ geom_atf_test_setup()
 
 geom_tap_test_setup()
 {
-       if ! error_message=$(geom_verify_temp_mds_file_existence); then
-               echo "1..0 # SKIP $error_message"
-               exit 1
-       fi
        if ! error_message=$(geom_load_class_if_needed $class); then
                echo "1..0 # SKIP $error_message"
                exit 0
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to