2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58:55 +00:00

dump: Additional ACL tests

This commit is contained in:
Michael Eischer 2020-10-24 18:26:30 +02:00
parent 31b8d7a639
commit e21dcb0eea

View File

@ -21,6 +21,13 @@ func Test_acl_decode(t *testing.T) {
},
want: "user::rw-\nuser:0:rwx\nuser:65534:rwx\ngroup::rwx\nmask::rwx\nother::r--\n",
},
{
name: "decode group",
args: args{
xattr: []byte{2, 0, 0, 0, 8, 0, 1, 0, 254, 255, 0, 0},
},
want: "group:65534:--x\n",
},
{
name: "decode fail",
args: args{
@ -28,6 +35,13 @@ func Test_acl_decode(t *testing.T) {
},
want: "",
},
{
name: "decode empty fail",
args: args{
xattr: []byte(""),
},
want: "",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -36,6 +50,10 @@ func Test_acl_decode(t *testing.T) {
if tt.want != a.String() {
t.Errorf("acl.decode() = %v, want: %v", a.String(), tt.want)
}
a.decode(tt.args.xattr)
if tt.want != a.String() {
t.Errorf("second acl.decode() = %v, want: %v", a.String(), tt.want)
}
})
}
}