Skip to content

Commit

Permalink
vm_runner: rearrange test files
Browse files Browse the repository at this point in the history
  • Loading branch information
spernsteiner committed May 31, 2024
1 parent 06a6579 commit 204e806
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 53 deletions.
1 change: 1 addition & 0 deletions src/vm_runner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.img
15 changes: 0 additions & 15 deletions src/vm_runner/tests/build_hello_img.sh

This file was deleted.

16 changes: 0 additions & 16 deletions src/vm_runner/tests/build_mps_img.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ mode = "exec"
[[process]]
type = "vm"
kvm = false
kernel = "../../pkvm_setup/vms/debian-boot/vmlinuz"
initrd = "../../pkvm_setup/vms/debian-boot/initrd.img"
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"
path = "../../../pkvm_setup/vms/disk_host.img"

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

[process.disk.vdc]
format = "raw"
path = "hello_host.img"
path = "host.img"
read_only = true
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ mode = "exec"
[[process]]
type = "vm"
kvm = false
kernel = "../../pkvm_setup/vms/debian-boot/vmlinuz"
initrd = "../../pkvm_setup/vms/debian-boot/initrd.img"
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"
path = "../../../pkvm_setup/vms/disk_host.img"

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

hello_dir="$(dirname "$0")"

python3 "$hello_dir/../../build_application_image.py" \
-f "$hello_dir/guest.toml=runner.toml" \
-f "$hello_dir/hello.sh" \
-o "$hello_dir/guest.img"

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

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ path = "/dev/vdb"

[process.disk.vdb]
format = "raw"
path = "/opt/opensut/app/hello_guest.img"
path = "/opt/opensut/app/guest.img"
read_only = true
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ mode = "exec"
[[process]]
type = "vm"
kvm = false
kernel = "../../pkvm_setup/vms/debian-boot/vmlinuz"
initrd = "../../pkvm_setup/vms/debian-boot/initrd.img"
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"
path = "../../../pkvm_setup/vms/disk_host.img"

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

[process.disk.vdc]
format = "raw"
path = "mps_host.img"
path = "host.img"
read_only = true

[process.serial.hvc0]
mode = "unix"
path = "../serial.socket"
path = "../../serial.socket"
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ mode = "exec"
[[process]]
type = "vm"
kvm = false
kernel = "../../pkvm_setup/vms/debian-boot/vmlinuz"
initrd = "../../pkvm_setup/vms/debian-boot/initrd.img"
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"
path = "../../../pkvm_setup/vms/disk_host.img"

[process.disk.vdb]
format = "raw"
path = "mps_guest.img"
path = "guest.img"
read_only = true

[process.serial.hvc0]
mode = "unix"
path = "../serial.socket"
path = "../../serial.socket"
16 changes: 16 additions & 0 deletions src/vm_runner/tests/mps/build_img.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/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=mps" \
-f "$mps_dir/mps.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"

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ path = "/dev/vdb"

[process.disk.vdb]
format = "raw"
path = "/opt/opensut/app/mps_guest.img"
path = "/opt/opensut/app/guest.img"
read_only = true

[process.serial.hvc0]
Expand Down
File renamed without changes.

0 comments on commit 204e806

Please sign in to comment.