From 0246ea47e2d8f3a58c3f4e4ad87802f701901938 Mon Sep 17 00:00:00 2001 From: Jan Rodak Date: Wed, 26 Jun 2024 12:14:14 +0200 Subject: [PATCH] Add user xattr to test TestTarUntarWithXattr Signed-off-by: Jan Rodak --- pkg/archive/archive_unix_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/archive/archive_unix_test.go b/pkg/archive/archive_unix_test.go index 79c57fa5db..7de64efcee 100644 --- a/pkg/archive/archive_unix_test.go +++ b/pkg/archive/archive_unix_test.go @@ -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, @@ -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.") + } } }