mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2024-11-29 11:28:14 +00:00
Correct test to cope with multi-line ps output
This commit is contained in:
parent
a6036bcfcf
commit
de12829923
@ -189,13 +189,13 @@ func TestGetBinaries(t *testing.T) {
|
|||||||
{
|
{
|
||||||
// more than one component
|
// more than one component
|
||||||
config: map[string]interface{}{"components": []string{"apiserver", "thing"}, "apiserver": map[string]interface{}{"bins": []string{"apiserver", "kube-apiserver"}}, "thing": map[string]interface{}{"bins": []string{"something else", "thing"}}},
|
config: map[string]interface{}{"components": []string{"apiserver", "thing"}, "apiserver": map[string]interface{}{"bins": []string{"apiserver", "kube-apiserver"}}, "thing": map[string]interface{}{"bins": []string{"something else", "thing"}}},
|
||||||
psOut: "kube-apiserver thing",
|
psOut: "kube-apiserver \nthing",
|
||||||
exp: map[string]string{"apiserver": "kube-apiserver", "thing": "thing"},
|
exp: map[string]string{"apiserver": "kube-apiserver", "thing": "thing"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// default binary to component name
|
// default binary to component name
|
||||||
config: map[string]interface{}{"components": []string{"apiserver", "thing"}, "apiserver": map[string]interface{}{"bins": []string{"apiserver", "kube-apiserver"}}, "thing": map[string]interface{}{"bins": []string{"something else", "thing"}, "optional": true}},
|
config: map[string]interface{}{"components": []string{"apiserver", "thing"}, "apiserver": map[string]interface{}{"bins": []string{"apiserver", "kube-apiserver"}}, "thing": map[string]interface{}{"bins": []string{"something else", "thing"}, "optional": true}},
|
||||||
psOut: "kube-apiserver otherthing",
|
psOut: "kube-apiserver \notherthing some params",
|
||||||
exp: map[string]string{"apiserver": "kube-apiserver", "thing": "thing"},
|
exp: map[string]string{"apiserver": "kube-apiserver", "thing": "thing"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user