Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions scripts/create-cloud-init.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/bash
set -x

rm /tmp/clear-cloudinit.img
mkdosfs -n config-2 -C /tmp/clear-cloudinit.img 8192
mcopy -oi /tmp/clear-cloudinit.img -s test_data/cloud-init/clear/openstack ::

rm /tmp/ubuntu-cloudinit.img
mkdosfs -n cidata -C /tmp/ubuntu-cloudinit.img 8192
mcopy -oi /tmp/ubuntu-cloudinit.img -s test_data/cloud-init/ubuntu/user-data ::
Expand Down
27 changes: 5 additions & 22 deletions scripts/run_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,7 @@ if [ ! -f "$FW" ]; then
popd
fi

CLEAR_OS_IMAGE_NAME="clear-31311-cloudguest.img"
CLEAR_OS_IMAGE_URL="https://cloudhypervisorstorage.blob.core.windows.net/images/$CLEAR_OS_IMAGE_NAME"
CLEAR_OS_IMAGE="$WORKLOADS_DIR/$CLEAR_OS_IMAGE_NAME"
if [ ! -f "$CLEAR_OS_IMAGE" ]; then
pushd $WORKLOADS_DIR
time wget --quiet $CLEAR_OS_IMAGE_URL || exit 1
popd
fi

CLEAR_OS_RAW_IMAGE_NAME="clear-31311-cloudguest-raw.img"
CLEAR_OS_RAW_IMAGE="$WORKLOADS_DIR/$CLEAR_OS_RAW_IMAGE_NAME"
if [ ! -f "$CLEAR_OS_RAW_IMAGE" ]; then
pushd $WORKLOADS_DIR
time qemu-img convert -p -f qcow2 -O raw $CLEAR_OS_IMAGE_NAME $CLEAR_OS_RAW_IMAGE_NAME || exit 1
popd
fi

BIONIC_OS_IMAGE_NAME="bionic-server-cloudimg-amd64.img"
BIONIC_OS_IMAGE_NAME="bionic-server-cloudimg-amd64.qcow2"
BIONIC_OS_IMAGE_URL="https://cloudhypervisorstorage.blob.core.windows.net/images/$BIONIC_OS_IMAGE_NAME"
BIONIC_OS_IMAGE="$WORKLOADS_DIR/$BIONIC_OS_IMAGE_NAME"
if [ ! -f "$BIONIC_OS_IMAGE" ]; then
Expand All @@ -44,7 +27,7 @@ if [ ! -f "$BIONIC_OS_IMAGE" ]; then
popd
fi

BIONIC_OS_RAW_IMAGE_NAME="bionic-server-cloudimg-amd64-raw.img"
BIONIC_OS_RAW_IMAGE_NAME="bionic-server-cloudimg-amd64.raw"
BIONIC_OS_RAW_IMAGE="$WORKLOADS_DIR/$BIONIC_OS_RAW_IMAGE_NAME"
if [ ! -f "$BIONIC_OS_RAW_IMAGE" ]; then
pushd $WORKLOADS_DIR
Expand All @@ -53,7 +36,7 @@ if [ ! -f "$BIONIC_OS_RAW_IMAGE" ]; then
fi


FOCAL_OS_IMAGE_NAME="focal-server-cloudimg-amd64.img"
FOCAL_OS_IMAGE_NAME="focal-server-cloudimg-amd64-custom.qcow2"
FOCAL_OS_IMAGE_URL="https://cloudhypervisorstorage.blob.core.windows.net/images/$FOCAL_OS_IMAGE_NAME"
FOCAL_OS_IMAGE="$WORKLOADS_DIR/$FOCAL_OS_IMAGE_NAME"
if [ ! -f "$FOCAL_OS_IMAGE" ]; then
Expand All @@ -62,7 +45,7 @@ if [ ! -f "$FOCAL_OS_IMAGE" ]; then
popd
fi

FOCAL_OS_RAW_IMAGE_NAME="focal-server-cloudimg-amd64-raw.img"
FOCAL_OS_RAW_IMAGE_NAME="focal-server-cloudimg-amd64-custom.raw"
FOCAL_OS_RAW_IMAGE="$WORKLOADS_DIR/$FOCAL_OS_RAW_IMAGE_NAME"
if [ ! -f "$FOCAL_OS_RAW_IMAGE" ]; then
pushd $WORKLOADS_DIR
Expand Down Expand Up @@ -179,7 +162,7 @@ fi
VFIO_DIR="$WORKLOADS_DIR/vfio"
rm -rf $VFIO_DIR
mkdir -p $VFIO_DIR
cp $CLEAR_OS_IMAGE $VFIO_DIR
cp $FOCAL_OS_IMAGE $VFIO_DIR
cp $FW $VFIO_DIR
cp $VMLINUX_IMAGE $VFIO_DIR || exit 1

Expand Down
10 changes: 4 additions & 6 deletions scripts/sha1sums
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
cf7cfa783082fc4d6b4d1c0a53e4402648c14b82 clear-31311-cloudguest.img
142a410546b592ff9536b46bb410faf8ac11edee clear-31311-cloudguest-raw.img
27f3b17962ace69b51f0ddc2012095e3109e6ed8 bionic-server-cloudimg-amd64.img
8db9cc58b01452ce2d06c313177e6e74d8582d93 bionic-server-cloudimg-amd64-raw.img
27f3b17962ace69b51f0ddc2012095e3109e6ed8 bionic-server-cloudimg-amd64.qcow2
8db9cc58b01452ce2d06c313177e6e74d8582d93 bionic-server-cloudimg-amd64.raw
d4a44acc6014d5f83dea1c625c43d677a95fa75f alpine-minirootfs-x86_64.tar.gz
3cab64475048383e70a38550734e98961cfe0fd6 focal-server-cloudimg-amd64-raw.img
c74a95665b189f93cb16a2c1770820c6a6a43fb0 focal-server-cloudimg-amd64.img
f131563d3aa466cb5d2c25ffe7007c9cb8d15818 focal-server-cloudimg-amd64-custom.qcow2
d5a08d2b35d48042d2c08fdc0c31ae656073f43e focal-server-cloudimg-amd64-custom.raw
3 changes: 0 additions & 3 deletions test_data/cloud-init/clear/openstack/latest/meta_data.json

This file was deleted.

80 changes: 0 additions & 80 deletions test_data/cloud-init/clear/openstack/latest/user_data

This file was deleted.

38 changes: 26 additions & 12 deletions test_data/cloud-init/ubuntu/network-config
Original file line number Diff line number Diff line change
@@ -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
33 changes: 32 additions & 1 deletion test_data/cloud-init/ubuntu/user-data
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading