Skip to content

Commit

Permalink
e2e: update qemu_dir, make it configurable.
Browse files Browse the repository at this point in the history
Update Vagrant qemu_dir to a default which works with recent
versions of vagrant on both Fedora and OpenSUSE. Make qemu_dir
configurable via the same shell variable.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Oct 25, 2024
1 parent 892b820 commit be24d7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/files/Vagrantfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -76,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 be24d7e

Please sign in to comment.