ceph/qa/workunits/fs/snaps/snaptest-name-limits.sh
Luís Henriques 2846ec6a44 qa: new snapshot test for snapshot naming limits
Snapshot names have to be keep bellow 240 characters, otherwise the long
snapshot names (_<SNAPSHOT-NAME>_<INODE-NUMBER>) will become too big.

Add new testcase to check that the MDS limits snapshot names.

Signed-off-by: Luís Henriques <lhenriques@suse.de>
2022-03-14 10:36:28 +00:00

28 lines
351 B
Bash
Executable File

#!/bin/bash
#
# This tests snapshot names limits: names have to be < 240 chars
#
function cleanup ()
{
rmdir d1/.snap/*
rm -rf d1
}
function fail ()
{
echo $@
cleanup
exit 1
}
mkdir d1
longname=$(printf "%.241d" 2)
mkdir d1/.snap/$longname 2> /dev/null
[ -d d1/.snap/$longname ] && fail "Invalid snapshot exists: $longname"
cleanup
echo OK