Merge ~sylvain-pineau/plainbox-provider-checkbox:fix-1854862 into plainbox-provider-checkbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: c09ca46a279eba2a4632e88509c7229d43cd3c49
Merged at revision: a0d88b59d3c15ca5af38d9f60821c1fc56848715
Proposed branch: ~sylvain-pineau/plainbox-provider-checkbox:fix-1854862
Merge into: plainbox-provider-checkbox:master
Diff against target: 16 lines (+3/-1)
1 file modified
units/submission/jobs.pxu (+3/-1)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Devices Certification Bot Needs Fixing
Jonathan Cave (community) Approve
Review via email: mp+392528@code.launchpad.net

Commit message

submission: Add a new boot mode property to the existing BIOS dict in the raw_devices_dmi_json job.

This info is extracted from inxi output and can take the following values: BIOS, UEFI, or UEFI [Legacy].

Description of the change

Add a new boot mode property to the existing BIOS dict in the raw_devices_dmi_json job.

This info is extracted from inxi output and can take the following values: BIOS, UEFI, or UEFI [Legacy].

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

The boot mode identification did not work on the device i tested with. The output from inxi_snapshot was:

inxi_snapshot -M --output json --output-file print
{"000#Machine":[{"004#UEFI":"American Megatrends","005#v":"1.11","002#model":"UNO-420","003#serial":"N/A","001#Mobo":"Advantech","000#Type":"Desktop","006#date":"08/30/2019"}]}

review: Needs Fixing
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

New version using grep and not only jq

review: Needs Resubmitting
Revision history for this message
Jonathan Cave (jocave) wrote :

Looks better here. Tested on a couple of machines and both produced reasonable looking json.

review: Approve
Revision history for this message
Devices Certification Bot (ce-certification-qa) wrote :

The merge was fine but running tests failed.

[xenial] [07:37:09] starting container
Device project added to xenial-testing
[focal] [07:37:17] starting container
Device project added to focal-testing
[xenial] [07:37:21] provisioning container
[focal] [07:37:34] provisioning container
[xenial] [07:37:35] Starting tests...
[xenial] Found a test script: ./requirements/container-tests-provider-checkbox
[focal] [07:38:07] Starting tests...
[focal] Found a test script: ./requirements/container-tests-provider-checkbox
[bionic] [07:38:38] starting container
Device project added to bionic-testing
[bionic] [07:38:56] provisioning container
[bionic] [07:39:12] Starting tests...
[bionic] Found a test script: ./requirements/container-tests-provider-checkbox
[xenial] [07:39:23] container-tests-provider-checkbox: FAIL
[xenial] output: https://paste.ubuntu.com/p/xtSkp9jhcy/
[xenial] [07:39:26] Fixing file permissions in source directory
[xenial] [07:39:26] Destroying container
[focal] [07:39:52] container-tests-provider-checkbox: PASS
[focal] [07:39:52] Fixing file permissions in source directory
[focal] [07:39:53] Destroying container
[bionic] [07:40:59] container-tests-provider-checkbox: PASS
[bionic] [07:40:59] Fixing file permissions in source directory
[bionic] [07:40:59] Destroying container

review: Needs Fixing
Revision history for this message
Devices Certification Bot (ce-certification-qa) wrote :

I tried to merge it but there are some problems. Typically you want to merge or rebase and try again.

review: Needs Fixing
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

self-approved after shellcheck disable addition

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/units/submission/jobs.pxu b/units/submission/jobs.pxu
2index 892d4e6..a8c8c7f 100644
3--- a/units/submission/jobs.pxu
4+++ b/units/submission/jobs.pxu
5@@ -22,8 +22,10 @@ requires:
6 dmi_present.state == 'supported'
7 user: root
8 command:
9+ BOOT_MODE=$(inxi_snapshot -M --output json --output-file print | grep -oP '(?<=\d#)(UEFI|BIOS)(\s+\[Legacy\])?')
10+ # shellcheck disable=SC2016
11 dmidecode | python3 -m plainbox dev parse dmidecode | \
12- jq '[.[] | ._attributes + {"category": .category}]'
13+ jq --arg BOOT_MODE "$BOOT_MODE" '[.[] | ._attributes + {"category": .category} + (if .category == "BIOS" then {boot_mode: $BOOT_MODE} else {} end)]'
14 estimated_duration: 1
15 _description: Attaches dmidecode output
16 _summary: Attaches json dumps of raw dmi devices

Subscribers

People subscribed via source and target branches