Skip to content

Commit

Permalink
Add user xattr to test TestTarUntarWithXattr
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Rodak <[email protected]>
  • Loading branch information
Honny1 committed Jun 26, 2024
1 parent 8229768 commit 0246ea4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/archive/archive_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ func TestTarUntarWithXattr(t *testing.T) {
encoded := [20]byte{0, 0, 0, 2}
err = system.Lsetxattr(filepath.Join(origin, "2"), "security.capability", encoded[:], 0)
require.NoError(t, err)
err = system.Lsetxattr(filepath.Join(origin, "1"), "user.test", []byte("helloWord"), 0)
require.NoError(t, err)

for _, c := range []Compression{
Uncompressed,
Expand All @@ -252,5 +254,9 @@ func TestTarUntarWithXattr(t *testing.T) {
if capability == nil && capability[0] != 0x00 {
t.Fatalf("Untar should have kept the 'security.capability' xattr.")
}
test, _ := system.Lgetxattr(filepath.Join(origin, "1"), "user.test")
if test == nil {
t.Fatalf("Untar should have kept the 'user.test' xattr.")
}
}
}

0 comments on commit 0246ea4

Please sign in to comment.