Skip to content

Commit

Permalink
test: fix tests after changes in MacOS packaging (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzej-stencel authored Aug 29, 2023
1 parent 35ff990 commit af84a3b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 0 additions & 6 deletions pkg/scripts_test/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,8 @@ func checkRun(c check) {
require.Equal(c.test, c.expectedInstallCode, c.code, "unexpected installation script error code")
}

func checkConfigDirectoryOwnershipAndPermissions(c check) {
PathHasOwner(c.test, etcPath, rootUser, rootGroup)
PathHasPermissions(c.test, etcPath, etcPathPermissions)
}

func checkConfigCreated(c check) {
require.FileExists(c.test, configPath, "configuration has not been created properly")
checkConfigDirectoryOwnershipAndPermissions(c)
}

func checkConfigNotCreated(c check) {
Expand Down
3 changes: 3 additions & 0 deletions pkg/scripts_test/check_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (

func checkConfigFilesOwnershipAndPermissions(ownerName string, ownerGroup string) func(c check) {
return func(c check) {
PathHasPermissions(c.test, etcPath, etcPathPermissions)
PathHasOwner(c.test, etcPath, ownerName, ownerGroup)

etcPathGlob := filepath.Join(etcPath, "*")
etcPathNestedGlob := filepath.Join(etcPath, "*", "*")

Expand Down
2 changes: 1 addition & 1 deletion pkg/scripts_test/consts_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
configPathDirPermissions uint32 = 0770
configPathFilePermissions uint32 = 0440
confDPathFilePermissions uint32 = 0644
etcPathPermissions uint32 = 0755
etcPathPermissions uint32 = 0751

rootGroup string = "wheel"
rootUser string = "root"
Expand Down

0 comments on commit af84a3b

Please sign in to comment.