diff options
Diffstat (limited to 'qa/workunits/fs/snaps/snaptest-name-limits.sh')
-rwxr-xr-x | qa/workunits/fs/snaps/snaptest-name-limits.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/qa/workunits/fs/snaps/snaptest-name-limits.sh b/qa/workunits/fs/snaps/snaptest-name-limits.sh new file mode 100755 index 000000000..f40d0231e --- /dev/null +++ b/qa/workunits/fs/snaps/snaptest-name-limits.sh @@ -0,0 +1,27 @@ +#!/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 |