Table of Contents

Virt-test

Tests sobre KVM:

https://github.com/autotest/virt-test/wiki/TestRunner

Instalacion

1. Descargar codigo clonando el repositorio git:

cd /tmp; git clone git://github.com/autotest/virt-test.git

2. Instalar paquetes. En funcion del test a ejecutar se pueden necesitar mas o menos.

2.1. Actualizar fuentes:

sudo echo "deb http://ppa.launchpad.net/lmr/autotest/ubuntu raring main" > /etc/apt/sources.list.d/autotest.list

2.2. Descargar claves publicas de ppa.launchpad.net:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1750EB5E96CC8757

2.3. Actualizar e instalar paquetes:

sudo aptitude update; sudo aptitude install p7zip-full autotest tcpdump arping gcc python-dev

3. Configurar:

cd /tmp/virt-test; ./run -t qemu --bootstrap

Ejecutar tests

sudo ./run -t qemu

Salida:

Running setup. Please wait...
SETUP: PASS (18.83 s)
DATA DIR: /home/usuario/virt_test
DEBUG LOG: /srv/no_data/virt-test/logs/run-2014-01-07-16.11.55/debug.log
TESTS: 10
(1/10) type_specific.migrate.default.tcp: ERROR (9.88 s)
(2/10) type_specific.migrate.default.unix: ERROR (3.13 s)
(3/10) type_specific.migrate.default.exec.default_exec: ERROR (2.65 s)
(4/10) type_specific.migrate.default.exec.gzip_exec: ERROR (2.63 s)
(5/10) type_specific.migrate.default.fd: ERROR (2.64 s)
(6/10) type_specific.migrate.with_set_speed.tcp: ERROR (2.66 s)
(7/10) type_specific.migrate.with_set_speed.unix: ERROR (2.66 s)
(8/10) type_specific.migrate.with_set_speed.exec.default_exec: ERROR (2.65 s)
(9/10) type_specific.migrate.with_set_speed.exec.gzip_exec: ERROR (2.64 s)
(10/10) type_specific.migrate.with_set_speed.fd: ERROR (2.65 s)
TOTAL TIME: 34.27 s
TESTS PASSED: 0
TESTS FAILED: 10
SUCCESS RATE: 0.00 %
sudo ./run -t qemu --tests type_specific.migrate.default.tcp

Cortafuegos

Reglas para yo aplico. Mi entorno es bastante restrictivo:

#!/bin/bash

IPTABLES=/sbin/iptables

VIRT_IF="virbr0"
EXT_IF="eth0"

$IPTABLES -F INPUT
$IPTABLES -F OUTPUT
$IPTABLES -F FORWARD
$IPTABLES -t filter -F
$IPTABLES -t nat -F
$IPTABLES -t mangle -F

$IPTABLES -A FORWARD -i $VIRT_IF -o $VIRT_IF -p udp --sport 5353 --dport 5353 -j ACCEPT
$IPTABLES -A FORWARD -p igmp -j ACCEPT
$IPTABLES -A FORWARD -i $VIRT_IF -o $VIRT_IF -p udp -s 0.0.0.0 -d 255.255.255.255 --sport 68 --dport 67 -j ACCEPT
$IPTABLES -A INPUT -i $VIRT_IF -p udp -d 10.2.3.255 --sport 138 --dport 138 -j ACCEPT
$IPTABLES -A FORWARD -i $VIRT_IF -o $VIRT_IF -p udp -s 0.0.0.0 -d 255.255.255.255 --sport 68 --dport 67 -j ACCEPT

Errores

Estoy investigando este error:

https://github.com/autotest/virt-test/issues/80

Comandos utiles:

tail -F virt-test/logs/latest/debug.log | grep "DEBUG| Could not verify DHCP lease"
ssh $(cat virt-test/logs/latest/debug.log | grep "DEBUG| Could not verify DHCP lease" | awk '{print $10}' | tail -n 1)