mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Add basic vagrant package integration test (#1302)
Simple integration test for vagrant package to ensure the execution completes successfully to allow for some refactoring to be performed. Ensure libguestfs-tools installed to provide virt-sysprep for tests and update docs to reflect.
This commit is contained in:
3
.github/workflows/integration-tests.yml
vendored
3
.github/workflows/integration-tests.yml
vendored
@@ -43,12 +43,13 @@ jobs:
|
||||
bridge-utils \
|
||||
dnsmasq-base \
|
||||
ebtables \
|
||||
libarchive-tools \
|
||||
libguestfs-tools \
|
||||
libvirt-clients \
|
||||
libvirt-daemon \
|
||||
libvirt-daemon-system \
|
||||
qemu-kvm \
|
||||
qemu-utils \
|
||||
libarchive-tools \
|
||||
;
|
||||
sudo apt-get install \
|
||||
libvirt-dev \
|
||||
|
||||
11
README.md
11
README.md
@@ -183,6 +183,7 @@ vagrant-libvirt. This depends on your distro. An overview:
|
||||
apt-get build-dep vagrant ruby-libvirt
|
||||
apt-get install qemu libvirt-daemon-system libvirt-clients ebtables dnsmasq-base
|
||||
apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
|
||||
a[t-get install libguestfs-tools
|
||||
```
|
||||
|
||||
* Ubuntu 18.04, Debian 8 and older:
|
||||
@@ -190,23 +191,24 @@ apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
|
||||
apt-get build-dep vagrant ruby-libvirt
|
||||
apt-get install qemu libvirt-bin ebtables dnsmasq-base
|
||||
apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
|
||||
apt-get install libguestfs-tools
|
||||
```
|
||||
|
||||
(It is possible some users will already have libraries from the third line installed, but this is the way to make it work OOTB.)
|
||||
|
||||
* CentOS 6, 7, Fedora 21:
|
||||
```shell
|
||||
yum install qemu libvirt libvirt-devel ruby-devel gcc qemu-kvm
|
||||
yum install qemu libvirt libvirt-devel ruby-devel gcc qemu-kvm libguestfs-tools
|
||||
```
|
||||
|
||||
* Fedora 22 and up:
|
||||
```shell
|
||||
dnf install -y gcc libvirt libvirt-devel libxml2-devel make ruby-devel
|
||||
dnf install -y gcc libvirt libvirt-devel libxml2-devel make ruby-devel libguestfs-tools
|
||||
```
|
||||
|
||||
* OpenSUSE leap 15.1:
|
||||
```shell
|
||||
zypper install qemu libvirt libvirt-devel ruby-devel gcc qemu-kvm
|
||||
zypper install qemu libvirt libvirt-devel ruby-devel gcc qemu-kvm libguestfs
|
||||
```
|
||||
|
||||
* Arch Linux: please read the related [ArchWiki](https://wiki.archlinux.org/index.php/Vagrant#vagrant-libvirt) page.
|
||||
@@ -241,8 +243,7 @@ On Ubuntu, Debian, make sure you are running all three of the `apt` commands abo
|
||||
On RedHat, Centos, Fedora, ...
|
||||
|
||||
```shell
|
||||
$ sudo dnf install libxslt-devel libxml2-devel libvirt-devel \
|
||||
libguestfs-tools-c ruby-devel gcc
|
||||
$ sudo dnf install libxslt-devel libxml2-devel libvirt-devel ruby-devel gcc
|
||||
```
|
||||
|
||||
On Arch Linux it is recommended to follow [steps from ArchWiki](https://wiki.archlinux.org/index.php/Vagrant#vagrant-libvirt).
|
||||
|
||||
8
tests/package_simple/Vagrantfile
vendored
Normal file
8
tests/package_simple/Vagrantfile
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "infernix/tinycore"
|
||||
config.ssh.shell = "/bin/sh"
|
||||
config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
end
|
||||
@@ -134,3 +134,31 @@ cleanup() {
|
||||
[ $(expr "$output" : ".*alive.*") -ne 0 ]
|
||||
cleanup
|
||||
}
|
||||
|
||||
@test "package simple domain" {
|
||||
export VAGRANT_CWD=tests/package_simple
|
||||
cleanup
|
||||
run ${VAGRANT_CMD} up ${VAGRANT_OPT}
|
||||
echo "${output}"
|
||||
echo "status = ${status}"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${VAGRANT_CMD} halt
|
||||
echo "${output}"
|
||||
echo "status = ${status}"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${VAGRANT_CMD} package
|
||||
echo "${output}"
|
||||
echo "status = ${status}"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${VAGRANT_CMD} box add package.box --name test-package-simple-domain
|
||||
echo "${output}"
|
||||
echo "status = ${status}"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${VAGRANT_CMD} box remove test-package-simple-domain
|
||||
echo "${output}"
|
||||
echo "status = ${status}"
|
||||
[ "$status" -eq 0 ]
|
||||
rm -f package.box
|
||||
|
||||
cleanup
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user