diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2016-10-18 19:49:07 +0200 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2016-10-18 19:49:07 +0200 |
commit | 783eb4eb95205be03a027c2951c33594bb8c7942 (patch) | |
tree | 5e49ec06c01899c3abeb687c7f1c6fc22774db2e /jobs | |
parent | ced1c5c8a681e8c24969ea2ff07a0d992fa868c1 (diff) |
A set of new "_json" attachments jobs to help building the new json report
The new JSON exporter aggregates json blobs from resources and attachments. This conversion was previously done at checkbox-support level thanks to dedicated parsers (udevadm, meminfo, cpuifo, dkms, ...). To avoid depending on those parsers in plainbox, the trick is to call those parsers using 'plainbox dev parse' and a few 'jq' calls to match C3 needs.
Diffstat (limited to 'jobs')
-rw-r--r-- | jobs/miscellanea.txt.in | 5 | ||||
-rw-r--r-- | jobs/submission.txt.in | 54 |
2 files changed, 59 insertions, 0 deletions
diff --git a/jobs/miscellanea.txt.in b/jobs/miscellanea.txt.in index 8710fed..882838b 100644 --- a/jobs/miscellanea.txt.in +++ b/jobs/miscellanea.txt.in @@ -13,6 +13,11 @@ depends: lsblk_attachment sysfs_attachment udev_attachment + dkms_info_json + udev_json + raw_devices_dmi_json + modprobe_json + lspci_standard_config_json estimated_duration: 1.0 command: true _summary: diff --git a/jobs/submission.txt.in b/jobs/submission.txt.in new file mode 100644 index 0000000..9851d3a --- /dev/null +++ b/jobs/submission.txt.in @@ -0,0 +1,54 @@ +id: dkms_info_json +plugin: attachment +category_id: 2013.com.canonical.plainbox::info +command: dkms_info --format json | plainbox dev parse dkms-info +_description: Attaches json dumps of installed dkms package information. +_summary: Attaches json dumps of installed dkms package information. + +id: udev_json +plugin: attachment +category_id: 2013.com.canonical.plainbox::info +command: udevadm info --export-db | plainbox dev parse udevadm +_description: Attaches json dumps of udev_resource + +unit: packaging meta-data +os-id: debian +Depends: jq + +unit: packaging meta-data +os-id: debian +Depends: plainbox + +id: raw_devices_dmi_json +plugin: attachment +category_id: 2013.com.canonical.plainbox::info +requires: package.name == 'dmidecode' +user: root +command: + dmidecode -t bios -t system | plainbox dev parse dmidecode | \ + jq --indent 4 '{"raw-devices-dmi": [.[0]."_attributes" + + {"category": .[0]."category"}, .[1]."_attributes" + + {"category": .[1]."category"}]}' +estimated_duration: 1 +_description: Attaches dmidecode output +_summary: Attaches json dumps of udev_resource raw dmi devices + +id: modprobe_json +plugin: attachment +category_id: 2013.com.canonical.plainbox::info +command: + find /etc/modprobe.* -name \*.conf | xargs cat | plainbox dev parse modprobe | + jq --indent 4 'to_entries | {"modprobe-info": + map({"module": .key, "options": .value})}' +estimated_duration: 0.015 +_description: Attaches the contents of the various modprobe conf files. +_summary: Attach the contents of /etc/modprobe.* + +id: lspci_standard_config_json +_summary: Attach PCI configuration space hex dump +plugin: attachment +category_id: 2013.com.canonical.plainbox::info +command: lspci -x | plainbox dev parse pci-subsys-id +estimated_duration: 0.1 +_description: Attaches a hex dump of the standard part of the PCI configuration + space for all PCI devices. |