From 72b45eec2eb1ce3752e88bb4aba832d6d493f86e Mon Sep 17 00:00:00 2001 From: Kenichi Omichi Date: Fri, 14 Oct 2022 22:10:46 +0900 Subject: [PATCH] Use agnhost instead of busybox for network test (#9390) busybox container requires a root permission for ping. For testing hardening method at CI, we need to switch to another image which doesn't require the root permission for network testing. On kubernetes/kubernetes repo, we are using agnhost which doesn't require it. So this makes the test use aghhost image. In addition, this updates the test manifest to specify securityContext without any privilege. --- tests/testcases/030_check-network.yml | 41 ++++++++++++++++++++------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/tests/testcases/030_check-network.yml b/tests/testcases/030_check-network.yml index c193db6de..499064d7f 100644 --- a/tests/testcases/030_check-network.yml +++ b/tests/testcases/030_check-network.yml @@ -1,8 +1,8 @@ --- - hosts: kube_control_plane[0] vars: - test_image_repo: registry.k8s.io/busybox - test_image_tag: latest + test_image_repo: registry.k8s.io/e2e-test-images/agnhost + test_image_tag: "2.40" tasks: - name: Force binaries directory for Flatcar Container Linux by Kinvolk @@ -53,12 +53,33 @@ retries: 5 delay: 5 - - name: Run 2 busybox pods in test ns - command: "{{ bin_dir }}/kubectl run {{ item }} --image={{ test_image_repo }}:{{ test_image_tag }} --namespace test --command -- tail -f /dev/null" + - name: Run 2 agnhost pods in test ns + shell: + cmd: | + cat <