summaryrefslogtreecommitdiffstats
path: root/tests/bitrot/bug-internal-xattrs-check-1243391.t
blob: bc9c12520b21bd6ab903772c6e187ebe69ec938d (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash

. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc

cleanup;

TEST glusterd
TEST pidof glusterd

## Create a distribute volume (B=2)
TEST $CLI volume create $V0 $H0:$B0/${V0}1 $H0:$B0/${V0}2;
EXPECT "$V0" volinfo_field $V0 'Volume Name';
EXPECT 'Created' volinfo_field $V0 'Status';
EXPECT '2' brick_count $V0


## Start the volume
TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';

## Mount the volume
TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0;

echo "123" >> $M0/file;

TEST ! setfattr -n "trusted.glusterfs.set-signature" -v "123" $M0/file;
TEST ! setfattr -n "trusted.glusterfs.get-signature" -v "123" $M0/file;

# sign xattr
TEST ! setfattr -n "trusted.bit-rot.signature" -v "123" $M0/file;
TEST ! setfattr -x "trusted.bit-rot.signature" $M0/file;

# versioning xattr
TEST ! setfattr -n "trusted.bit-rot.version" -v "123" $M0/file;
TEST ! setfattr -x "trusted.bit-rot.version" $M0/file;

# bad file xattr
TEST ! setfattr -n "trusted.bit-rot.bad-file" -v "123" $M0/file;
TEST ! setfattr -x "trusted.bit-rot.bad-file" $M0/file;

cleanup;