Skip to content

Commit

Permalink
fix(test): include procfs flag in test binary
Browse files Browse the repository at this point in the history
Signed-off-by: daemon1024 <barun1024@gmail.com>
  • Loading branch information
daemon1024 committed Oct 15, 2024
1 parent b9b927b commit 7ed83f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion KubeArmor/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

var clusterPtr, gRPCPtr, logPathPtr *string
var enableKubeArmorPolicyPtr, enableKubeArmorHostPolicyPtr, enableKubeArmorVMPtr, coverageTestPtr, enableK8sEnv, tlsEnabled *bool
var defaultFilePosturePtr, defaultCapabilitiesPosturePtr, defaultNetworkPosturePtr, hostDefaultCapabilitiesPosturePtr, hostDefaultNetworkPosturePtr, hostDefaultFilePosturePtr *string
var defaultFilePosturePtr, defaultCapabilitiesPosturePtr, defaultNetworkPosturePtr, hostDefaultCapabilitiesPosturePtr, hostDefaultNetworkPosturePtr, hostDefaultFilePosturePtr, procFsMountPtr *string

func init() {
// options (string)
Expand All @@ -32,6 +32,8 @@ func init() {
hostDefaultNetworkPosturePtr = flag.String("hostDefaultNetworkPosture", "block", "configuring default enforcement action in global network context {allow|audit|block}")
hostDefaultCapabilitiesPosturePtr = flag.String("hostDefaultCapabilitiesPosture", "block", "configuring default enforcement action in global capability context {allow|audit|block}")

procFsMountPtr = flag.String("procfsMount", "/proc", "Path to the BPF filesystem to use for storing maps")

// options (boolean)
enableKubeArmorPolicyPtr = flag.Bool("enableKubeArmorPolicy", true, "enabling KubeArmorPolicy")
enableKubeArmorHostPolicyPtr = flag.Bool("enableKubeArmorHostPolicy", true, "enabling KubeArmorHostPolicy")
Expand All @@ -42,6 +44,7 @@ func init() {

// options (boolean)
coverageTestPtr = flag.Bool("coverageTest", false, "enabling CoverageTest")

}

// TestMain - test to drive external testing coverage
Expand All @@ -64,6 +67,7 @@ func TestMain(t *testing.T) {
fmt.Sprintf("-enableKubeArmorHostPolicy=%s", strconv.FormatBool(*enableKubeArmorHostPolicyPtr)),
fmt.Sprintf("-coverageTest=%s", strconv.FormatBool(*coverageTestPtr)),
fmt.Sprintf("-tlsEnabled=%s", strconv.FormatBool(*tlsEnabled)),
fmt.Sprintf("-procfsMount=%s", *procFsMountPtr),
}

t.Log("[INFO] Executed KubeArmor")
Expand Down

0 comments on commit 7ed83f5

Please sign in to comment.