test_data: Update Ubuntu cloud-init to support all integration tests

Updating the cloud-init files related to Ubuntu images is needed to be
able to use Ubuntu images for running all integration tests.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-07-02 12:54:07 +02:00 committed by Samuel Ortiz
parent 135ee4568e
commit 1f9103bb67
2 changed files with 58 additions and 13 deletions

View File

@ -1,12 +1,26 @@
network:
version: 1
config:
- type: physical
name: eth0
mac_address: 12:34:56:78:90:ab
subnets:
- type: static
address: 192.168.2.2/24
gateway: 192.168.2.1
dns_nameservers:
- 192.168.2.1
version: 2
ethernets:
id0:
match:
macaddress: 12:34:56:78:90:ab
addresses:
- 192.168.2.2/24
gateway4: 192.168.2.1
id1:
match:
macaddress: de:ad:be:ef:12:34
addresses:
- 192.168.2.3/24
gateway4: 192.168.2.1
id2:
match:
macaddress: de:ad:be:ef:34:56
addresses:
- 192.168.2.4/24
gateway4: 192.168.2.1
id3:
match:
macaddress: de:ad:be:ef:56:78
addresses:
- 192.168.2.5/24
gateway4: 192.168.2.1

View File

@ -7,4 +7,35 @@ users:
inactive: False
shell: /bin/bash
ssh_pwauth: True
ssh_pwauth: True
write_files:
-
path: /etc/systemd/system/vfio.service
permissions: 0644
content: |
[Unit]
Description=VFIO test systemd service
[Service]
Type=simple
ExecStart=/bin/bash /usr/bin/cloud-hypervisor-vfio.sh
[Install]
WantedBy=multi-user.target
-
path: /usr/bin/cloud-hypervisor-vfio.sh
permissions: 0755
content: |
#!/bin/bash
mount -t virtiofs -o dax myfs /mnt
bash -c "echo 0000:00:05.0 > /sys/bus/pci/devices/0000\:00\:05.0/driver/unbind"
bash -c "echo 1af4 1041 > /sys/bus/pci/drivers/vfio-pci/new_id"
bash -c "echo 0000:00:06.0 > /sys/bus/pci/devices/0000\:00\:06.0/driver/unbind"
bash -c "echo 1af4 1041 > /sys/bus/pci/drivers/vfio-pci/new_id"
# 1G ram requires 512 pages
echo 512 | sudo tee /proc/sys/vm/nr_hugepages
sudo chmod a+rwX /dev/hugepages
/mnt/cloud-hypervisor --kernel /mnt/vmlinux --cmdline "console=hvc0 reboot=k panic=1 nomodules i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd root=/dev/vda1 VFIOTAG" --disk path=/mnt/focal-server-cloudimg-amd64-custom.qcow2 path=/mnt/cloudinit.img --cpus boot=1 --memory size=512M,hotplug_size=1G,file=/dev/hugepages --device path=/sys/bus/pci/devices/0000:00:05.0/ path=/sys/bus/pci/devices/0000:00:06.0/ --api-socket /tmp/ch_api.sock