summaryrefslogtreecommitdiffstats
path: root/qa/workunits/fs/snaps/snaptest-name-limits.sh
blob: f40d0231e3cbb645641aaaa92c8c4d96a530c792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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