@@ -103,7 +103,7 @@ func getKubectlPluginProposalPromoteTest() types.Feature {
103103 }).
104104 Assess ("dry-run flag works correctly" ,
105105 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
106- temp := "kubectl runtime-enforcer proposal promote " + proposalName + " --namespace " + getNamespace (
106+ temp := "./../../bin/ kubectl-runtime_enforcer proposal promote " + proposalName + " --namespace " + getNamespace (
107107 ctx ,
108108 ) + " --dry-run"
109109 cmd := exec .Command ("bash" , "-c" , temp )
@@ -120,7 +120,7 @@ func getKubectlPluginProposalPromoteTest() types.Feature {
120120 }).
121121 Assess ("kubectl plugin promotes proposal successfully" ,
122122 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
123- temp := "kubectl runtime-enforcer proposal promote " + proposalName + " --namespace " + getNamespace (
123+ temp := "./../../bin/ kubectl-runtime_enforcer proposal promote " + proposalName + " --namespace " + getNamespace (
124124 ctx ,
125125 )
126126 cmd := exec .Command ("bash" , "-c" , temp )
@@ -224,7 +224,7 @@ func getKubectlPluginPolicyModeTest() types.Feature {
224224 Assess ("required resources become available" , IfRequiredResourcesAreCreated ).
225225 Assess ("kubectl plugin switches mode to protect" ,
226226 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
227- temp := "kubectl runtime-enforcer policy protect " + policyName + " --namespace " + getNamespace (
227+ temp := "./../../bin/ kubectl-runtime_enforcer policy protect " + policyName + " --namespace " + getNamespace (
228228 ctx ,
229229 )
230230 cmd := exec .Command ("bash" , "-c" , temp )
@@ -257,7 +257,7 @@ func getKubectlPluginPolicyModeTest() types.Feature {
257257 }).
258258 Assess ("kubectl plugin switches mode back to monitor" ,
259259 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
260- temp := "kubectl runtime-enforcer policy monitor " + policyName + " --namespace " + getNamespace (
260+ temp := "./../../bin/ kubectl-runtime_enforcer policy monitor " + policyName + " --namespace " + getNamespace (
261261 ctx ,
262262 )
263263 cmd := exec .Command ("bash" , "-c" , temp )
@@ -288,7 +288,7 @@ func getKubectlPluginPolicyModeTest() types.Feature {
288288 }).
289289 Assess ("setting mode to same value is idempotent" ,
290290 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
291- temp := "kubectl runtime-enforcer policy monitor " + policyName + " --namespace " + getNamespace (
291+ temp := "./../../bin/ kubectl-runtime_enforcer policy monitor " + policyName + " --namespace " + getNamespace (
292292 ctx ,
293293 )
294294 cmd := exec .Command ("bash" , "-c" , temp )
@@ -305,7 +305,7 @@ func getKubectlPluginPolicyModeTest() types.Feature {
305305 }).
306306 Assess ("dry-run flag works for mode change" ,
307307 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
308- temp := "kubectl runtime-enforcer policy protect " + policyName + " --namespace " + getNamespace (
308+ temp := "./../../bin/ kubectl-runtime_enforcer policy protect " + policyName + " --namespace " + getNamespace (
309309 ctx ,
310310 ) + " --dry-run"
311311 cmd := exec .Command ("bash" , "-c" , temp )
@@ -339,7 +339,7 @@ func getKubectlPluginPolicyModeTest() types.Feature {
339339 }).
340340 Assess ("error handling for non-existent policy" ,
341341 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
342- temp := "kubectl runtime-enforcer policy protect non-existent-policy" + " --namespace " + getNamespace (
342+ temp := "./../../bin/ kubectl-runtime_enforcer policy protect non-existent-policy" + " --namespace " + getNamespace (
343343 ctx ,
344344 )
345345 cmd := exec .Command ("bash" , "-c" , temp )
@@ -399,7 +399,7 @@ func getKubectlPluginPolicyExecAllowTest() types.Feature {
399399 Assess ("required resources become available" , IfRequiredResourcesAreCreated ).
400400 Assess ("kubectl plugin allows new executables" ,
401401 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
402- temp := "kubectl runtime-enforcer policy allow " + policyName + " " + containerName + " /usr/bin/cat /usr/bin/grep " + " --namespace " + getNamespace (
402+ temp := "./../../bin/ kubectl-runtime_enforcer policy allow " + policyName + " " + containerName + " /usr/bin/cat /usr/bin/grep " + " --namespace " + getNamespace (
403403 ctx ,
404404 )
405405 cmd := exec .Command ("bash" , "-c" , temp )
@@ -436,7 +436,7 @@ func getKubectlPluginPolicyExecAllowTest() types.Feature {
436436 }).
437437 Assess ("allowing already-allowed executable is idempotent" ,
438438 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
439- temp := "kubectl runtime-enforcer policy allow " + policyName + " " + containerName + " /usr/bin/cat " + " --namespace " + getNamespace (
439+ temp := "./../../bin/ kubectl-runtime_enforcer policy allow " + policyName + " " + containerName + " /usr/bin/cat " + " --namespace " + getNamespace (
440440 ctx ,
441441 )
442442 cmd := exec .Command ("bash" , "-c" , temp )
@@ -468,7 +468,7 @@ func getKubectlPluginPolicyExecAllowTest() types.Feature {
468468 require .NoError (t , err )
469469 beforeAllowed := policy .Spec .RulesByContainer [containerName ].Executables .Allowed
470470
471- temp := "kubectl runtime-enforcer policy allow " + policyName + " " + containerName + " /usr/bin/awk " + " --namespace " + getNamespace (
471+ temp := "./../../bin/ kubectl-runtime_enforcer policy allow " + policyName + " " + containerName + " /usr/bin/awk " + " --namespace " + getNamespace (
472472 ctx ,
473473 ) + " --dry-run"
474474 cmd := exec .Command ("bash" , "-c" , temp )
@@ -537,7 +537,7 @@ func getKubectlPluginPolicyExecDenyTest() types.Feature {
537537 Assess ("required resources become available" , IfRequiredResourcesAreCreated ).
538538 Assess ("kubectl plugin denies executables" ,
539539 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
540- temp := "kubectl runtime-enforcer policy deny " + policyName + " " + containerName + " /usr/bin/awk /usr/bin/sed " + " --namespace " + getNamespace (
540+ temp := "./../../bin/ kubectl-runtime_enforcer policy deny " + policyName + " " + containerName + " /usr/bin/awk /usr/bin/sed " + " --namespace " + getNamespace (
541541 ctx ,
542542 )
543543 cmd := exec .Command ("bash" , "-c" , temp )
@@ -575,7 +575,7 @@ func getKubectlPluginPolicyExecDenyTest() types.Feature {
575575 }).
576576 Assess ("denying non-existent executable is idempotent" ,
577577 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
578- temp := "kubectl runtime-enforcer policy deny " + policyName + " " + containerName + " /usr/bin/nonexistent " + " --namespace " + getNamespace (
578+ temp := "./../../bin/ kubectl-runtime_enforcer policy deny " + policyName + " " + containerName + " /usr/bin/nonexistent " + " --namespace " + getNamespace (
579579 ctx ,
580580 ) + " --dry-run"
581581 cmd := exec .Command ("bash" , "-c" , temp )
@@ -602,7 +602,7 @@ func getKubectlPluginPolicyExecDenyTest() types.Feature {
602602 err := r .Get (ctx , policyName , getNamespace (ctx ), & policy )
603603 require .NoError (t , err )
604604 beforeAllowed := policy .Spec .RulesByContainer [containerName ].Executables .Allowed
605- temp := "kubectl runtime-enforcer policy deny " + policyName + " " + containerName + " /usr/bin/ls " + " --namespace " + getNamespace (
605+ temp := "./../../bin/ kubectl-runtime_enforcer policy deny " + policyName + " " + containerName + " /usr/bin/ls " + " --namespace " + getNamespace (
606606 ctx ,
607607 ) + " --dry-run"
608608 cmd := exec .Command ("bash" , "-c" , temp )
@@ -641,7 +641,7 @@ func getKubectlPluginErrorHandlingTest() types.Feature {
641641 Assess ("required resources become available" , IfRequiredResourcesAreCreated ).
642642 Assess ("error when promoting non-existent proposal" ,
643643 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
644- temp := "kubectl runtime-enforcer proposal promote non-existent-proposal " + " --namespace " + getNamespace (
644+ temp := "./../../bin/ kubectl-runtime_enforcer proposal promote non-existent-proposal " + " --namespace " + getNamespace (
645645 ctx ,
646646 )
647647 cmd := exec .Command ("bash" , "-c" , temp )
@@ -661,7 +661,7 @@ func getKubectlPluginErrorHandlingTest() types.Feature {
661661 }).
662662 Assess ("error when modifying non-existent policy" ,
663663 func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
664- temp := "kubectl runtime-enforcer policy protect non-existent-proposal " + " --namespace " + getNamespace (
664+ temp := "./../../bin/ kubectl-runtime_enforcer policy protect non-existent-proposal " + " --namespace " + getNamespace (
665665 ctx ,
666666 )
667667 cmd := exec .Command ("bash" , "-c" , temp )
@@ -697,7 +697,7 @@ func getKubectlPluginErrorHandlingTest() types.Feature {
697697 r := getClient (ctx )
698698 err := r .Create (ctx , & policy )
699699 require .NoError (t , err )
700- temp := "kubectl runtime-enforcer policy allow test-policy non-existent-container /usr/bin/ls" + " --namespace " + getNamespace (
700+ temp := "./../../bin/ kubectl-runtime_enforcer policy allow test-policy non-existent-container /usr/bin/ls" + " --namespace " + getNamespace (
701701 ctx ,
702702 )
703703 cmd := exec .Command ("bash" , "-c" , temp )
0 commit comments