From b8beb0a14579e6b56289fa2aceb951c7be574986 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Fri, 4 Oct 2024 15:16:22 +0300 Subject: [PATCH] test/e2e: add vagrant_debug env. option. Signed-off-by: Krisztian Litkey --- test/e2e/lib/vm.bash | 5 +++-- test/e2e/run_tests.sh | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/e2e/lib/vm.bash b/test/e2e/lib/vm.bash index 5981fd5e2..75457e9a2 100644 --- a/test/e2e/lib/vm.bash +++ b/test/e2e/lib/vm.bash @@ -166,7 +166,8 @@ vm-setup() { make install || error "failed to check/install vagrant plugins" if [ ! -d .vagrant ]; then - vagrant init --template Vagrantfile $distro || error "failed to vagrant init $distro" + vagrant init ${vagrant_debug:+--debug} --template Vagrantfile $distro || \ + error "failed to vagrant init $distro" fi # If you want to force provisioning of already provisioned vm, @@ -175,7 +176,7 @@ vm-setup() { # cannot be called second time. But this could be used # if the provisioning failed before kubernetes was setup. if [ ! -z "$provision" ]; then - vagrant provision || error "failed to provision VM" + vagrant provision ${vagrant_debug:+--debug} || error "failed to provision VM" fi vagrant up --provider qemu || error "failed to bring up VM" diff --git a/test/e2e/run_tests.sh b/test/e2e/run_tests.sh index 35bbd3772..139cbaacb 100755 --- a/test/e2e/run_tests.sh +++ b/test/e2e/run_tests.sh @@ -200,6 +200,9 @@ for POLICY_DIR in "$TESTS_ROOT_DIR"/*; do distro=${distro:=$DEFAULT_DISTRO} export distro + vagrant_debug=${vagrant_debug:-} + export vagrant_debug + policy_name="$(basename $POLICY_DIR)" # Create name for the vm.