From 989f3d7e84f64225f5e8ccdcde3537faa1007a8b Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 24 Jan 2025 12:52:18 +0000 Subject: [PATCH 1/9] Add invalida lava template Signed-off-by: Milosz Wasilewski --- lava/rb3g2/invalid.yaml | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 lava/rb3g2/invalid.yaml diff --git a/lava/rb3g2/invalid.yaml b/lava/rb3g2/invalid.yaml new file mode 100644 index 0000000..b46e5c2 --- /dev/null +++ b/lava/rb3g2/invalid.yaml @@ -0,0 +1,66 @@ +actions: +- deploy: + images: + image: + headers: + Authentication: Q_GITHUB_TOKEN + url: "https://quic-yocto-fileserver-1029608027416.us-central1.run.app/12591501185/qcs6490-rb3gen2-core-kit/core-image-base-qcs6490-rb3gen2-core-kit.rootfs.qcomflash.tar.gz" + postprocess: + docker: + image: ghcr.io/foundriesio/lava-lmp-sign:main + steps: + - export IMAGE_PATH=$PWD + - cp overlay*.tar.gz overlay.tar.gz + - echo "OVERLAY=overlay.tar.gz" >> $IMAGE_PATH/flash.settings + - echo "OVERLAY_PATH=/home/" >> $IMAGE_PATH/flash.settings + - echo "DEVICE_TYPE=qcs6490-rb3gen2" >> $IMAGE_PATH/flash.settings + - cat $IMAGE_PATH/flash.settings + timeout: + minutes: 5 + to: downloads + - deploy: + images: + image: + url: downloads://core-image-base-qcs6490-rb3gen2-core-kit.rootfs.qcomflash.tar.gz + settings: + url: downloads://flash.settings + overlay: + url: downloads://overlay.tar.gz + timeout: + minutes: 5 + to: flasher +- boot: + auto_login: + login_prompt: 'login:' + username: root + method: minimal + prompts: + - root@qcs6490-rb3gen2-core-kit + timeout: + minutes: 3 +- command: + name: network_turn_on +- test: + definitions: + - from: git + name: "{{ MACHINE }}-smoke-test" + path: automated/linux/smoke/smoke.yaml + repository: https://github.com/linaro/test-definitions.git + parameters: + SKIP_INSTALL: "True" + TESTS: "pwd, uname -a, ip a" +context: + lava_test_results_dir: /home/lava-%s + test_character_delay: 10 +device_type: qcs6490-rb3gen2-core-kit +job_name: boot test (qcs6490-rb3gen2-core-kit) 12591501185 +metadata: + downloads-url: "{{ DOWNLOADS_URL }}" +priority: 50 +tags: +- cambridge-lab +timeouts: + job: + minutes: 15 +visibility: public + From fcf07241c085fc946560783a373e8b1bb5f25379 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 24 Jan 2025 12:55:14 +0000 Subject: [PATCH 2/9] Add schema check to PR workflow Signed-off-by: Milosz Wasilewski --- .github/workflows/pr.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 4cfd9b3..75d7131 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -19,5 +19,7 @@ jobs: with: name: Event File path: ${{ github.event_path }} + schema-check: + uses: ./.github/workflows/lava-sanity.yml nightly: uses: ./.github/workflows/build.yml From d48195a0d67d7d626acfacbe40ee263aba422236 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 24 Jan 2025 12:58:11 +0000 Subject: [PATCH 3/9] Add more verbose output to schema validator Signed-off-by: Milosz Wasilewski --- schemacheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/schemacheck.py b/schemacheck.py index b8e5944..45482f1 100644 --- a/schemacheck.py +++ b/schemacheck.py @@ -1,6 +1,7 @@ import os import sys import yaml +import voluptuous from lava_common.schemas import validate exitcode = 0 @@ -15,8 +16,9 @@ y = yaml.safe_load(f) f.close() validate(y) - except: + except voluptuous.Invalid as exc: print(f"{filename} is invalid") + print(exc.msg) exitcode += 1 print(f"{filename} is valid") sys.exit(exitcode) From fd508b76f10fe95e176b495ed100b900d7e822be Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 24 Jan 2025 13:01:08 +0000 Subject: [PATCH 4/9] Add yaml error check Signed-off-by: Milosz Wasilewski --- schemacheck.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/schemacheck.py b/schemacheck.py index 45482f1..f641f97 100644 --- a/schemacheck.py +++ b/schemacheck.py @@ -16,9 +16,13 @@ y = yaml.safe_load(f) f.close() validate(y) - except voluptuous.Invalid as exc: + except voluptuous.Invalid as e1: print(f"{filename} is invalid") - print(exc.msg) + print(e1.msg) + exitcode += 1 + except yaml.parser.ParserError as e2: + print(f"{filename} is invalid") + print(e2.msg) exitcode += 1 print(f"{filename} is valid") sys.exit(exitcode) From e97e4f7d3e43bae898fe7d1a2a8bff42a6fdd451 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 24 Jan 2025 13:05:41 +0000 Subject: [PATCH 5/9] Fix error handling Signed-off-by: Milosz Wasilewski --- schemacheck.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schemacheck.py b/schemacheck.py index f641f97..71debc7 100644 --- a/schemacheck.py +++ b/schemacheck.py @@ -22,7 +22,8 @@ exitcode += 1 except yaml.parser.ParserError as e2: print(f"{filename} is invalid") - print(e2.msg) + print(e2.problem) + print(e2.note) exitcode += 1 print(f"{filename} is valid") sys.exit(exitcode) From d115633a19c8173749a47a90ed132eee072ef0c6 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 24 Jan 2025 13:07:08 +0000 Subject: [PATCH 6/9] Add more debug Signed-off-by: Milosz Wasilewski --- schemacheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/schemacheck.py b/schemacheck.py index 71debc7..e5854ea 100644 --- a/schemacheck.py +++ b/schemacheck.py @@ -23,7 +23,9 @@ except yaml.parser.ParserError as e2: print(f"{filename} is invalid") print(e2.problem) - print(e2.note) + print(e2.problem_mark) + print(e2.context) + print(e2.context_mark) exitcode += 1 print(f"{filename} is valid") sys.exit(exitcode) From e47fa3c6b4720583ddcd6f651dc10ac14adb73e8 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 24 Jan 2025 13:08:16 +0000 Subject: [PATCH 7/9] Reduce irrelevant debug Signed-off-by: Milosz Wasilewski --- schemacheck.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/schemacheck.py b/schemacheck.py index e5854ea..244bc71 100644 --- a/schemacheck.py +++ b/schemacheck.py @@ -24,8 +24,6 @@ print(f"{filename} is invalid") print(e2.problem) print(e2.problem_mark) - print(e2.context) - print(e2.context_mark) exitcode += 1 print(f"{filename} is valid") sys.exit(exitcode) From f0f171ecaea256db67ff2eb9fc381a4a67f3cea6 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 24 Jan 2025 13:08:53 +0000 Subject: [PATCH 8/9] Make the job parser fail at lava validation Signed-off-by: Milosz Wasilewski --- lava/rb3g2/invalid.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lava/rb3g2/invalid.yaml b/lava/rb3g2/invalid.yaml index b46e5c2..7303153 100644 --- a/lava/rb3g2/invalid.yaml +++ b/lava/rb3g2/invalid.yaml @@ -18,7 +18,7 @@ actions: timeout: minutes: 5 to: downloads - - deploy: +- deploy: images: image: url: downloads://core-image-base-qcs6490-rb3gen2-core-kit.rootfs.qcomflash.tar.gz @@ -41,7 +41,7 @@ actions: - command: name: network_turn_on - test: - definitions: + definitionssss: - from: git name: "{{ MACHINE }}-smoke-test" path: automated/linux/smoke/smoke.yaml @@ -53,7 +53,7 @@ context: lava_test_results_dir: /home/lava-%s test_character_delay: 10 device_type: qcs6490-rb3gen2-core-kit -job_name: boot test (qcs6490-rb3gen2-core-kit) 12591501185 +job_name: boot test {{ ABC }} (qcs6490-rb3gen2-core-kit) 12591501185 metadata: downloads-url: "{{ DOWNLOADS_URL }}" priority: 50 From 21b64dc994a3803c885aef33093bccc545ce52fe Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Fri, 24 Jan 2025 13:14:13 +0000 Subject: [PATCH 9/9] Add more debug to LAVA validator Signed-off-by: Milosz Wasilewski --- schemacheck.py | 1 + 1 file changed, 1 insertion(+) diff --git a/schemacheck.py b/schemacheck.py index 244bc71..925c7d2 100644 --- a/schemacheck.py +++ b/schemacheck.py @@ -19,6 +19,7 @@ except voluptuous.Invalid as e1: print(f"{filename} is invalid") print(e1.msg) + print(e1.path) exitcode += 1 except yaml.parser.ParserError as e2: print(f"{filename} is invalid")