Skip to content

Commit

Permalink
vm_runner: add configs for running the MPS test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
spernsteiner committed May 31, 2024
1 parent 204e806 commit dc688aa
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/vm_runner/tests/mps_tests/base_nested.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mode = "exec"

[[process]]
type = "vm"
kvm = false
kernel = "../../../pkvm_setup/vms/debian-boot/vmlinuz"
initrd = "../../../pkvm_setup/vms/debian-boot/initrd.img"
append = 'earlycon root=/dev/vda2 systemd.run=/opt/opensut/bin/opensut_boot opensut.app_device=/dev/vdc'

[process.disk.vda]
format = "qcow2"
path = "../../../pkvm_setup/vms/disk_host.img"

[process.disk.vdb]
format = "qcow2"
path = "../../../pkvm_setup/vms/disk_guest.img"

[process.disk.vdc]
format = "raw"
path = "host.img"
read_only = true
17 changes: 17 additions & 0 deletions src/vm_runner/tests/mps_tests/base_single.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mode = "exec"

[[process]]
type = "vm"
kvm = false
kernel = "../../../pkvm_setup/vms/debian-boot/vmlinuz"
initrd = "../../../pkvm_setup/vms/debian-boot/initrd.img"
append = 'earlycon root=/dev/vda2 systemd.run=/opt/opensut/bin/opensut_boot opensut.app_device=/dev/vdb'

[process.disk.vda]
format = "qcow2"
path = "../../../pkvm_setup/vms/disk_host.img"

[process.disk.vdb]
format = "raw"
path = "guest.img"
read_only = true
18 changes: 18 additions & 0 deletions src/vm_runner/tests/mps_tests/build_img.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -euo pipefail

mps_dir="$(dirname "$0")"

python3 "$mps_dir/../../build_application_image.py" \
-f "$mps_dir/guest.toml=runner.toml" \
-f "$mps_dir/../../../../components/mission_protection_system/src/rts.self_test.aarch64=src/rts.self_test" \
-f "$mps_dir/../../../../components/mission_protection_system/src/rts.no_self_test.aarch64=src/rts.no_self_test" \
-d "$mps_dir/../../../../components/mission_protection_system/tests" \
-f "$mps_dir/mps_tests.sh" \
-o "$mps_dir/guest.img"

python3 "$mps_dir/../../build_application_image.py" \
-f "$mps_dir/host.toml=runner.toml" \
-f "$mps_dir/guest.img" \
-o "$mps_dir/host.img"

6 changes: 6 additions & 0 deletions src/vm_runner/tests/mps_tests/guest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mode = "exec"

[[process]]
type = "shell"
command = "./mps_tests.sh"

17 changes: 17 additions & 0 deletions src/vm_runner/tests/mps_tests/host.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mode = "exec"

[[process]]
type = "vm"
kvm = true
kernel = "/boot/vmlinuz"
initrd = "/boot/initrd.img"
append = 'earlycon root=/dev/vda2 systemd.run=/opt/opensut/bin/opensut_boot opensut.app_device=/dev/vdb'

[process.disk.vda]
format = "raw"
path = "/dev/vdb"

[process.disk.vdb]
format = "raw"
path = "/opt/opensut/app/guest.img"
read_only = true
8 changes: 8 additions & 0 deletions src/vm_runner/tests/mps_tests/mps_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -euo pipefail

apt install -y python3-pexpect

echo "Starting test suite"
cd tests
RTS_DEBUG=1 python3 run_all.py

0 comments on commit dc688aa

Please sign in to comment.