Skip to content

Commit

Permalink
test/e2e: add vagrant_debug env. option.
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Oct 4, 2024
1 parent 34e0018 commit b8beb0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/e2e/lib/vm.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b8beb0a

Please sign in to comment.