mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
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.
This commit is contained in:
parent
58bd165253
commit
2828a9c2b0
@ -2071,7 +2071,9 @@ func TestMetadataChanged(t *testing.T) {
|
|||||||
// set some values so we can then compare the nodes
|
// set some values so we can then compare the nodes
|
||||||
want.Content = node2.Content
|
want.Content = node2.Content
|
||||||
want.Path = ""
|
want.Path = ""
|
||||||
want.ExtendedAttributes = nil
|
if len(want.ExtendedAttributes) == 0 {
|
||||||
|
want.ExtendedAttributes = nil
|
||||||
|
}
|
||||||
|
|
||||||
want.AccessTime = want.ModTime
|
want.AccessTime = want.ModTime
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user