plugin: shell
name: miscellanea/submission-resources
depends: cpuinfo dpkg lsb package uname
estimated_duration: 1.0
command: true
_description:
    A meta-job depending on the resources needed for a valid submission.

plugin: manual
name: miscellanea/tester-info
_description:
 PURPOSE:
     Keep tester related information in the report
 STEPS:
     1. Tester Information
     2. Please enter the following information in the comments field:
        a. Name
        b. Email Address
        c. Reason for this test run
 VERIFICATION:
     Nothing to verify for this test

plugin: user-interact-verify
name: miscellanea/chvt
requires:
 package.name == 'kbd'
user: root
command: cycle_vts
_description:
 PURPOSE:
     This test will check that the system can switch to a virtual terminal and back to X
 STEPS:
     1. Click "Test" to switch to another virtual terminal and then back to X
 VERIFICATION:
     Did your screen change temporarily to a text console and then switch back to your current session?

plugin: shell
name: miscellanea/fwts_test
requires:
  package.name == 'fwts'
user: root
_description:
 Run Firmware Test Suite (fwts) automated tests.
environ: CHECKBOX_DATA
command:
 fwts_test -l $CHECKBOX_DATA/fwts_results.log

plugin: attachment
name: miscellanea/fwts_results.log
command:
 [[ -e ${CHECKBOX_DATA}/fwts_results.log ]] && cat ${CHECKBOX_DATA}/fwts_results.log
_description: Attaches the FWTS results log to the submission

plugin: shell
name: miscellanea/ipmi_test
requires: package.name == 'ipmitool'
user: root
command: ipmi_test
_description:
 This will run some basic connectivity tests against a BMC, verifying that IPMI works.

plugin: shell
name: miscellanea/is_laptop
user: root
_description:
    Determine if we need to run tests specific to portable computers that may not apply to desktops.
command: check_is_laptop

plugin: shell
name: miscellanea/apport-directory
requires: package.name == 'apport'
command: if [ -d /var/crash ]; then if [ $(find /var/crash -type f | grep -v .lock | wc -l) -eq 0 ]; then echo "/var/crash is empty"; else echo `ls /var/crash`; false; fi; else echo "/var/crash does not exist"; fi
_description:
 Test that the /var/crash directory doesn't contain anything. Lists the files contained within if it does, or echoes the status of the directory (doesn't exist/is empty)

plugin: shell
name: miscellanea/sources-list
command: sources_test $SOURCES_LIST "$REPOSITORIES"
_description: Checks that a specified sources list file contains the requested repositories

plugin: local
name: miscellanea/pxe_boot
requires: device.category == 'NETWORK'
_description: Automated job to generate the PXE verification test for each NIC.
command:
 cat <<'EOF' | run_templates -s 'udev_resource | filter_templates -w "category=NETWORK" | awk "/path: / { print \$2 }" | xargs -n 1 sh -c "for i in \`ls /sys\$0/net 2>/dev/null\`; do echo \$0 \$i; done"'
 plugin: manual
 name: miscellanea/pxe_boot_$2
 description:
  PURPOSE:
    This test will verify that you have attempted to PXE boot this machine from
    the network device $2.
  STEPS:
    1. Prior to running this test, you should have attempted to boot this system via PXE on every Network Port available.
  VERIFICATION:
    1. Select Yes if you successfully used PXE boot this system using the NIC $2
    2. Select No if you did not attempt to PXE boot this system using the NIC $2
    3. Select No if you attempted to PXE boot via $2 and it failed for some reason.
 EOF

plugin: local
name: miscellanea/remote_shared_ipmi
requires: device.category == 'NETWORK'
_description: Automated job to generate the Remote Shared IPMI verification test for each NIC.
command:
 cat <<'EOF' | run_templates -s 'udev_resource | filter_templates -w "category=NETWORK" | awk "/path: / { print \$2 }" | xargs -n 1 sh -c "for i in \`ls /sys\$0/net 2>/dev/null\`; do echo \$0 \$i; done"'
 plugin: manual
 name: miscellanea/remote_shared_ipmi_$2
 description:
  PURPOSE:
    This test will verify that you have attempted IPMI control of this machine from the network device $2.
  STEPS:
    1. Prior to running this test, you should have configured and used IPMI to power this machine off and on using every Network Port available.
  VERIFICATION:
    1. Select Yes if you successfully used IPMI to remotely power this system off and on using the NIC $2
    2. Select No if you did not attempt to use IPMI to remotely power this sytem off and on via the NIC $2
    3. Select No if you attempted to use IPMI to remotely power off/on this system via $2 and it failed for some reason.
 EOF

plugin: manual
name: miscellanea/remote_dedicated_ipmi
_description:
 PURPOSE:
  Some systems do not share IPMI over all NICs but instead have a dedicated management port directly connected to the BMC.  This test verifies that you have used that port for remote IPMI connections and actions.
 STEPS:
  1. Prior to running the test, you should have configured and used the Dedicated Management Port to remotely power off/on this sytem.
 VERIFICATION:
  Skip this test if this system ONLY uses shared management/ethernet ports OR if this system does not have a BMC (Management Console)
  1. Select Yes if you successfully used IPMI to remotely power this system off and on using the dedicated management port.
  2. Select No if you attempted to use the dedicated management port to remotely power this system off/on and it failed for some reason.
