Using autotest/virt-test with cloudrouter

Setup Environment on Fedora

sudo yum groupinstall "Development Tools" -y
sudo yum install autotest-framework p7zip python-devel tcpdump nmap-ncat qemu-kvm qemu-kvm-tools virt-install python-devel python-imaging mkisofs genisoimage libvirt bridge-utils libguestfs-tools-c gstreamer-python -y
git clone https://github.com/autotest/virt-test.git
cd virt-test/
sudo ./run -t qemu --bootstrap

 

Cloudrouter config files

Clone the cloudrouter repo.

git clone https://github.com/cloudrouter/cloudrouter.git

 

The cloudrouter/testing/virt-test/cloudrouter-tests/* python files are the test files for cloudrouter.

cp -r cloudrouter/testing/virt-test/cloudrouter-tests /path/to/virt-test/

 

The testing provider url in cloudrouter/testing/virt-test/test-providers.d/cloudrouter.ini will need to be edited to correctly map do the cloudrouter-tests tests dir on your local filesystem.

cp -r cloudrouter/testing/virt-test/test-providers.d/cloudrouter.ini /path/to/virt-test/test-providers.d/

 

The cloudrouter/testing/virt-test/shared/downloads/cloudrouter-2-64.ini config can point to a url where you store the cloudrouter-2-64.qcow2.7z. Otherwise create a local copy and the testing suite will use this.

cp -r cloudrouter/testing/virt-test/shared/downloads/* /path/to/virt-test/shared/downloads/*

 

The cloudrouter/testing/virt-test/shared/cfg/guest-os/Linux/Cloudrouter* configs define the cloudrouter guest.

cp -r cloudrouter/testing/virt-test/shared/cfg/guest-os/Linux/Cloudrouter* /path/to/virt-test/shared/cfg/guest-os/Linux/

 

The cloud-init iso need to be copied to the iso folder

cp cloudrouter/testing/virt-test/shared/data/isos/* /path/to/virt-test/shared/data/isos

Create a local cloudrouter image for testing

Download and create local qcow2 image

sudo curl -o /var/lib/libvirt/images/CloudRouter-3.0-fedora-minimal.raw.xz https://repo.cloudrouter.org/3/fedora/23/images/CloudRouter-3.0-fedora-minimal.raw.xz
sudo xz -d /var/lib/libvirt/images/CloudRouter-3.0-fedora-minimal.raw.xz
sudo qemu-img convert -f raw -O qcow2 /var/lib/libvirt/images/CloudRouter-3.0-fedora-minimal.raw.xz /var/lib/libvirt/images/cloudrouter-3-64.qcow2
sudo rm -f /var/lib/libvirt/images/CloudRouter-3.0-fedora-minimal.raw
cd /var/lib/libvirt/images/
sudo 7za a /path/to/virt-test/shared/data/images/cloudrouter-3-64.qcow2.7z cloudrouter-3-64.qcow2

Run a single cloudrouter test

sudo ./run -t qemu -g Linux.Cloudrouter.3.x86_64 --tests cloudrouter.baseos

Run multiple existing tests

sudo ./run -t qemu -g Linux.Cloudrouter.3.x86_64 --tests "cloudrouter.baseos cloudrouter.basebird cloudrouter.basequagga cloudrouter.baseonos cloudrouter.baseopendaylight cloudrouter.basefastnetmon cloudrouter.basemininet cloudrouter.basecapstan"

Run a single other test

sudo ./run -t qemu -g Linux.Cloudrouter.3.x86_64 --tests io-github-autotest-qemu.ping.default_ping

Run multiple other tests

sudo ./run -t qemu -g Linux.Cloudrouter.3.x86_64 --tests "io-github-autotest-qemu.boot io-github-autotest-qemu.shutdown"