Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan-sharma11 <[email protected]>
  • Loading branch information
Aryan-sharma11 committed Feb 5, 2025
1 parent da71059 commit dbe13b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci-test-ginkgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,25 @@ jobs:
echo "Pod: $POD_NAME"
echo "POD_NAME=$POD_NAME" >> $GITHUB_ENV
sleep 15
kubectl get pods -A
kubectl describe pod -n nginx
sleep 15
kubectl logs -n kubearmor deployments/kubearmor-controller
- name: Test KubeArmor using Ginkgo
run: |
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
make
working-directory: ./tests/k8s_env
timeout-minutes: 30

- name: check controller nginx logs
if: ${{ failure() }}
run: |
kubectl get pods -n nginx
kubectl logs -n kubearmor deployments/kubearmor-controller
- name: Kill KubeArmor prcoess in the pod
run: |
Expand Down
2 changes: 1 addition & 1 deletion tests/k8s_env/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build:
@go mod tidy
# run in two steps as syscall suite fails if run at the very end
# see - https://github.com/kubearmor/KubeArmor/issues/1269
@ginkgo --vv --flake-attempts=10 --timeout=15m syscalls/
@ginkgo --vv --flake-attempts=3 --timeout=15m --fail-fast ksp/
@ginkgo -r --vv --flake-attempts=10 --timeout=30m --skip-package "syscalls"
.PHONY: test
test:
Expand Down
3 changes: 2 additions & 1 deletion tests/k8s_env/ksp/ksp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ var _ = Describe("Ksp", func() {
fmt.Printf(" No pods with label pre-run-pod-test=true found ")
return
}

fmt.Println(len(pods.Items))
for _, item := range pods.Items {
annotated := false
fmt.Printf("annotations: %s status= %s , condition: %s", item.Annotations, item.Status.Phase, &item.Status.Conditions)
for key, value := range item.Annotations {
fmt.Printf("K8sGetPods pod=%s ns=%s Annotation Key=%v value=%s", item.Name, "nginx", key, value)
if key == "kubearmor-policy" {
Expand Down

0 comments on commit dbe13b6

Please sign in to comment.