Skip to content

Commit

Permalink
Merge pull request #389 from klihub/fixes/e2e/vagrant
Browse files Browse the repository at this point in the history
fixes: fix vagrant dotenv loading and default qemu directory.
  • Loading branch information
fmuyassarov authored Oct 28, 2024
2 parents 946d913 + be24d7e commit 4daf645
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/e2e/files/Vagrantfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

ENV['VAGRANT_DEFAULT_PROVIDER'] = 'qemu'

require 'dotenv'
Dotenv.load("env")

# Distro image to use
Expand Down Expand Up @@ -75,7 +76,7 @@ Vagrant.configure("2") do |config|
qemu.net_device = "virtio-net-pci"
qemu.extra_netdev_args = "net=192.168.76.0/24,dhcpstart=192.168.76.9"
qemu.ssh_port = SSH_PORT
qemu.qemu_dir = "/usr/share/OVMF"
qemu.qemu_dir = "QEMU_DIR"
qemu.smp = "QEMU_SMP"
qemu.extra_qemu_args = ["-enable-kvm",QEMU_EXTRA_ARGS]
end
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/lib/vm.bash
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ vm-setup() {
local vagrantdir="$output_dir"
local files="$nri_resource_policy_src/test/e2e/files"
local distro_name=$(printf '%s\n' "$distro" | sed -e 's/[\/&]/\\&/g')
local qemu_dir="${qemu_dir:-/usr/share/qemu}"

mkdir -p "$inventory"
if [ ! -f "$inventory/vagrant.ini" ]; then
Expand Down Expand Up @@ -132,6 +133,7 @@ vm-setup() {
-e "s/QEMU_MEM/$MEM/" \
-e "s/QEMU_SMP/$CPU/" \
-e "s/QEMU_EXTRA_ARGS/$EXTRA_ARGS/" \
-e "s:QEMU_DIR:$qemu_dir:" \
"$files/Vagrantfile.in" > "$vagrantdir/Vagrantfile.erb"
fi

Expand Down
1 change: 1 addition & 0 deletions test/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ DEFAULT_DISTRO=${DEFAULT_DISTRO:-"fedora/40-cloud-base"}
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
SRC_DIR=$(realpath "$SCRIPT_DIR/../..")
LIB_DIR=$(realpath "$SCRIPT_DIR/lib")
qemu_dir="${qemu_dir:-/usr/share/qemu}"

export OUTPUT_DIR=${outdir:-"$SCRIPT_DIR"/output}

Expand Down

0 comments on commit 4daf645

Please sign in to comment.