tools/test/stress2/misc: Add msdosfs tests (currently failing)

Test msdos22.sh creates 1000 files with long random names consisting
of only ASCII characters. The mount is performed without -L option,
therefore no use of iconv to convert between character sets.

Test msdos23.sh mixes some non-ASCII characters into the file names.
The file system is therefore mounted with -L C.UTF-8 to include tests
of the conversions between UTF-8 and UTF-16.

Test msdos24.sh adds emojis to the names to test the (not yet
committed) support of UTF-16 surrogate pairs in filenames.

All 3 tests succeed with a small number of files (e.g., 10), but fail
most of the time when testing with 1000 files.

The tests have been added to all.exclude since they are expected to
fail. They shall be enabled as regression tests, when the msdosfs code
has been fixed.
This commit is contained in:
Stefan Eßer
2026-05-29 17:52:05 +02:00
parent f6911b941f
commit aa029088ec
4 changed files with 241 additions and 0 deletions
+3
View File
@@ -39,6 +39,9 @@ mount7.sh https://people.freebsd.org/~pho/stress/log/log0549.txt 20240912
mlockall2.sh Unrecoverable OOM killing seen 20190203
mlockall6.sh https://people.freebsd.org/~pho/stress/log/log0430.txt 20230403
mlockall7.sh Needs further investigation 20210123
msdos22.sh Waiting for fix 20260529
msdos23.sh Waiting for fix 20260529
msdos24.sh Waiting for fix 20260529
msetdomain.sh May change policy for random threads to domainset_fixed 20210104
newfs4.sh watchdog fired. newbuf (still seen 20240729) 20190225
nfs10.sh Double fault 20151013
+79
View File
@@ -0,0 +1,79 @@
#!/bin/sh
# Test file operations using long random file names consisting only of ASCII characters
MDUNIT=10
FS=/mnt
LOCALE=C.UTF-8
FILES=1000
export LANG=$LOCALE
randomfilename () {
name="f"
count=$(jot -r 1 10 3)
for r in $(jot -r $count 7 0); do
r=$(( r + 0 ))
c='_'
if [ $r -gt 0 ]; then
for i in $(jot $r); do
name="$name$i"
done
fi
count=$(( count - 1 ))
if [ "$count" -gt 0 ]; then
name="$name$c"
fi
done
echo "$name"
}
(
set -e
mdconfig -u $MDUNIT -t malloc -s 512m
newfs_msdos -c 8 -F 32 /dev/md$MDUNIT > /dev/null 2>&1
mkdir -p $FS
mount_msdosfs /dev/md$MDUNIT $FS
mkdir -p $FS/test
cd $FS/test
for i in $(jot $FILES); do
newfile=$(randomfilename)
case $testfiles in
*"$newfile"*) continue;;
esac
testfiles="$(randomfilename)
$testfiles"
done
for f in $testfiles; do
echo "$f" > $f
done
for f in $(echo "$testfiles" | sort -R); do
cp $f $f.tmp
done
for f in $(echo "$testfiles" | sort -R); do
mv $f.tmp $f
done
for f in $(echo "$testfiles" | sort -R); do
rm $f
done
)
failed=$?
cd
[ "$failed" -ne 0 ] && ls $FS/test
umount /dev/md$MDUNIT
#[ "$failed" -ne 0 ] && hd /dev/md$MDUNIT > /tmp/msdos22.dump
fsck_msdosfs -y /dev/md$MDUNIT
mdconfig -d -u $MDUNIT 2>/dev/null
exit $failed
+79
View File
@@ -0,0 +1,79 @@
#!/bin/sh
# Test file operations using random file names containing non-ASCII characters
MDUNIT=10
FS=/mnt
LOCALE=C.UTF-8
FILES=1000
export LANG=$LOCALE
randomfilename () {
name="f"
count=$(jot -r 1 10 3)
for r in $(jot -r $count 7 0); do
r=$(( r + 0 ))
c='·'
if [ $r -gt 0 ]; then
for i in $(jot $r); do
name="$name$i"
done
fi
count=$(( count - 1 ))
if [ "$count" -gt 0 ]; then
name="$name$c"
fi
done
echo "$name"
}
(
set -e
mdconfig -u $MDUNIT -t malloc -s 512m
newfs_msdos -c 8 -F 32 /dev/md$MDUNIT > /dev/null 2>&1
mkdir -p $FS
mount_msdosfs -L $LOCALE /dev/md$MDUNIT $FS
mkdir -p $FS/test
cd $FS/test
for i in $(jot $FILES); do
newfile=$(randomfilename)
case $testfiles in
*"$newfile"*) continue;;
esac
testfiles="$(randomfilename)
$testfiles"
done
for f in $testfiles; do
echo "$f" > $f
done
for f in $(echo "$testfiles" | sort -R); do
cp $f $f.tmp
done
for f in $(echo "$testfiles" | sort -R); do
mv $f.tmp $f
done
for f in $(echo "$testfiles" | sort -R); do
rm $f
done
)
failed=$?
cd
[ "$failed" -ne 0 ] && ls $FS/test
umount /dev/md$MDUNIT
#[ "$failed" -ne 0 ] && hd /dev/md$MDUNIT > /tmp/msdos23.dump
fsck_msdosfs -y /dev/md$MDUNIT
mdconfig -d -u $MDUNIT 2>/dev/null
exit $failed
+80
View File
@@ -0,0 +1,80 @@
#!/bin/sh
# Test file operations using long random file names containing UTF-16 surrogate pairs
MDUNIT=10
FS=/mnt
LOCALE=C.UTF-8
FILES=1000
export LANG=$LOCALE
randomfilename () {
name="f"
count=$(jot -r 1 10 3)
for r in $(jot -r $count 7 0); do
r=$(( r + 0 ))
emoji="\0360\0237\0230\020$r"
c=$(echo -e $emoji)
if [ $r -gt 0 ]; then
for i in $(jot $r); do
name="$name$i"
done
fi
count=$(( count - 1 ))
if [ "$count" -gt 0 ]; then
name="$name$c"
fi
done
echo "$name"
}
(
set -e
mdconfig -u $MDUNIT -t malloc -s 512m
newfs_msdos -c 8 -F 32 /dev/md$MDUNIT > /dev/null 2>&1
mkdir -p $FS
mount_msdosfs -L $LOCALE /dev/md$MDUNIT $FS
mkdir -p $FS/test
cd $FS/test
for i in $(jot $FILES); do
newfile=$(randomfilename)
case $testfiles in
*"$newfile"*) continue;;
esac
testfiles="$(randomfilename)
$testfiles"
done
for f in $testfiles; do
echo "$f" > $f
done
for f in $(echo "$testfiles" | sort -R); do
cp $f $f.tmp
done
for f in $(echo "$testfiles" | sort -R); do
mv $f.tmp $f
done
for f in $(echo "$testfiles" | sort -R); do
rm $f
done
)
failed=$?
cd
[ "$failed" -ne 0 ] && ls $FS/test
umount /dev/md$MDUNIT
#[ "$failed" -ne 0 ] && hd /dev/md$MDUNIT > /tmp/msdos24.dump
fsck_msdosfs -y /dev/md$MDUNIT
mdconfig -d -u $MDUNIT 2>/dev/null
exit $failed