Blame tests/basic/hardlink-limit.t
|
Packit Service |
e080da |
#!/bin/bash
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
. $(dirname $0)/../include.rc
|
|
Packit Service |
e080da |
. $(dirname $0)/../volume.rc
|
|
Packit Service |
e080da |
. $(dirname $0)/../dht.rc
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
cleanup;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST glusterd
|
|
Packit Service |
e080da |
TEST pidof glusterd
|
|
Packit Service |
e080da |
TEST $CLI volume info;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1,2,3,4,5,6};
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
EXPECT "$V0" volinfo_field $V0 'Volume Name';
|
|
Packit Service |
e080da |
EXPECT 'Created' volinfo_field $V0 'Status';
|
|
Packit Service |
e080da |
EXPECT '6' brick_count $V0
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI volume start $V0;
|
|
Packit Service |
e080da |
EXPECT 'Started' volinfo_field $V0 'Status';
|
|
Packit Service |
e080da |
TEST $CLI volume set $V0 storage.max-hardlinks 3
|
|
Packit Service |
e080da |
TEST glusterfs -s $H0 --volfile-id $V0 $M0;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST dd if=/dev/zero of=$M0/testfile count=1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# max-hardlinks is 3, should be able to create 2 links.
|
|
Packit Service |
e080da |
TEST link $M0/testfile $M0/testfile.link1
|
|
Packit Service |
e080da |
TEST link $M0/testfile $M0/testfile.link2
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# But not 3.
|
|
Packit Service |
e080da |
TEST ! link $M0/testfile $M0/testfile.link3
|
|
Packit Service |
e080da |
# If we remove one...
|
|
Packit Service |
e080da |
TEST rm $M0/testfile.link1
|
|
Packit Service |
e080da |
# Now we can add one.
|
|
Packit Service |
e080da |
TEST link $M0/testfile $M0/testfile.link3
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# But not another
|
|
Packit Service |
e080da |
TEST ! link $M0/testfile $M0/testfile.link4
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Unless we disable the limit...
|
|
Packit Service |
e080da |
TEST $CLI volume set $V0 storage.max-hardlinks 0
|
|
Packit Service |
e080da |
TEST link $M0/testfile $M0/testfile.link4
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
cleanup;
|