From 9c039028372138ea7e3f76439cc0ba2cb5ece250 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Wed, 4 Sep 2024 13:36:32 +0200 Subject: [PATCH] manifest: check that no ownership is set in files and dirs Make sure no ownership is set for any of the directories and files created in all the test scenarios. --- pkg/manifest/subscription_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/manifest/subscription_test.go b/pkg/manifest/subscription_test.go index a8d3a9375d..6458d40980 100644 --- a/pkg/manifest/subscription_test.go +++ b/pkg/manifest/subscription_test.go @@ -388,6 +388,17 @@ func TestSubscriptionService(t *testing.T) { assert.Equal(dirs, tc.expectedDirs) assert.Equal(files, tc.expectedFiles) assert.Equal(services, tc.expectedServices) + + // ensure no directories or files have non-nil ownership + for _, file := range files { + assert.Nil(file.User()) + assert.Nil(file.Group()) + } + + for _, dir := range dirs { + assert.Nil(dir.User()) + assert.Nil(dir.Group()) + } }) } }