KubeArmor/tests/k8s_env
2026-07-21 13:14:46 +05:30
..
blockposture fix(test): increase KarmorGetLogs timeout in blockposture to reduce flakiness (#2635) 2026-07-21 13:14:46 +05:30
configmap fix: correct spelling mistakes across the project 2026-05-15 10:50:42 +05:30
csp Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
host_scenarios
ksp fix: correct spelling mistakes across the project 2026-05-15 10:50:42 +05:30
microservices ubi image test 2025-02-13 19:30:50 +05:30
multicontainer Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
networktests fix dns for kernel 6.17 2026-06-24 11:14:17 +05:30
nsp feat: Add Network Policy Enforcer 2026-03-10 17:54:44 +05:30
presets Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
privileged Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
scenarios Update maintainers and annotations in sample policies (#2722) 2026-07-02 11:36:17 +05:30
smoke Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
syscalls fix: correct spelling mistakes across the project 2026-05-15 10:50:42 +05:30
throttling fix: correct spelling mistakes across the project 2026-05-15 10:50:42 +05:30
visibility Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
Makefile Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
README.md
test-scenarios-github.sh Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
test-scenarios-in-runtime.sh Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
test-scenarios-local.sh Fix config watcher untracked ns (#2318) 2026-01-20 16:13:44 +05:30
tests.allow
tests.ignore

KubeArmor Automated Tests

Prerequisites

  1. Install ginkgo go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
  2. kubectl needs to be installed

How to add a new testsuite?

mkdir $BASE/newsuite && cd $BASE/newsuite
ginkgo bootstrap # This adds the skeleton for a new testcase

How to add a new testcase/testspec?

Refer to $BASE/smoke folder.

For making assertions in testspec using gomega, check this.

How to execute testsuites?

By default, running a make in the KubeArmor/tests folders runs all the tests. Check the ginkgo command in Makefile for options used (such as --flake-attempts, --timeout etc) used.

Other ways of executing the testsuites:

  1. Execute all testsuites using ginkgo -r
  2. Execute specific testsuite using ginkgo --focus "Smoke" ... where Smoke is the name of the testsuite.
  3. Execute specific testcase/testspec. Check this.
  4. Stop on first failure ginkgo -r --fail-fast
  • Note: Why is --flake-attempts=5 used in Makefile? Lot of times, on resource constrained VMs provided by GH actions, the events from kubearmor are lost. This is essentially a performance issue, but currently we are rerunning the tests.

I already have a k8s cluster. Is it possible to execute tests using it?

Yes, the tests assumes that there exists a k8s setup already operational.