fstests: replace chattr with $CHATTR_PROG
PATCH 1/1 fstests: replace chattr with $CHATTR_PROG
We have a wrapper around chattr to make sure people don't do the wrong thing on their boxes, so we need to be able to specify CHATTR_PROG and have it actually work, so replace all chattr calls with $CHATTR_PROG.
Signed-off-by Josef Bacik <[email protected]>
--- tests/btrfs/024 | 2 +- tests/btrfs/059 | 4 ++-- tests/ext4/006 | 2 +- tests/ext4/007 | 2 +- tests/ext4/013 | 2 +- tests/ext4/014 | 2 +- tests/ext4/271 | 2 +- tests/generic/277 | 4 ++-- tests/shared/272 | 4 ++-- tests/xfs/083 | 2 +- tests/xfs/085 | 2 +- tests/xfs/086 | 4 ++-- tests/xfs/087 | 2 +- tests/xfs/088 | 4 ++-- tests/xfs/089 | 4 ++-- tests/xfs/091 | 4 ++-- tests/xfs/093 | 2 +- tests/xfs/097 | 2 +- tests/xfs/098 | 2 +- tests/xfs/099 | 2 +- tests/xfs/100 | 2 +- tests/xfs/101 | 2 +- tests/xfs/102 | 2 +- tests/xfs/105 | 2 +- tests/xfs/112 | 2 +- tests/xfs/113 | 2 +- tests/xfs/117 | 2 +- tests/xfs/120 | 2 +- tests/xfs/124 | 2 +- tests/xfs/125 | 2 +- tests/xfs/126 | 2 +- tests/xfs/130 | 2 +- tests/xfs/195 | 2 +- tests/xfs/235 | 2 +- 34 files changed, 41 insertions(+), 41 deletions(-)
tests/btrfs/024 +1 -1
@@ -54,7 +54,7 @@ __workout() work_file="$SCRATCH_MNT/tmpfile" touch $work_file - chattr =c $work_file + $CHATTR_PROG =c $work_file $XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $work_file | _filter_xfs_io }
tests/btrfs/059 +2 -2
@@ -59,7 +59,7 @@ _scratch_mount mkdir $SCRATCH_MNT/testdir echo "Setting compression flag in the directory..." -chattr +c $SCRATCH_MNT/testdir +$CHATTR_PROG +c $SCRATCH_MNT/testdir echo "Directory compression property value:" $BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir compression
@@ -68,7 +68,7 @@ echo "file1 compression property value:" $BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir/file1 compression echo "Clearing compression flag from directory..." -chattr -c $SCRATCH_MNT/testdir +$CHATTR_PROG -c $SCRATCH_MNT/testdir echo "Directory compression property value:" $BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir compression
tests/ext4/006 +1 -1
@@ -135,7 +135,7 @@ echo "++ mount image (2)" >> $ROUND2_LOG _scratch_mount >> $ROUND2_LOG 2>&1 echo "++ chattr -R -i" >> $ROUND2_LOG -chattr -R -f -i "${SCRATCH_MNT}/" > /dev/null 2>> $ROUND2_LOG +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" > /dev/null 2>> $ROUND2_LOG echo "++ test scratch" >> $ROUND2_LOG _scratch_fuzz_test >> $ROUND2_LOG 2>&1
tests/ext4/007 +1 -1
@@ -101,7 +101,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" broken=0
tests/ext4/013 +1 -1
@@ -105,7 +105,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" broken=0
tests/ext4/014 +1 -1
@@ -103,7 +103,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" broken=0
tests/ext4/271 +1 -1
@@ -47,7 +47,7 @@ _scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 # metadata sync writes inside ext4_handle_dirty_metadata() _scratch_mount -onoload touch $SCRATCH_MNT/file -chattr +S $SCRATCH_MNT/file +$CHATTR_PROG +S $SCRATCH_MNT/file # Create sparse file for ((i = 0; i < 21; i++)) do
tests/generic/277 +2 -2
@@ -54,8 +54,8 @@ _scratch_cycle_mount ctime1=`stat -c %z $SCRATCH_MNT/tmp` sleep 1 -chattr +A $SCRATCH_MNT/tmp -chattr -A $SCRATCH_MNT/tmp +$CHATTR_PROG +A $SCRATCH_MNT/tmp +$CHATTR_PROG -A $SCRATCH_MNT/tmp ctime2=`stat -c %z $SCRATCH_MNT/tmp` _scratch_cycle_mount
tests/shared/272 +2 -2
@@ -56,7 +56,7 @@ chattr_opt: $chattr_opt" >>$seqres.full dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \ bs=1M count=4 $write_opt \ >> $seqres.full 2>&1 || exit - chattr $chattr_opt $SCRATCH_MNT/file.$idx >> $seqres.full \ + $CHATTR_PROG $chattr_opt $SCRATCH_MNT/file.$idx >> $seqres.full \ || exit done done
@@ -73,7 +73,7 @@ chattr_opt: $chattr_opt" >>$seqres.full chattr_opt: $chattr_opt" >>$seqres.full dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \ bs=1M $write_opt >> $seqres.full 2>&1 - chattr $chattr_opt $SCRATCH_MNT/file.$idx \ + $CHATTR_PROG $chattr_opt $SCRATCH_MNT/file.$idx \ >> $seqres.full || exit done sync
tests/xfs/083 +1 -1
@@ -148,7 +148,7 @@ echo "++ mount image (2)" >> $ROUND2_LOG _scratch_mount >> $ROUND2_LOG 2>&1 echo "++ chattr -R -i" >> $ROUND2_LOG -chattr -R -f -i "${SCRATCH_MNT}/" > /dev/null 2>> $ROUND2_LOG +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" > /dev/null 2>> $ROUND2_LOG echo "+++ test scratch" >> $ROUND2_LOG _scratch_fuzz_test >> $ROUND2_LOG 2>&1
tests/xfs/085 +1 -1
@@ -96,7 +96,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" broken=0
tests/xfs/086 +2 -2
@@ -107,7 +107,7 @@ echo "+ mount image" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ check files" broken=0
@@ -130,7 +130,7 @@ echo "+ mount image" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ check files (2)" broken=0
tests/xfs/087 +1 -1
@@ -107,7 +107,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" broken=0
tests/xfs/088 +2 -2
@@ -106,7 +106,7 @@ echo "+ mount image" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ check files" broken=0
@@ -129,7 +129,7 @@ echo "+ mount image" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ check files (2)" broken=0
tests/xfs/089 +2 -2
@@ -106,7 +106,7 @@ echo "+ mount image" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ check files" ls -la "${TESTDIR}" >> $seqres.full
@@ -130,7 +130,7 @@ echo "+ mount image" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ check files (2)" broken=0
tests/xfs/091 +2 -2
@@ -106,7 +106,7 @@ echo "+ mount image" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ check files" ls -la "${TESTDIR}" >> $seqres.full
@@ -130,7 +130,7 @@ echo "+ mount image" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ check files (2)" broken=0
tests/xfs/093 +1 -1
@@ -107,7 +107,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" broken=0
tests/xfs/097 +1 -1
@@ -110,7 +110,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" broken=0
tests/xfs/098 +1 -1
@@ -99,7 +99,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" broken=0
tests/xfs/099 +1 -1
@@ -96,7 +96,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify dir (2)" mkdir -p "${SCRATCH_MNT}/blockdir"
tests/xfs/100 +1 -1
@@ -101,7 +101,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify dir (2)" mkdir -p "${SCRATCH_MNT}/blockdir"
tests/xfs/101 +1 -1
@@ -96,7 +96,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify dir (2)" mkdir -p "${SCRATCH_MNT}/blockdir"
tests/xfs/102 +1 -1
@@ -101,7 +101,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify dir (2)" mkdir -p "${SCRATCH_MNT}/blockdir"
tests/xfs/105 +1 -1
@@ -101,7 +101,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify dir (2)" mkdir -p "${SCRATCH_MNT}/blockdir"
tests/xfs/112 +1 -1
@@ -105,7 +105,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify dir (2)" mkdir -p "${SCRATCH_MNT}/blockdir"
tests/xfs/113 +1 -1
@@ -101,7 +101,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify dir (2)" mkdir -p "${SCRATCH_MNT}/blockdir"
tests/xfs/117 +1 -1
@@ -109,7 +109,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" broken=0
tests/xfs/120 +1 -1
@@ -94,7 +94,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify files (2)" touch "${SCRATCH_MNT}/bigfile"
tests/xfs/124 +1 -1
@@ -100,7 +100,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify xattr (2)" getfattr "${SCRATCH_MNT}/attrfile" -n "user.x00000000" > /dev/null 2>&1 && (setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" || _fail "remove corrupt xattr")
tests/xfs/125 +1 -1
@@ -100,7 +100,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify xattr (2)" setfattr -n "user.x00000000" -v "1111111111111111" "${SCRATCH_MNT}/attrfile" || _fail "modified corrupt xattr"
tests/xfs/126 +1 -1
@@ -105,7 +105,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ modify xattr (2)" getfattr "${SCRATCH_MNT}/attrfile" -n "user.x00000000" 2> /dev/null && (setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" || _fail "modified corrupt xattr")
tests/xfs/130 +1 -1
@@ -94,7 +94,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i "${SCRATCH_MNT}/" +$CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" echo "+ reflink more (2)" _cp_reflink "${SCRATCH_MNT}/file1" "${SCRATCH_MNT}/file5" || \
tests/xfs/195 +1 -1
@@ -76,7 +76,7 @@ echo "No dump exclude flag set (should not be skipped)" _do_dump echo "Dump exclude flag set, but no sync yet (should be skipped)" -chattr +d $TEST_DIR/d/t +$CHATTR_PROG +d $TEST_DIR/d/t _do_dump echo "Dump exclude flag set, after sync (should be skipped)"
tests/xfs/235 +1 -1
@@ -93,7 +93,7 @@ echo "+ mount image (2)" _scratch_mount echo "+ chattr -R -i" -chattr -R -f -i ${SCRATCH_MNT}/ +$CHATTR_PROG -R -f -i ${SCRATCH_MNT}/ echo "+ copy more (2)" cp -p ${SCRATCH_MNT}/file1 ${SCRATCH_MNT}/file5 || \
Signature · 1 line
2.8.0.rc2
Quoted 3 lines · Josef Bacik
We have a wrapper around chattr to make sure people don't do the wrong thing on their boxes, so we need to be able to specify
CHATTR_PROGand have it actually work, so replace all chattr calls with $CHATTR_PROG.
Looks good to me overall, but it doesn't apply because of this commit
26ae452 btrfs/059: add a filter for btrfs compression property
Thanks,
Eryu