Since we have a test to make sure that we can use Unicode points in
filesystem names, enhance it to check emoji names too.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
# Fake slash?
setf "urk\xc0\xafmoo" "FAKESLASH"
+# Emoji: octopus butterfly owl giraffe
+setf "emoji_\xf0\x9f\xa6\x91\xf0\x9f\xa6\x8b\xf0\x9f\xa6\x89\xf0\x9f\xa6\x92.txt" "octopus butterfly owl giraffe emoji"
+
ls -la $testdir >> $seqres.full
echo "Test files"
testf "urk\xc0\xafmoo" "FAKESLASH"
+testf "emoji_\xf0\x9f\xa6\x91\xf0\x9f\xa6\x8b\xf0\x9f\xa6\x89\xf0\x9f\xa6\x92.txt" "octopus butterfly owl giraffe emoji"
+
echo "Uniqueness of inodes?"
stat -c '%i' "${testdir}/"* | sort | uniq -c | while read nr inum; do
if [ "${nr}" -gt 1 ]; then
# Fake slash?
setf "urk\xc0\xafmoo" "FAKESLASH"
+# Emoji: octopus butterfly owl giraffe
+setf "emoji_\xf0\x9f\xa6\x91\xf0\x9f\xa6\x8b\xf0\x9f\xa6\x89\xf0\x9f\xa6\x92.txt" "octopus butterfly owl giraffe emoji"
+
$GETFATTR_PROG --absolute-names -d "${testfile}" >> $seqres.full
echo "Test files"
testf "urk\xc0\xafmoo" "FAKESLASH"
+testf "emoji_\xf0\x9f\xa6\x91\xf0\x9f\xa6\x8b\xf0\x9f\xa6\x89\xf0\x9f\xa6\x92.txt" "octopus butterfly owl giraffe emoji"
+
echo "Uniqueness of keys?"
crazy_keys="$($GETFATTR_PROG --absolute-names -d "${testfile}" | egrep -c '(french_|chinese_|greek_|arabic_|urk)')"
expected_keys=11