Skip to content

Commit

Permalink
tests: containerize vagrant commands with podman
Browse files Browse the repository at this point in the history
Added a function to wrap vagrant commands within a podman container

Signed-off-by: Guillaume Abrioux <[email protected]>
  • Loading branch information
guits committed Jun 18, 2024
1 parent 4dc7d96 commit 688d6fb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/scripts/vagrant_up.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
#!/bin/bash

vagrant(){
podman run -it --rm \
-e LIBVIRT_DEFAULT_URI \
-e SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" \
-v /var/run/libvirt/:/var/run/libvirt/ \
-v ~/.vagrant.d:/.vagrant.d \
-v $(realpath "${PWD}"):${PWD} \
-w "${PWD}" \
--network host \
--entrypoint /bin/bash \
--security-opt label=disable \
docker.io/vagrantlibvirt/vagrant-libvirt:latest \
vagrant $@
}

set -x

test -d ~/.vagrant.d && mkdir ~/.vagrant.d

if [[ -n $1 ]]; then
DIRECTORY=$1
shift
Expand Down

0 comments on commit 688d6fb

Please sign in to comment.