Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163376688
D54428.id168790.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D54428.id168790.diff
View Options
diff --git a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh
--- a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh
+++ b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh
@@ -61,21 +61,24 @@
atf_test_case D_flag
D_flag_body()
{
- atf_skip "makefs crashes with SIGBUS with dupe mtree entries; see FreeBSD bug # 192839"
-
create_test_inputs
- mtree -cp $TEST_INPUTS_DIR > $TEST_SPEC_FILE
- atf_check -e empty -o not-empty -s exit:0 \
- $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR
+ create_manifest_file
- cp $TEST_SPEC_FILE spec2.mtree
- cat $TEST_SPEC_FILE spec2.mtree > ${TEST_SPEC_FILE}_dupe
+ # Check that it works
+ atf_check -e empty -o empty -s exit:0 \
+ $MAKEFS -M 1m $TEST_IMAGE $TEST_SPEC_FILE
- atf_check -e empty -o not-empty -s not-exit:0 \
- $MAKEFS -F ${TEST_SPEC_FILE}_dupe -M 1m $TEST_IMAGE $TEST_INPUTS_DIR
- atf_check -e empty -o not-empty -s exit:0 \
- $MAKEFS -D -F ${TEST_SPEC_FILE}_dupe -M 1m $TEST_IMAGE $TEST_INPUTS_DIR
+ # Duplicate entries in the manifest file
+ cp $TEST_SPEC_FILE spec2.mtree
+ cat $TEST_SPEC_FILE spec2.mtree | sort > "${TEST_SPEC_FILE}_dupe"
+
+ # Check that it errors
+ atf_check -e not-empty -o empty -s not-exit:0 \
+ $MAKEFS -M 1m $TEST_IMAGE ${TEST_SPEC_FILE}_dupe
+ # Check that it warns
+ atf_check -e not-empty -o empty -s exit:0 \
+ $MAKEFS -D -M 1m $TEST_IMAGE ${TEST_SPEC_FILE}_dupe
}
atf_test_case F_flag cleanup
diff --git a/usr.sbin/makefs/tests/makefs_ffs_tests.sh b/usr.sbin/makefs/tests/makefs_ffs_tests.sh
--- a/usr.sbin/makefs/tests/makefs_ffs_tests.sh
+++ b/usr.sbin/makefs/tests/makefs_ffs_tests.sh
@@ -74,21 +74,24 @@
atf_test_case D_flag
D_flag_body()
{
- atf_skip "makefs crashes with SIGBUS with dupe mtree entries; see FreeBSD bug # 192839"
-
create_test_inputs
- mtree -cp $TEST_INPUTS_DIR > $TEST_SPEC_FILE
+ create_manifest_file
+
+ # Check that it works
atf_check -e empty -o not-empty -s exit:0 \
- $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR
+ $MAKEFS -M 1m $TEST_IMAGE $TEST_SPEC_FILE
+ # Duplicate entries in the manifest file
cp $TEST_SPEC_FILE spec2.mtree
- cat $TEST_SPEC_FILE spec2.mtree > ${TEST_SPEC_FILE}_dupe
-
- atf_check -e empty -o not-empty -s not-exit:0 \
- $MAKEFS -F ${TEST_SPEC_FILE}_dupe -M 1m $TEST_IMAGE $TEST_INPUTS_DIR
- atf_check -e empty -o not-empty -s exit:0 \
- $MAKEFS -D -F ${TEST_SPEC_FILE}_dupe -M 1m $TEST_IMAGE $TEST_INPUTS_DIR
+ cat $TEST_SPEC_FILE spec2.mtree | sort > "${TEST_SPEC_FILE}_dupe"
+
+ # Check that it errors
+ atf_check -e not-empty -o empty -s not-exit:0 \
+ $MAKEFS -M 1m $TEST_IMAGE ${TEST_SPEC_FILE}_dupe
+ # Check that it warns
+ atf_check -e not-empty -o not-empty -s exit:0 \
+ $MAKEFS -D -M 1m $TEST_IMAGE ${TEST_SPEC_FILE}_dupe
}
atf_test_case F_flag cleanup
diff --git a/usr.sbin/makefs/tests/makefs_tests_common.sh b/usr.sbin/makefs/tests/makefs_tests_common.sh
--- a/usr.sbin/makefs/tests/makefs_tests_common.sh
+++ b/usr.sbin/makefs/tests/makefs_tests_common.sh
@@ -81,6 +81,14 @@
$mtree_excludes_arg
}
+create_manifest_file()
+{
+ # Prefer a specification format that is easier to parse (-C)
+ mtree -k "$DEFAULT_MTREE_KEYWORDS" -cp "$TEST_INPUTS_DIR" | \
+ mtree -C > "$TEST_SPEC_FILE"
+ sed -i "" "s|^\.|.${TEST_INPUTS_DIR##$TMPDIR}|g" "$TEST_SPEC_FILE"
+}
+
create_test_dirs()
{
mkdir -m 0777 -p $TEST_MOUNT_DIR
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 3:58 PM (11 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35407337
Default Alt Text
D54428.id168790.diff (3 KB)
Attached To
Mode
D54428: makefs: tests: Fix -D flag test
Attached
Detach File
Event Timeline
Log In to Comment