From 2828a9c2b09a7e42ca8ca1c6ac506f87280c158b Mon Sep 17 00:00:00 2001 From: Pauline Middelink Date: Thu, 27 Feb 2020 11:21:01 +0100 Subject: [PATCH] Fix running tests on a SELinux enabled system Archivers TestMetadataChanged incorrectly clears the Extended Attributes from the expected metadata of the temporary file. This is incorrect as on SELinux enabled filesystem, as the kernel will automaticly add a SElinux label. However, since ExtendedAttributes{} != ExtendedAttributes{nil} we still need to clear them if there are no attributes found. --- internal/archiver/archiver_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/archiver/archiver_test.go b/internal/archiver/archiver_test.go index 40514500a..34bf94824 100644 --- a/internal/archiver/archiver_test.go +++ b/internal/archiver/archiver_test.go @@ -2071,7 +2071,9 @@ func TestMetadataChanged(t *testing.T) { // set some values so we can then compare the nodes want.Content = node2.Content want.Path = "" - want.ExtendedAttributes = nil + if len(want.ExtendedAttributes) == 0 { + want.ExtendedAttributes = nil + } want.AccessTime = want.ModTime