Skip to content

Commit

Permalink
feat(scripts/install.sh): add information after uninstallation
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
  • Loading branch information
Dominik Rosiek authored and sumo-drosiek committed Feb 9, 2023
1 parent ff8177c commit 75b02c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/scripts_test/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@ func checkVarLogACL(c check) {
PathHasUserACL(c.test, "/var/log", systemUser, "r-x")
}

func checkUninstallationOutput(c check) {
require.Greater(c.test, len(c.output), 1)
require.Contains(c.test, c.output[len(c.output)-1], "Uninstallation completed")
}

func PathHasPermissions(t *testing.T, path string, perms uint32) {
info, err := os.Stat(path)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/scripts_test/install_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func TestInstallScript(t *testing.T) {
},
preActions: []checkFunc{preActionMockStructure},
preChecks: []checkFunc{checkBinaryCreated, checkConfigCreated, checkUserConfigCreated, checkUserNotExists},
postChecks: []checkFunc{checkBinaryNotCreated, checkConfigCreated, checkUserConfigCreated},
postChecks: []checkFunc{checkBinaryNotCreated, checkConfigCreated, checkUserConfigCreated, checkUninstallationOutput},
},
{
name: "systemd uninstallation",
Expand Down
1 change: 1 addition & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ function uninstall() {
fi
fi

echo "Uninstallation completed"
exit 0
}

Expand Down

0 comments on commit 75b02c3

Please sign in to comment.