Message ID | 20240603070920.2942859-2-Sai.Sathujoda@toshiba-tsip.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Trigger CIP Core testing LAVA jobs | expand |
On 03.06.24 09:09, Sai.Sathujoda@toshiba-tsip.com wrote: > From: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com> > > These templates shall be extended to form architecture specific LAVA job > definitions > > Signed-off-by: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com> > --- > test/templates/IEC_template.yml | 72 +++++++++++++++ > test/templates/secureboot_template.yml | 63 +++++++++++++ > test/templates/swupdate_template.yml | 123 +++++++++++++++++++++++++ tests/ And a short README about what is expected in this folder, how to use it would be nice. Similar to https://source.denx.de/Xenomai/xenomai-images/-/blob/master/tests/README.md, but you can start shorter. > 3 files changed, 258 insertions(+) > create mode 100644 test/templates/IEC_template.yml > create mode 100644 test/templates/secureboot_template.yml > create mode 100644 test/templates/swupdate_template.yml > > diff --git a/test/templates/IEC_template.yml b/test/templates/IEC_template.yml > new file mode 100644 > index 0000000..7f930cc > --- /dev/null > +++ b/test/templates/IEC_template.yml > @@ -0,0 +1,72 @@ > +device_type: qemu > +job_name: qemu #architecture# IEC layer testing > +timeouts: > + job: > + minutes: 30 > + action: > + minutes: 20 > + actions: > + power-off: > + seconds: 60 > +priority: medium > +tags: > +- swtpm-jobs > +visibility: public > +notify: > + criteria: > + status: finished > + recipients: > + - to: > + method: email > + email: cip-testing-results@lists.cip-project.org > + > +# ACTION BLOCK > +actions: > +- command: > + name: start_tpm > + timeout: > + minutes: 20 > + > +# DEPLOY BLOCK > +- deploy: > + timeout: > + minutes: 15 > + to: tmpfs > + images: > + system: > + image_arg: '-drive file={system},discard=unmap,if=none,id=disk,format=raw -m 1G -serial mon:stdio -smp 4 -nographic -netdev user,id=net,hostfwd=tcp:127.0.0.1:22222-:22 -chardev socket,id=chrtpm,path=/tmp/qemu-swtpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm #imageargs#' This is a really long line. Can we wrap this around somehow? Maybe with the help of 'image_arg: |'? > + url: https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-#distribution#-qemu-#architecture#.wic.xz This hard-codes the origin, project and even branch. When someone wants to instantiate this downstream, all that needs patching, no? Can we use variables for that as well? > + compression: xz > + > + #Firmware# > + #Firmware_args# > + #Firmware_url# > + > +# BOOT BLOCK > +- boot: > + timeout: > + minutes: 15 > + method: qemu > + media: tmpfs > + prompts: ["root@demo:~#"] > + auto_login: > + login_prompt: "demo login:" > + username: "root" > + password_prompt: "Password:" > + password: "CIPsecurity@123" > + > +# TEST_BLOCK > +- test: > + timeout: > + minutes: 30 > + definitions: > + - repository: https://gitlab.com/cip-project/cip-testing/cip-security-tests.git > + from: git > + branch: master > + path: iec-security-tests/Singlenode-TestDefinition.yaml > + name: Security-Testcases > + > +context: > + arch: #architecture# > + guestfs_interface: virtio > + lava_test_results_dir: '/home/lava-%s' > diff --git a/test/templates/secureboot_template.yml b/test/templates/secureboot_template.yml > new file mode 100644 > index 0000000..124ad15 > --- /dev/null > +++ b/test/templates/secureboot_template.yml > @@ -0,0 +1,63 @@ > +device_type: qemu > +job_name: qemu #architecture# secure boot testing > +timeouts: > + job: > + minutes: 30 > + action: > + minutes: 20 > + actions: > + power-off: > + seconds: 60 > +priority: medium > +tags: > +- swtpm-jobs > +visibility: public > +notify: > + criteria: > + status: finished > + recipients: > + - to: > + method: email > + email: cip-testing-results@lists.cip-project.org > + > +# ACTION BLOCK > +actions: > +- command: > + name: start_tpm > + timeout: > + minutes: 20 > + > +# DEPLOY BLOCK > +- deploy: > + timeout: > + minutes: 15 > + to: tmpfs > + images: > + system: > + image_arg: '-drive file={system},discard=unmap,if=none,id=disk,format=raw -m 1G -serial mon:stdio -smp 4 -nographic -netdev user,id=net,hostfwd=tcp:127.0.0.1:22222-:22 -chardev socket,id=chrtpm,path=/tmp/qemu-swtpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm #imageargs#' > + url: https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-#distribution#-qemu-#architecture#.wic.xz > + compression: xz > + > + #Firmware# > + #Firmware_args# > + #Firmware_url# > + > +# BOOT BLOCK > +- boot: > + timeout: > + minutes: 15 > + method: qemu > + media: tmpfs > + prompts: ["root@demo:~#"] > + auto_login: > + login_prompt: "demo login:" > + username: "root" > + password_prompt: "Password:" > + password: "CIPsecurity@123" > + parameters: > + kernel-start-message: "EFI stub: UEFI Secure Boot is enabled." > + > +context: > + arch: #architecture# > + guestfs_interface: virtio > + lava_test_results_dir: '/home/lava-%s' > diff --git a/test/templates/swupdate_template.yml b/test/templates/swupdate_template.yml > new file mode 100644 > index 0000000..3284977 > --- /dev/null > +++ b/test/templates/swupdate_template.yml > @@ -0,0 +1,123 @@ > +device_type: qemu > +job_name: qemu #architecture# software update testing > +timeouts: > + job: > + minutes: 30 > + action: > + minutes: 20 > + actions: > + power-off: > + seconds: 60 > +tags: > +- swtpm-jobs > +priority: medium > +visibility: public > +notify: > + criteria: > + status: finished > + recipients: > + - to: > + method: email > + email: cip-testing-results@lists.cip-project.org > + > +# ACTION BLOCK > +actions: > +- command: > + name: start_tpm > + timeout: > + minutes: 20 > + > +# DEPLOY BLOCK > +- deploy: > + timeout: > + minutes: 15 > + to: tmpfs > + images: > + system: > + image_arg: -drive file={system},discard=unmap,if=none,id=disk,format=raw -m 1G -serial mon:stdio -smp 4 -nographic -netdev user,id=net,hostfwd=tcp:127.0.0.1:22222-:22 -chardev socket,id=chrtpm,path=/tmp/qemu-swtpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm '#imageargs#' > + url: https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-#distribution#-qemu-#architecture#.wic.xz > + compression: xz > + > + #Firmware# > + #Firmware_args# > + #Firmware_url# > + > +# BOOT BLOCK > +- boot: > + timeout: > + minutes: 15 > + method: qemu > + media: tmpfs > + prompts: ["root@demo:~#"] > + auto_login: > + login_prompt: "demo login:" > + username: "root" > + password_prompt: "Password:" > + password: "CIPsecurity@123" > + > +# TEST_BLOCK > +# Sleep 200s is added to make the job incomplete with a timeout if software update application failed > +- test: > + timeout: > + minutes: 5 > + definitions: > + - repository: > + metadata: > + format: Lava-Test Test Definition 1.0 > + name: sample-test > + description: "Test software update" > + run: > + steps: > + - if swupdate -d "-u https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-bookworm-qemu-#architecture#.swu"; then echo software update is successful!!; else sleep 200s; fi > + from: inline > + name: sample-test-1 > + path: inline/sample-test.yaml > + > +# qemu-swtpm.sock will be gone after soft reboot. > +# So the swtpm socket need to be started again for proper reboot > +# To start the swtpm daemon, first the existing one should be killed > +- command: > + name: manual_kill > + timeout: > + minutes: 1 > +# Start the swtpm daemon > +- command: > + name: start_tpm > + timeout: > + minutes: 1 > + > +- boot: > + timeout: > + minutes: 5 > + method: qemu > + media: tmpfs > + prompts: ["root@demo:~#"] > + auto_login: > + login_prompt: "demo login:" > + username: "root" > + password_prompt: "Password:" > + password: "CIPsecurity@123" > + parameters: > + kernel-start-message: "kernel: C:BOOT1:linux.efi" > + > +# sleep 180s is added to make the job incomplete if ustate is not 2 in the updated partition > +- test: > + timeout: > + minutes: 5 > + definitions: > + - repository: > + metadata: > + format: Lava-Test Test Definition 1.0 > + name: sample-test > + description: "check boot loader environment variables" > + run: > + steps: > + - if [ $(bg_printenv | grep ustate | awk 'FNR == 2{print $2}') = 2 ]; then bg_setenv -c; else sleep 180s; fi > + from: inline > + name: sample-test-2 > + path: inline/sample-test.yaml > + > +context: > + arch: #architecture# > + guestfs_interface: virtio > + lava_test_results_dir: '/home/lava-%s' Jan
-----Original Message----- From: Jan Kiszka <jan.kiszka@siemens.com> Sent: Monday, June 3, 2024 2:39 PM To: ashrith sai(TSIP) <Sai.Sathujoda@toshiba-tsip.com>; cip-dev@lists.cip-project.org Cc: dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4) <kazuhiro3.hayashi@toshiba.co.jp> Subject: Re: [isar-cip-core 1/3] test/templates: Include functionality based templates On 03.06.24 09:09, Sai.Sathujoda@toshiba-tsip.com wrote: > From: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com> > > These templates shall be extended to form architecture specific LAVA > job definitions > > Signed-off-by: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com> > --- > test/templates/IEC_template.yml | 72 +++++++++++++++ > test/templates/secureboot_template.yml | 63 +++++++++++++ > test/templates/swupdate_template.yml | 123 +++++++++++++++++++++++++ tests/ And a short README about what is expected in this folder, how to use it would be nice. Similar to https://source.denx.de/Xenomai/xenomai-images/-/blob/master/tests/README.md, but you can start shorter. >> Sure Jan, I will create a short README in which I will explain what is actually happening when the script runs and how the jobs are created, submitted to CIP LAVA Lab. > 3 files changed, 258 insertions(+) > create mode 100644 test/templates/IEC_template.yml create mode > 100644 test/templates/secureboot_template.yml > create mode 100644 test/templates/swupdate_template.yml > > diff --git a/test/templates/IEC_template.yml > b/test/templates/IEC_template.yml new file mode 100644 index > 0000000..7f930cc > --- /dev/null > +++ b/test/templates/IEC_template.yml > @@ -0,0 +1,72 @@ > +device_type: qemu > +job_name: qemu #architecture# IEC layer testing > +timeouts: > + job: > + minutes: 30 > + action: > + minutes: 20 > + actions: > + power-off: > + seconds: 60 > +priority: medium > +tags: > +- swtpm-jobs > +visibility: public > +notify: > + criteria: > + status: finished > + recipients: > + - to: > + method: email > + email: cip-testing-results@lists.cip-project.org > + > +# ACTION BLOCK > +actions: > +- command: > + name: start_tpm > + timeout: > + minutes: 20 > + > +# DEPLOY BLOCK > +- deploy: > + timeout: > + minutes: 15 > + to: tmpfs > + images: > + system: > + image_arg: '-drive file={system},discard=unmap,if=none,id=disk,format=raw -m 1G -serial mon:stdio -smp 4 -nographic -netdev user,id=net,hostfwd=tcp:127.0.0.1:22222-:22 -chardev socket,id=chrtpm,path=/tmp/qemu-swtpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm #imageargs#' This is a really long line. Can we wrap this around somehow? Maybe with the help of 'image_arg: |'? > + url: > + https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip- > + core/next/qemu-#architecture#/cip-core-image-security-cip-core-#dist > + ribution#-qemu-#architecture#.wic.xz This hard-codes the origin, project and even branch. When someone wants to instantiate this downstream, all that needs patching, no? Can we use variables for that as well? > + compression: xz > + > + #Firmware# > + #Firmware_args# > + #Firmware_url# > + > +# BOOT BLOCK > +- boot: > + timeout: > + minutes: 15 > + method: qemu > + media: tmpfs > + prompts: ["root@demo:~#"] > + auto_login: > + login_prompt: "demo login:" > + username: "root" > + password_prompt: "Password:" > + password: "CIPsecurity@123" > + > +# TEST_BLOCK > +- test: > + timeout: > + minutes: 30 > + definitions: > + - repository: https://gitlab.com/cip-project/cip-testing/cip-security-tests.git > + from: git > + branch: master > + path: iec-security-tests/Singlenode-TestDefinition.yaml > + name: Security-Testcases > + > +context: > + arch: #architecture# > + guestfs_interface: virtio > + lava_test_results_dir: '/home/lava-%s' > diff --git a/test/templates/secureboot_template.yml > b/test/templates/secureboot_template.yml > new file mode 100644 > index 0000000..124ad15 > --- /dev/null > +++ b/test/templates/secureboot_template.yml > @@ -0,0 +1,63 @@ > +device_type: qemu > +job_name: qemu #architecture# secure boot testing > +timeouts: > + job: > + minutes: 30 > + action: > + minutes: 20 > + actions: > + power-off: > + seconds: 60 > +priority: medium > +tags: > +- swtpm-jobs > +visibility: public > +notify: > + criteria: > + status: finished > + recipients: > + - to: > + method: email > + email: cip-testing-results@lists.cip-project.org > + > +# ACTION BLOCK > +actions: > +- command: > + name: start_tpm > + timeout: > + minutes: 20 > + > +# DEPLOY BLOCK > +- deploy: > + timeout: > + minutes: 15 > + to: tmpfs > + images: > + system: > + image_arg: '-drive file={system},discard=unmap,if=none,id=disk,format=raw -m 1G -serial mon:stdio -smp 4 -nographic -netdev user,id=net,hostfwd=tcp:127.0.0.1:22222-:22 -chardev socket,id=chrtpm,path=/tmp/qemu-swtpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm #imageargs#' > + url: https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-#distribution#-qemu-#architecture#.wic.xz > + compression: xz > + > + #Firmware# > + #Firmware_args# > + #Firmware_url# > + > +# BOOT BLOCK > +- boot: > + timeout: > + minutes: 15 > + method: qemu > + media: tmpfs > + prompts: ["root@demo:~#"] > + auto_login: > + login_prompt: "demo login:" > + username: "root" > + password_prompt: "Password:" > + password: "CIPsecurity@123" > + parameters: > + kernel-start-message: "EFI stub: UEFI Secure Boot is enabled." > + > +context: > + arch: #architecture# > + guestfs_interface: virtio > + lava_test_results_dir: '/home/lava-%s' > diff --git a/test/templates/swupdate_template.yml > b/test/templates/swupdate_template.yml > new file mode 100644 > index 0000000..3284977 > --- /dev/null > +++ b/test/templates/swupdate_template.yml > @@ -0,0 +1,123 @@ > +device_type: qemu > +job_name: qemu #architecture# software update testing > +timeouts: > + job: > + minutes: 30 > + action: > + minutes: 20 > + actions: > + power-off: > + seconds: 60 > +tags: > +- swtpm-jobs > +priority: medium > +visibility: public > +notify: > + criteria: > + status: finished > + recipients: > + - to: > + method: email > + email: cip-testing-results@lists.cip-project.org > + > +# ACTION BLOCK > +actions: > +- command: > + name: start_tpm > + timeout: > + minutes: 20 > + > +# DEPLOY BLOCK > +- deploy: > + timeout: > + minutes: 15 > + to: tmpfs > + images: > + system: > + image_arg: -drive file={system},discard=unmap,if=none,id=disk,format=raw -m 1G -serial mon:stdio -smp 4 -nographic -netdev user,id=net,hostfwd=tcp:127.0.0.1:22222-:22 -chardev socket,id=chrtpm,path=/tmp/qemu-swtpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm '#imageargs#' > + url: https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-#distribution#-qemu-#architecture#.wic.xz > + compression: xz > + > + #Firmware# > + #Firmware_args# > + #Firmware_url# > + > +# BOOT BLOCK > +- boot: > + timeout: > + minutes: 15 > + method: qemu > + media: tmpfs > + prompts: ["root@demo:~#"] > + auto_login: > + login_prompt: "demo login:" > + username: "root" > + password_prompt: "Password:" > + password: "CIPsecurity@123" > + > +# TEST_BLOCK > +# Sleep 200s is added to make the job incomplete with a timeout if > +software update application failed > +- test: > + timeout: > + minutes: 5 > + definitions: > + - repository: > + metadata: > + format: Lava-Test Test Definition 1.0 > + name: sample-test > + description: "Test software update" > + run: > + steps: > + - if swupdate -d "-u https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-bookworm-qemu-#architecture#.swu"; then echo software update is successful!!; else sleep 200s; fi > + from: inline > + name: sample-test-1 > + path: inline/sample-test.yaml > + > +# qemu-swtpm.sock will be gone after soft reboot. > +# So the swtpm socket need to be started again for proper reboot # To > +start the swtpm daemon, first the existing one should be killed > +- command: > + name: manual_kill > + timeout: > + minutes: 1 > +# Start the swtpm daemon > +- command: > + name: start_tpm > + timeout: > + minutes: 1 > + > +- boot: > + timeout: > + minutes: 5 > + method: qemu > + media: tmpfs > + prompts: ["root@demo:~#"] > + auto_login: > + login_prompt: "demo login:" > + username: "root" > + password_prompt: "Password:" > + password: "CIPsecurity@123" > + parameters: > + kernel-start-message: "kernel: C:BOOT1:linux.efi" > + > +# sleep 180s is added to make the job incomplete if ustate is not 2 > +in the updated partition > +- test: > + timeout: > + minutes: 5 > + definitions: > + - repository: > + metadata: > + format: Lava-Test Test Definition 1.0 > + name: sample-test > + description: "check boot loader environment variables" > + run: > + steps: > + - if [ $(bg_printenv | grep ustate | awk 'FNR == 2{print $2}') = 2 ]; then bg_setenv -c; else sleep 180s; fi > + from: inline > + name: sample-test-2 > + path: inline/sample-test.yaml > + > +context: > + arch: #architecture# > + guestfs_interface: virtio > + lava_test_results_dir: '/home/lava-%s' Jan -- Siemens AG, Technology Linux Expert Center
diff --git a/test/templates/IEC_template.yml b/test/templates/IEC_template.yml new file mode 100644 index 0000000..7f930cc --- /dev/null +++ b/test/templates/IEC_template.yml @@ -0,0 +1,72 @@ +device_type: qemu +job_name: qemu #architecture# IEC layer testing +timeouts: + job: + minutes: 30 + action: + minutes: 20 + actions: + power-off: + seconds: 60 +priority: medium +tags: +- swtpm-jobs +visibility: public +notify: + criteria: + status: finished + recipients: + - to: + method: email + email: cip-testing-results@lists.cip-project.org + +# ACTION BLOCK +actions: +- command: + name: start_tpm + timeout: + minutes: 20 + +# DEPLOY BLOCK +- deploy: + timeout: + minutes: 15 + to: tmpfs + images: + system: + image_arg: '-drive file={system},discard=unmap,if=none,id=disk,format=raw -m 1G -serial mon:stdio -smp 4 -nographic -netdev user,id=net,hostfwd=tcp:127.0.0.1:22222-:22 -chardev socket,id=chrtpm,path=/tmp/qemu-swtpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm #imageargs#' + url: https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-#distribution#-qemu-#architecture#.wic.xz + compression: xz + + #Firmware# + #Firmware_args# + #Firmware_url# + +# BOOT BLOCK +- boot: + timeout: + minutes: 15 + method: qemu + media: tmpfs + prompts: ["root@demo:~#"] + auto_login: + login_prompt: "demo login:" + username: "root" + password_prompt: "Password:" + password: "CIPsecurity@123" + +# TEST_BLOCK +- test: + timeout: + minutes: 30 + definitions: + - repository: https://gitlab.com/cip-project/cip-testing/cip-security-tests.git + from: git + branch: master + path: iec-security-tests/Singlenode-TestDefinition.yaml + name: Security-Testcases + +context: + arch: #architecture# + guestfs_interface: virtio + lava_test_results_dir: '/home/lava-%s' diff --git a/test/templates/secureboot_template.yml b/test/templates/secureboot_template.yml new file mode 100644 index 0000000..124ad15 --- /dev/null +++ b/test/templates/secureboot_template.yml @@ -0,0 +1,63 @@ +device_type: qemu +job_name: qemu #architecture# secure boot testing +timeouts: + job: + minutes: 30 + action: + minutes: 20 + actions: + power-off: + seconds: 60 +priority: medium +tags: +- swtpm-jobs +visibility: public +notify: + criteria: + status: finished + recipients: + - to: + method: email + email: cip-testing-results@lists.cip-project.org + +# ACTION BLOCK +actions: +- command: + name: start_tpm + timeout: + minutes: 20 + +# DEPLOY BLOCK +- deploy: + timeout: + minutes: 15 + to: tmpfs + images: + system: + image_arg: '-drive file={system},discard=unmap,if=none,id=disk,format=raw -m 1G -serial mon:stdio -smp 4 -nographic -netdev user,id=net,hostfwd=tcp:127.0.0.1:22222-:22 -chardev socket,id=chrtpm,path=/tmp/qemu-swtpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm #imageargs#' + url: https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-#distribution#-qemu-#architecture#.wic.xz + compression: xz + + #Firmware# + #Firmware_args# + #Firmware_url# + +# BOOT BLOCK +- boot: + timeout: + minutes: 15 + method: qemu + media: tmpfs + prompts: ["root@demo:~#"] + auto_login: + login_prompt: "demo login:" + username: "root" + password_prompt: "Password:" + password: "CIPsecurity@123" + parameters: + kernel-start-message: "EFI stub: UEFI Secure Boot is enabled." + +context: + arch: #architecture# + guestfs_interface: virtio + lava_test_results_dir: '/home/lava-%s' diff --git a/test/templates/swupdate_template.yml b/test/templates/swupdate_template.yml new file mode 100644 index 0000000..3284977 --- /dev/null +++ b/test/templates/swupdate_template.yml @@ -0,0 +1,123 @@ +device_type: qemu +job_name: qemu #architecture# software update testing +timeouts: + job: + minutes: 30 + action: + minutes: 20 + actions: + power-off: + seconds: 60 +tags: +- swtpm-jobs +priority: medium +visibility: public +notify: + criteria: + status: finished + recipients: + - to: + method: email + email: cip-testing-results@lists.cip-project.org + +# ACTION BLOCK +actions: +- command: + name: start_tpm + timeout: + minutes: 20 + +# DEPLOY BLOCK +- deploy: + timeout: + minutes: 15 + to: tmpfs + images: + system: + image_arg: -drive file={system},discard=unmap,if=none,id=disk,format=raw -m 1G -serial mon:stdio -smp 4 -nographic -netdev user,id=net,hostfwd=tcp:127.0.0.1:22222-:22 -chardev socket,id=chrtpm,path=/tmp/qemu-swtpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm '#imageargs#' + url: https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-#distribution#-qemu-#architecture#.wic.xz + compression: xz + + #Firmware# + #Firmware_args# + #Firmware_url# + +# BOOT BLOCK +- boot: + timeout: + minutes: 15 + method: qemu + media: tmpfs + prompts: ["root@demo:~#"] + auto_login: + login_prompt: "demo login:" + username: "root" + password_prompt: "Password:" + password: "CIPsecurity@123" + +# TEST_BLOCK +# Sleep 200s is added to make the job incomplete with a timeout if software update application failed +- test: + timeout: + minutes: 5 + definitions: + - repository: + metadata: + format: Lava-Test Test Definition 1.0 + name: sample-test + description: "Test software update" + run: + steps: + - if swupdate -d "-u https://s3.eu-central-1.amazonaws.com/download2.cip-project.org/cip-core/next/qemu-#architecture#/cip-core-image-security-cip-core-bookworm-qemu-#architecture#.swu"; then echo software update is successful!!; else sleep 200s; fi + from: inline + name: sample-test-1 + path: inline/sample-test.yaml + +# qemu-swtpm.sock will be gone after soft reboot. +# So the swtpm socket need to be started again for proper reboot +# To start the swtpm daemon, first the existing one should be killed +- command: + name: manual_kill + timeout: + minutes: 1 +# Start the swtpm daemon +- command: + name: start_tpm + timeout: + minutes: 1 + +- boot: + timeout: + minutes: 5 + method: qemu + media: tmpfs + prompts: ["root@demo:~#"] + auto_login: + login_prompt: "demo login:" + username: "root" + password_prompt: "Password:" + password: "CIPsecurity@123" + parameters: + kernel-start-message: "kernel: C:BOOT1:linux.efi" + +# sleep 180s is added to make the job incomplete if ustate is not 2 in the updated partition +- test: + timeout: + minutes: 5 + definitions: + - repository: + metadata: + format: Lava-Test Test Definition 1.0 + name: sample-test + description: "check boot loader environment variables" + run: + steps: + - if [ $(bg_printenv | grep ustate | awk 'FNR == 2{print $2}') = 2 ]; then bg_setenv -c; else sleep 180s; fi + from: inline + name: sample-test-2 + path: inline/sample-test.yaml + +context: + arch: #architecture# + guestfs_interface: virtio + lava_test_results_dir: '/home/lava-%s'