forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testing checking copying of many small files
Issue openzfs#7401 identified data loss when many small files are being copied. Add a test to check for this condition. Signed-off-by: Antonio Russo <[email protected]>
- Loading branch information
Showing
8 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ SUBDIRS = \ | |
cli_root \ | ||
cli_user \ | ||
compression \ | ||
cp_many_files \ | ||
ctime \ | ||
deadman \ | ||
delegate \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cp_many_files | ||
|
||
dist_pkgdata_SCRIPTS = \ | ||
cleanup.ksh \ | ||
setup.ksh \ | ||
cp_001.ksh | ||
|
||
dist_pkgdata_DATA = \ | ||
cp_many_files.cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/ksh -p | ||
|
||
source "${STF_SUITE}/include/libtest.shlib" | ||
|
||
default_container_cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/ksh -p | ||
|
||
source "${STF_SUITE}/include/libtest.shlib" | ||
source "${STF_SUITE}/tests/functional/cp_many_files/cp_many_files.cfg" | ||
|
||
log_assert "Check that copying many small files is safe" | ||
|
||
log_must mkdir $TESTDIR/SRC | ||
|
||
for i in $(seq 1 ${CP_FILE_COUNT}) ; do | ||
echo $i > $TESTDIR/SRC | ||
done | ||
|
||
log_note "Ensure we produced the correct number of files" | ||
log_must [[ $(find SRC -type f|wc -l) -eq ${CP_FILE_COUNT} ]] | ||
|
||
log_note "Ensure we copy the files" | ||
log_must cp -r $TESTDIR/SRC $TESTDIR/DST | ||
|
||
if [[ $(find DST -type f|wc -l) -eq ${CP_FILE_COUNT} ]] ; then | ||
log_pass "Copied all ${CP_FILE_COUNT} files" | ||
else | ||
log_fail "$(find SRC -type f|wc -l) is not ${CP_FILE_COUNT}" | ||
fi |
1 change: 1 addition & 0 deletions
1
tests/zfs-tests/tests/functional/cp_many_files/cp_many_files.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export CP_FILE_COUNT=300000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/ksh -p | ||
|
||
source "${STF_SUITE}/include/libtest.shlib" | ||
|
||
default_container_setup ${DISKS%% *} |