mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
fix: execute valid bash cmd when running init as root
This commit is contained in:
1 parent
653f47f507
commit
b2f7c6fb33
2 files changed
+41
-10
No files matched your search
@@ -0,0 +1,19 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestInstallCmd(t *testing.T) {
|
||||
t.Run("root", func(t *testing.T) {
|
||||
cmd := installCmd("root")
|
||||
assert.NotContains(t, cmd, "sudo")
|
||||
})
|
||||
|
||||
t.Run("nonroot", func(t *testing.T) {
|
||||
cmd := installCmd("nonroot")
|
||||
assert.Contains(t, cmd, "sudo")
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user