From 783eb4eb95205be03a027c2951c33594bb8c7942 Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Tue, 18 Oct 2016 19:49:07 +0200 Subject: 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. --- jobs/miscellanea.txt.in | 5 +++++ jobs/submission.txt.in | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 jobs/submission.txt.in (limited to 'jobs') diff --git a/jobs/miscellanea.txt.in b/jobs/miscellanea.txt.in index 8710fed1..882838bc 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 00000000..9851d3a7 --- /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. -- cgit v1.2.3