name: codecs_attachment
plugin: attachment
requires: device.driver == 'snd_hda_intel'
command: cat /proc/asound/card*/codec#*
estimated_duration: 0.023
_description: Attaches a report of installed codecs for Intel HDA

name: cpuinfo_attachment
plugin: attachment
command: cat /proc/cpuinfo
estimated_duration: 0.006
_description: Attaches a report of CPU information

name: dmesg_attachment
plugin: attachment
command: cat /var/log/dmesg | ansi_parser
estimated_duration: 0.640
_description: Attaches a copy of /var/log/dmesg to the test results

name: dmi_attachment
plugin: attachment
command: grep -r . /sys/class/dmi/id/ 2>/dev/null
estimated_duration: 0.044
_description: Attaches info on DMI

name: dmidecode_attachment
plugin: attachment
requires: package.name == 'dmidecode'
user: root
command: dmidecode | iconv -t 'utf-8' -c
estimated_duration: 0.030
_description: Attaches dmidecode output

name: lshw_attachment
plugin: attachment
requires: package.name == 'lshw'
user: root
command: lshw | iconv -t 'utf-8' -c
_description: Attaches lshw output

name: efi_attachment
plugin: attachment
user: root
command: [ -d /sys/firmware/efi ] && grep -m 1 -o --color=never 'EFI v.*' /var/log/kern.log* || true
estimated_duration: 0.5
_description: Attaches the firmware version

name: lspci_attachment
plugin: attachment
command: lspci -vvnn | iconv -t 'utf-8' -c
estimated_duration: 0.042
_description: Attaches very verbose lspci output.

name: lspci_network_attachment
plugin: attachment
command: lspci -vvnnQ | iconv -t 'utf-8' -c
estimated_duration: 1.322
_description: Attaches very verbose lspci output (with central database Query).

name: lsusb_attachment
plugin: attachment
requires: package.name == 'usbutils'
user: root
command: lsusb -vv | iconv -t 'utf-8' -c
estimated_duration: 0.700
_description: List USB devices

name: meminfo_attachment
plugin: attachment
command: cat /proc/meminfo
estimated_duration: 0.043

name: modprobe_attachment
plugin: attachment
command: find /etc/modprobe.* -name \*.conf | xargs cat
estimated_duration: 0.015
_description: Attaches the contents of the various modprobe conf files.

name: modules_attachment
plugin: attachment
command: cat /etc/modules
estimated_duration: 0.004
_description: Attaches the contents of the /etc/modules file.

name: sysctl_attachment
plugin: attachment
command: find /etc/sysctl.* -name \*.conf | xargs cat
estimated_duration: 0.014
_description: attaches the contents of various sysctl config files.

name: sysfs_attachment
plugin: attachment
_description: Attaches a report of sysfs attributes.
command:
 for i in `udevadm info --export-db | sed -n 's/^P: //p'`; do
  echo "P: $i"
  udevadm info --attribute-walk --path=/sys$i 2>/dev/null | sed -n 's/    ATTR{\(.*\)}=="\(.*\)"/A: \1=\2/p'
  echo
 done
estimated_duration: 6.344

name: udev_attachment
plugin: attachment
command: udevadm info --export-db | xml_sanitize
estimated_duration: 1.465
_description: Attaches a dump of the udev database showing system hardware information.

name: udev_resource_attachment
plugin: attachment
command: udev_resource
estimated_duration: 0.432
_description: Attaches the output of udev_resource, for debugging purposes

name: gcov_attachment
plugin: attachment
requires: package.name == 'lcov'
user: root
command: gcov_tarball
_description: Attaches a tarball of gcov data if present.

name: lsmod_attachment
plugin: attachment
command: lsmod_info
estimated_duration: 0.5
_description: Attaches a list of the currently running kernel modules.

plugin: attachment
name: acpi_sleep_attachment
command: [ -e /proc/acpi/sleep ] && cat /proc/acpi/sleep
estimated_duration: 0.5
_description: Attaches the contents of /proc/acpi/sleep if it exists.

plugin: shell
name: info/bootchart
_description: Bootchart information.
requires: package.name == 'bootchart' or package.name == 'pybootchartgui'
user: root
command:
 process_wait -u root bootchart collector ureadahead; \
 [ `ls /var/log/bootchart/*.tgz 2>/dev/null | wc -l` -lt 2 ] && reboot && sleep 100

plugin: local
name: info/hdparm
_description: SATA/IDE device information.
requires:
 package.name == 'hdparm'
 device.category == 'DISK'
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=DISK"'
 plugin: attachment
 name: info/hdparm_`ls /sys$path/block`.txt
 requires:
  device.path == "$path"
  block_device.`ls /sys$path/block`_state != 'removable'
 user: root
 command: hdparm -I /dev/`ls /sys$path/block`
 EOF

plugin: attachment
name: bootchart.png
depends: info/bootchart
requires: package.name == 'pybootchartgui'
_description: Attaches the bootchart png file for bootchart runs
command:
 file=`ls /var/log/bootchart/*.png 2>/dev/null | tail -1`; \
 [ -e "$file" ] && cat "$file"

plugin: attachment
name: bootchart.tgz
depends: info/bootchart
_description: Attaches the bootchart log for bootchart test runs.
command:
 file=`ls /var/log/bootchart/*.tgz 2>/dev/null | tail -1`; \
 [ -e "$file" ] && cat "$file"

plugin: attachment
name: installer_bootchart.tgz
command: [ -e /var/log/installer/bootchart.tgz ] && cat /var/log/installer/bootchart.tgz
_description: installs the installer bootchart tarball if it exists.

plugin: attachment
name: installer_debug.gz
command: [ -e /var/log/installer/debug ] && gzip -9 -c /var/log/installer/debug
estimated_duration: 0.1
_description: Attaches the installer debug log if it exists.

plugin: attachment
name: info/touchpad_driver
requires: device.category == 'TOUCHPAD'
command: touchpad_driver_info
estimated_duration: 0.384
_description:
 Returns the name, driver name and driver version of any touchpad discovered on
 the system.

plugin: attachment
name: info/audio_device_driver
requires:
 package.name == 'pulseaudio-utils'
 package.name == 'module-init-tools'
 device.category == 'AUDIO'
command: audio_driver_info
estimated_duration: 0.177
_description: Lists the device driver and version for all audio devices.

plugin: attachment
name: info/network_devices
requires:
 device.category == 'NETWORK' or device.category == 'WIRELESS'
 package.name == 'module-init-tools'
 package.name == 'pciutils'
command: network_device_info
estimated_duration: 0.550
_description: Provides information about network devices

plugin: attachment
name: info/xrandr
command: xrandr -q --verbose
_description: Provides information about displays attached to the system

plugin: attachment
name: info/disk_partitions
user: root
command: parted -l
_description: Attaches information about disk partitions
