diff options
-rwxr-xr-x | bin/disk_stats_test | 6 | ||||
-rwxr-xr-x | bin/network_device_info.py (renamed from bin/network_device_info) | 131 | ||||
-rwxr-xr-x | bin/removable_storage_test | 12 | ||||
-rwxr-xr-x | bin/sleep_time_check | 17 | ||||
-rwxr-xr-x | bin/storage_test | 9 | ||||
-rwxr-xr-x | bin/wifi_nmcli_backup.py | 79 | ||||
-rwxr-xr-x | bin/wifi_nmcli_test.py (renamed from bin/wifi_nmcli_test) | 36 | ||||
-rw-r--r-- | units/ethernet/jobs.pxu | 6 | ||||
-rw-r--r-- | units/ethernet/manifest.pxu | 4 | ||||
-rw-r--r-- | units/gpgpu/category.pxu | 3 | ||||
-rw-r--r-- | units/gpgpu/jobs.pxu | 8 | ||||
-rw-r--r-- | units/gpgpu/test-plan.pxu | 8 | ||||
-rw-r--r-- | units/graphics/test-plan.pxu | 96 | ||||
-rw-r--r-- | units/info/jobs.pxu | 2 | ||||
-rw-r--r-- | units/oob-management/jobs.pxu | 4 | ||||
-rw-r--r-- | units/stress/jobs.pxu | 41 | ||||
-rw-r--r-- | units/stress/test-plan.pxu | 10 | ||||
-rw-r--r-- | units/suspend/suspend-graphics.pxu | 50 | ||||
-rw-r--r-- | units/wireless/jobs.pxu | 42 | ||||
-rw-r--r-- | units/wireless/test-plan.pxu | 20 |
20 files changed, 402 insertions, 182 deletions
diff --git a/bin/disk_stats_test b/bin/disk_stats_test index 3c88a6c..60b48f5 100755 --- a/bin/disk_stats_test +++ b/bin/disk_stats_test @@ -26,6 +26,12 @@ if [[ "$1" != '' ]]; then DISK="$1" fi +nvdimm="pmem" +if [ -z "${DISK##*$nvdimm*}" ];then + echo "Disk $DISK appears to be an NVDIMM, skipping" + exit $STATUS +fi + #Check /proc/partitions, exit with fail if disk isn't found grep -w -q $DISK /proc/partitions check_return_code $? "Disk $DISK not found in /proc/partitions" diff --git a/bin/network_device_info b/bin/network_device_info.py index 174fbe8..29a4aed 100755 --- a/bin/network_device_info +++ b/bin/network_device_info.py @@ -17,7 +17,7 @@ # NetworkManager # http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python # -# Copyright (C) 2012 Canonical, Ltd. +# Copyright (C) 2012-2019 Canonical, Ltd. from subprocess import check_output, CalledProcessError, STDOUT import sys @@ -125,7 +125,7 @@ class NetworkingDevice(): cmd = ['/sbin/modinfo', driver] try: stream = check_output(cmd, stderr=STDOUT, universal_newlines=True) - except CalledProcessError as err: + except CalledProcessError: return None if not stream: @@ -156,6 +156,35 @@ class NetworkingDevice(): return "%d.%d.%d.%d" % (ip[0], ip[1], ip[2], ip[3]) +def print_udev_devices(): + print("[ Devices found by udev ]".center(80, '-')) + for device in udev_devices: + for attribute in attributes: + value = getattr(device, attribute) + if value is not None: + if attribute == 'driver': + props = {} + props['Driver'] = value + network_dev = NetworkingDevice( + None, props, None, None) + print("%s: %s (ver: %s)" % ( + attribute.capitalize(), value, + network_dev._driver_ver)) + else: + print("%s: %s" % (attribute.capitalize(), value)) + vendor_id = getattr(device, 'vendor_id') + product_id = getattr(device, 'product_id') + subvendor_id = getattr(device, 'subvendor_id') + subproduct_id = getattr(device, 'subproduct_id') + if vendor_id and product_id: + print("ID: [{0:04x}:{1:04x}]".format( + vendor_id, product_id)) + if subvendor_id and subproduct_id: + print("Subsystem ID: [{0:04x}:{1:04x}]".format( + subvendor_id, subproduct_id)) + print() + + def get_nm_devices(): devices = [] bus = dbus.SystemBus() @@ -183,30 +212,11 @@ def get_nm_devices(): return devices -def match_counts(nm_devices, udev_devices, devtype): - """ - Ensures that the count of devices matching devtype is the same for the - two passed in lists, devices from Network Manager and devices from lspci. - """ - # now check that the count (by type) matches - nm_type_devices = [dev for dev in nm_devices if dev.gettype() in devtype] - udevtype = 'NETWORK' - udev_type_devices = [ - udev - for udev in udev_devices - if udev.category == udevtype] - if len(nm_type_devices) != len(udev_type_devices): - print("ERROR: devices missing - udev showed %d %s devices, but " - "NetworkManager saw %d devices in %s" % - (len(udev_type_devices), udevtype, - len(nm_type_devices), devtype), - file=sys.stderr) - return False - else: - return True - - -def main(args): +def main(): + if len(sys.argv) != 2 or sys.argv[1] not in ('detect', 'info'): + raise SystemExit('ERROR: please specify detect or info') + action = sys.argv[1] + try: output = check_output(['udevadm', 'info', '--export-db']) except CalledProcessError as err: @@ -219,48 +229,33 @@ def main(args): result = UdevResult() udev.run(result) - if udev_devices: - print("[ Devices found by udev ]".center(80, '-')) - for device in udev_devices: - for attribute in attributes: - value = getattr(device, attribute) - if value is not None: - if attribute == 'driver': - props = {} - props['Driver'] = value - network_dev = NetworkingDevice(None, props, None, None) - print("%s: %s (ver: %s)" % (attribute.capitalize(), - value, network_dev._driver_ver)) - else: - print("%s: %s" % (attribute.capitalize(), value)) - vendor_id = getattr(device, 'vendor_id') - product_id = getattr(device, 'product_id') - subvendor_id = getattr(device, 'subvendor_id') - subproduct_id = getattr(device, 'subproduct_id') - if vendor_id and product_id: - print("ID: [{0:04x}:{1:04x}]".format(vendor_id, product_id)) - if subvendor_id and subproduct_id: - print("Subsystem ID: [{0:04x}:{1:04x}]".format(subvendor_id, subproduct_id)) - print() + # The detect action should indicate presence of an ethernet adatper and + # cause the job to fail if none present - rely on udev for this + if action == 'detect': + if udev_devices: + print_udev_devices() + else: + raise SystemExit('No devices detected by udev') + + # The info action should just gather infomation about any ethernet devices + # found and report for inclusion in e.g. an attachment job + if action == 'info': + # Report udev detected devices first + if udev_devices: + print_udev_devices() + + # Attempt to report devices found by NetworkManager - this doesn't + # make sense for server installs so skipping is acceptable + try: + nm_devices = get_nm_devices() + except dbus.exceptions.DBusException: + # server's don't have network manager installed + print('Network Manager not found') + else: + print("[ Devices found by Network Manager ]".center(80, '-')) + for nm_dev in nm_devices: + print(nm_dev) - try: - nm_devices = get_nm_devices() - except dbus.exceptions.DBusException as e: - # server's don't have network manager installed - print("Warning: Exception while talking to Network Manager over dbus." - " Skipping the remainder of this test. If this is a server, this" - " is expected.", file=sys.stderr) - print("The Error Generated was:\n %s" % e, file=sys.stderr) - return 0 - - print("[ Devices found by Network Manager ]".center(80, '-')) - for nm_dev in nm_devices: - print(nm_dev) - - if not match_counts(nm_devices, udev_devices, "Ethernet"): - return 1 - else: - return 0 if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) + main() diff --git a/bin/removable_storage_test b/bin/removable_storage_test index 6de3f97..a7abdfe 100755 --- a/bin/removable_storage_test +++ b/bin/removable_storage_test @@ -21,6 +21,7 @@ from checkbox_support.dbus import connect_to_system_bus from checkbox_support.dbus.udisks2 import UDISKS2_BLOCK_INTERFACE from checkbox_support.dbus.udisks2 import UDISKS2_DRIVE_INTERFACE from checkbox_support.dbus.udisks2 import UDISKS2_FILESYSTEM_INTERFACE +from checkbox_support.dbus.udisks2 import UDISKS2_LOOP_INTERFACE from checkbox_support.dbus.udisks2 import UDisks2Model, UDisks2Observer from checkbox_support.dbus.udisks2 import is_udisks2_supported from checkbox_support.dbus.udisks2 import lookup_udev_device @@ -38,6 +39,7 @@ from checkbox_support.udev import get_udev_xhci_devices class ActionTimer(): '''Class to implement a simple timer''' + def __enter__(self): self.start = time.time() return self @@ -49,6 +51,7 @@ class ActionTimer(): class RandomData(): '''Class to create data files''' + def __init__(self, size): self.tfile = tempfile.NamedTemporaryFile(delete=False) self.path = '' @@ -299,7 +302,8 @@ class DiskTest(): udev_devices = get_udev_block_devices(GUdev.Client()) for udev_device in udev_devices: if udev_device.get_device_file() == dev_file: - interconnect_speed = get_interconnect_speed(udev_device) + interconnect_speed = get_interconnect_speed( + udev_device) if interconnect_speed: self.rem_disks_speed[dev_file] = ( interconnect_speed * 10 ** 6) @@ -329,7 +333,8 @@ class DiskTest(): """ for udisks2_object_path, interfaces in udisks2_objects.items(): if (UDISKS2_FILESYSTEM_INTERFACE in interfaces and - UDISKS2_BLOCK_INTERFACE in interfaces): + UDISKS2_BLOCK_INTERFACE in interfaces and + UDISKS2_LOOP_INTERFACE not in interfaces): yield udisks2_object_path # We need to know about all IO candidates, # let's iterate over all the block devices reported by udisks2 @@ -605,7 +610,7 @@ def main(): help=("Detect the driver of the host controller." "Only xhci_hcd for usb3 is supported so far.")) parser.add_argument("--lsblkcommand", action='store', type=str, - default="lsblk -i -n -P -o KNAME,TYPE,MOUNTPOINT", + default="lsblk -i -n -P -e 7 -o KNAME,TYPE,MOUNTPOINT", help=("Command to execute to get lsblk information. " "Only change it if you know what you're doing.")) @@ -870,5 +875,6 @@ def main(): logging.error("No removable drives were detected, aborting") return 1 + if __name__ == '__main__': sys.exit(main()) diff --git a/bin/sleep_time_check b/bin/sleep_time_check index 9e7f084..f9513fa 100755 --- a/bin/sleep_time_check +++ b/bin/sleep_time_check @@ -41,12 +41,17 @@ def main(): resume_times = [] # find our times for line in lines: - if "Average time to sleep" in line: - sleep_time = float(line.split(':')[1].strip()) - sleep_times.append(sleep_time) - elif "Average time to resume" in line: - resume_time = float(line.split(':')[1].strip()) - resume_times.append(resume_time) + try: + if "Average time to sleep" in line: + sleep_time = float(line.split(':')[1].strip()) + sleep_times.append(sleep_time) + elif "Average time to resume" in line: + resume_time = float(line.split(':')[1].strip()) + resume_times.append(resume_time) + except ValueError as e: + print("ERROR: One or more times was not reported correctly:") + print(e) + return 1 if (sleep_time is None or resume_time is None) or \ (len(sleep_times) != len(resume_times)): diff --git a/bin/storage_test b/bin/storage_test index da4b717..9649dc1 100755 --- a/bin/storage_test +++ b/bin/storage_test @@ -59,7 +59,7 @@ find_largest_lv() { } # find_largest_lv() -# Find the largest partition that holds a supported filesystem on $disk_device. +# Find the largest partition that holds a supported filesystem on $disk. # This code is adapted from a similar function in `disk_stress_ng`. # Output: # $largest_part -- Device filename of largest qualifying partition or logical volume @@ -67,13 +67,14 @@ find_largest_lv() { # $largest_fs -- Filesystem (ext4, etc.) used on largest qualifying partition or logical volume # $unsupported_fs -- Empty or contains name of unsupported filesystem found on disk find_largest_partition() { + echo "Find largest partition on $disk..." largest_part="" largest_size=0 mapper_string="dm-" - if [ "${disk_device#*$mapper_string}" = "$disk_device" ]; then - partitions=$(lsblk -b -l -n -o NAME,SIZE,TYPE,MOUNTPOINT $disk_device | grep part | tr -s " ") + if [ "${disk_device#*$mapper_string}" = "$disk" ]; then + partitions=$(lsblk -b -l -n -o NAME,SIZE,TYPE,MOUNTPOINT $disk | grep part | tr -s " ") else - partitions=$(lsblk -b -l -n -o NAME,SIZE,TYPE,MOUNTPOINT $disk_device) + partitions=$(lsblk -b -l -n -o NAME,SIZE,TYPE,MOUNTPOINT $disk) fi unsupported_fs="" for partition in $(echo "$partitions" | cut -d " " -f 1) ; do diff --git a/bin/wifi_nmcli_backup.py b/bin/wifi_nmcli_backup.py new file mode 100755 index 0000000..7ec9c89 --- /dev/null +++ b/bin/wifi_nmcli_backup.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +# Copyright 2019 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Jonathan Cave <jonathan.cave@canonical.com> +# +# Save/Restore NetworkManager wifi connections + +import os +import shutil +import subprocess as sp +import sys + +NM_CON_DIR = '/etc/NetworkManager/system-connections' +SAVE_DIR = os.path.join(os.path.expandvars( + '$PLAINBOX_SESSION_SHARE'), 'stored-system-connections') + + +def get_nm_connections(): + c = [] + cmd = 'nmcli -t -f TYPE,NAME c' + output = sp.check_output(cmd, shell=True) + for line in output.decode(sys.stdout.encoding).splitlines(): + con_type, name = line.strip().split(':') + if con_type == '802-11-wireless': + c.append(name) + return c + + +def reload_nm_connections(): + cmd = 'nmcli c reload' + sp.check_call(cmd, shell=True) + + +def save_connections(con_list): + if len(con_list) == 0: + print('No stored 802.11 connections to save') + return + if not os.path.exists(SAVE_DIR): + os.makedirs(SAVE_DIR) + for c in con_list: + print('Save connection {}'.format(c)) + c_loc = os.path.join(NM_CON_DIR, c) + if not os.path.exists(c_loc): + print(' No stored connection fount at {}'.format(c_loc)) + continue + print(' Found file {}'.format(c_loc)) + save_f = shutil.copy(c_loc, SAVE_DIR) + print(' Saved copy at {}'.format(save_f)) + + +def restore_connections(): + saved_list = [f for f in os.listdir( + SAVE_DIR) if os.path.isfile(os.path.join(SAVE_DIR, f))] + if len(saved_list) == 0: + print('No stored 802.11 connections found') + return + for f in saved_list: + save_f = os.path.join(SAVE_DIR, f) + print('Restore connection {}'.format(save_f)) + restore_f = shutil.copy(save_f, NM_CON_DIR) + print(' Restored file at {}'.format(restore_f)) + os.remove(save_f) + print(' Removed copy from {}'.format(save_f)) + + +if __name__ == '__main__': + if len(sys.argv) != 2: + raise SystemExit('ERROR: please specify save or restore') + action = sys.argv[1] + + if action == 'save': + save_connections(get_nm_connections()) + elif action == 'restore': + restore_connections() + reload_nm_connections() + else: + raise SystemExit('ERROR: unrecognised action') diff --git a/bin/wifi_nmcli_test b/bin/wifi_nmcli_test.py index b89a525..45b8624 100755 --- a/bin/wifi_nmcli_test +++ b/bin/wifi_nmcli_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2017-2018 Canonical Ltd. +# Copyright 2017-2019 Canonical Ltd. # All rights reserved. # # Written by: @@ -13,6 +13,7 @@ import argparse import functools import subprocess as sp import sys +import time from distutils.version import LooseVersion @@ -61,7 +62,13 @@ def device_rescan(): print_head("Calling a rescan") cmd = "nmcli d wifi rescan" print_cmd(cmd) - sp.call(cmd, shell=True) + retcode = sp.call(cmd, shell=True) + if retcode != 0: + # Most often the rescan request fails because NM has itself started + # a scan in recent past, we should let these operations complete before + # attempting a connection + print('Scan request failed, allow other operations to complete (15s)') + time.sleep(15) print() @@ -73,7 +80,8 @@ def list_aps(args): cmd = "nmcli -t -f {} d wifi list iface {}".format(fields, args.device) else: fields = "SSID,CHAN,FREQ,SIGNAL" - cmd = "nmcli -t -f {} d wifi list ifname {}".format(fields, args.device) + cmd = "nmcli -t -f {} d wifi list ifname {}".format( + fields, args.device) print_cmd(cmd) output = sp.check_output(cmd, shell=True) for line in output.decode(sys.stdout.encoding).splitlines(): @@ -108,10 +116,11 @@ def open_connection(args): print_cmd(cmd) sp.call(cmd, shell=True) if legacy_nmcli(): - cmd_part = "nmcli -m tabular -t -f GENERAL d list | " - cmd = cmd_part + "grep {} | awk -F: '{{print $15}}'".format(args.device) + cmd = ("nmcli -m tabular -t -f GENERAL d list | grep {} | " + "awk -F: '{{print $15}}'".format(args.device)) else: - cmd = "nmcli -m tabular -t -f GENERAL.STATE d show {}".format(args.device) + cmd = "nmcli -m tabular -t -f GENERAL.STATE d show {}".format( + args.device) print_cmd(cmd) output = sp.check_output(cmd, shell=True) state = output.decode(sys.stdout.encoding).strip() @@ -126,18 +135,19 @@ def open_connection(args): def secured_connection(args): print_head("Connection attempt") if legacy_nmcli(): - cmd = "nmcli d wifi connect {} password {} iface {} name TEST_CON".format( - args.essid, args.psk, args.device) + cmd = ("nmcli d wifi connect {} password {} iface {} name " + "TEST_CON".format(args.essid, args.psk, args.device)) else: - cmd = "nmcli d wifi connect {} password {} ifname {} name TEST_CON".format( - args.essid, args.psk, args.device) + cmd = ("nmcli d wifi connect {} password {} ifname {} name " + "TEST_CON".format(args.essid, args.psk, args.device)) print_cmd(cmd) sp.call(cmd, shell=True) if legacy_nmcli(): - cmd_part = "nmcli -m tabular -t -f GENERAL d list | " - cmd = cmd_part + "grep {} | awk -F: '{{print $15}}'".format(args.device) + cmd = ("nmcli -m tabular -t -f GENERAL d list | " + "grep {} | awk -F: '{{print $15}}'".format(args.device)) else: - cmd = "nmcli -m tabular -t -f GENERAL.STATE d show {}".format(args.device) + cmd = "nmcli -m tabular -t -f GENERAL.STATE d show {}".format( + args.device) print_cmd(cmd) output = sp.check_output(cmd, shell=True) state = output.decode(sys.stdout.encoding).strip() diff --git a/units/ethernet/jobs.pxu b/units/ethernet/jobs.pxu index cf1c02b..15625a5 100644 --- a/units/ethernet/jobs.pxu +++ b/units/ethernet/jobs.pxu @@ -2,13 +2,15 @@ plugin: shell category_id: com.canonical.plainbox::ethernet id: ethernet/detect flags: also-after-suspend -command: network_device_info +command: network_device_info.py detect estimated_duration: 2.0 _summary: - Report info about available network devices + Detect if at least one ethernet device is detected _description: Test to detect and return information about available network controllers on the system under test. +imports: from com.canonical.plainbox import manifest +requires: manifest.has_ethernet_adapter == 'True' plugin: shell category_id: com.canonical.plainbox::ethernet diff --git a/units/ethernet/manifest.pxu b/units/ethernet/manifest.pxu new file mode 100644 index 0000000..6936344 --- /dev/null +++ b/units/ethernet/manifest.pxu @@ -0,0 +1,4 @@ +unit: manifest entry +id: has_ethernet_adapter +_name: An Ethernet Adapter +value-type: bool diff --git a/units/gpgpu/category.pxu b/units/gpgpu/category.pxu new file mode 100644 index 0000000..e07d1b4 --- /dev/null +++ b/units/gpgpu/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: gpgpu +_name: GPGPU Compute Tests diff --git a/units/gpgpu/jobs.pxu b/units/gpgpu/jobs.pxu new file mode 100644 index 0000000..2c823a0 --- /dev/null +++ b/units/gpgpu/jobs.pxu @@ -0,0 +1,8 @@ +id: gpgpu/gpu-burn +category_id: gpgpu +plugin: shell +estimated_duration: 300 +requires: + package.name == 'cuda' +_summary: GPGPU stress testing +command: cd /opt/gpu-burn/ && ./gpu_burn 1800 diff --git a/units/gpgpu/test-plan.pxu b/units/gpgpu/test-plan.pxu new file mode 100644 index 0000000..eaf0db8 --- /dev/null +++ b/units/gpgpu/test-plan.pxu @@ -0,0 +1,8 @@ +id: gpgpu-tests +unit: test plan +_name: GPGPU Compute Testing +_description: + Tests for GPGPU Computations (non-graphical) +mandatory_include: + gpgpu/gpu-burn +include: diff --git a/units/graphics/test-plan.pxu b/units/graphics/test-plan.pxu index 5b58844..9085cb8 100644 --- a/units/graphics/test-plan.pxu +++ b/units/graphics/test-plan.pxu @@ -60,7 +60,7 @@ _name: Graphics tests (discrete GPU) (Manual) _description: Graphics tests (discrete GPU) (Manual) include: - graphics/2_switch_card_.*_xenial certification-status=blocker + graphics/2_auto_switch_card_.* certification-status=blocker graphics/2_maximum_resolution_.* certification-status=blocker graphics/2_glxgears_.* certification-status=blocker graphics/2_rotation_.* certification-status=blocker @@ -88,44 +88,44 @@ unit: test plan _name: After suspend tests (integrated GPU) _description: After suspend tests (integrated GPU) include: - graphics/1_switch_card_.*_xenial certification-status=blocker - suspend/1_resolution_before_suspend_.*_xenial certification-status=blocker + graphics/1_auto_switch_card_.* certification-status=blocker + suspend/1_resolution_before_suspend_.*_auto certification-status=blocker # The following after suspend jobs will automatically select the right suspend job # depending on the amount of graphic cards available on the SUT: # suspend/suspend_advanced (one GPU) - # or suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial (two GPUs) - suspend/1_suspend-time-check_.*_xenial certification-status=non-blocker - suspend/1_suspend-single-log-attach_.*_xenial - power-management/lid certification-status=blocker - power-management/lid_close certification-status=blocker - power-management/lid_open certification-status=blocker - suspend/1_compiz_check_after_suspend_.*_xenial certification-status=blocker - suspend/1_driver_version_after_suspend_.*_xenial certification-status=blocker - suspend/1_resolution_after_suspend_.*_xenial certification-status=blocker - suspend/1_display_after_suspend_.*_xenial certification-status=blocker - suspend/1_glxgears_after_suspend_.*_xenial certification-status=blocker - suspend/1_video_after_suspend_.*_xenial certification-status=blocker - suspend/1_cycle_resolutions_after_suspend_.*_xenial certification-status=non-blocker - suspend/1_xrandr_screens_after_suspend.tar.gz_xenial + # or suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto (two GPUs) + suspend/1_suspend-time-check_.*_auto certification-status=non-blocker + suspend/1_suspend-single-log-attach_.*_auto + power-management/lid certification-status=blocker + power-management/lid_close certification-status=blocker + power-management/lid_open certification-status=blocker + suspend/1_compiz_check_after_suspend_.*_auto certification-status=blocker + suspend/1_driver_version_after_suspend_.*_auto certification-status=blocker + suspend/1_resolution_after_suspend_.*_auto certification-status=blocker + suspend/1_display_after_suspend_.*_auto certification-status=blocker + suspend/1_glxgears_after_suspend_.*_auto certification-status=blocker + suspend/1_video_after_suspend_.*_auto certification-status=blocker + suspend/1_cycle_resolutions_after_suspend_.*_auto certification-status=non-blocker + suspend/1_xrandr_screens_after_suspend.tar.gz_auto id: after-suspend-graphics-discrete-gpu-cert-full unit: test plan _name: After suspend tests (discrete GPU) _description: After suspend tests (discrete GPU) include: - suspend/2_resolution_before_suspend_.*_xenial certification-status=blocker - suspend/2_suspend_after_switch_to_card_.*_xenial certification-status=blocker - suspend/2_suspend-time-check_.*_xenial certification-status=non-blocker - suspend/2_suspend-single-log-attach_.*_xenial - suspend/2_compiz_check_after_suspend_.*_xenial certification-status=blocker - suspend/2_driver_version_after_suspend_.*_xenial certification-status=blocker - suspend/2_resolution_after_suspend_.*_xenial certification-status=blocker - suspend/2_display_after_suspend_.*_xenial certification-status=blocker - suspend/2_glxgears_after_suspend_.*_xenial certification-status=blocker - suspend/2_video_after_suspend_.*_xenial certification-status=blocker - suspend/2_cycle_resolutions_after_suspend_.*_xenial certification-status=non-blocker - suspend/2_xrandr_screens_after_suspend_.*.tar.gz_xenial - after-suspend-manual-monitor/2_dim_brightness_.* certification-status=blocker + suspend/2_resolution_before_suspend_.*_auto certification-status=blocker + suspend/2_suspend_after_switch_to_card_.*_auto certification-status=blocker + suspend/2_suspend-time-check_.*_auto certification-status=non-blocker + suspend/2_suspend-single-log-attach_.*_auto + suspend/2_compiz_check_after_suspend_.*_auto certification-status=blocker + suspend/2_driver_version_after_suspend_.*_auto certification-status=blocker + suspend/2_resolution_after_suspend_.*_auto certification-status=blocker + suspend/2_display_after_suspend_.*_auto certification-status=blocker + suspend/2_glxgears_after_suspend_.*_auto certification-status=blocker + suspend/2_video_after_suspend_.*_auto certification-status=blocker + suspend/2_cycle_resolutions_after_suspend_.*_auto certification-status=non-blocker + suspend/2_xrandr_screens_after_suspend_.*.tar.gz_auto + after-suspend-manual-monitor/2_dim_brightness_.* certification-status=blocker id: graphics-integrated-gpu-cert-blockers unit: test plan @@ -150,7 +150,7 @@ unit: test plan _name: Graphics tests (discrete GPU, certification blockers only) _description: Graphics tests (discrete GPU, certification blockers only) include: - graphics/2_switch_card_.*_xenial certification-status=blocker + graphics/2_auto_switch_card_.* certification-status=blocker graphics/2_maximum_resolution_.* certification-status=blocker graphics/2_valid_opengl_renderer_.* certification-status=blocker graphics/2_glxgears_.* certification-status=blocker @@ -166,18 +166,18 @@ unit: test plan _name: After suspend tests (integrated GPU, certification blockers only) _description: After suspend tests (integrated GPU, certification blockers only) include: - graphics/1_switch_card_.*_xenial certification-status=blocker - suspend/1_resolution_before_suspend_.*_xenial certification-status=blocker + graphics/1_auto_switch_card_.* certification-status=blocker + suspend/1_resolution_before_suspend_.*_auto certification-status=blocker suspend/suspend_advanced certification-status=blocker power-management/lid certification-status=blocker power-management/lid_close certification-status=blocker power-management/lid_open certification-status=blocker - suspend/1_compiz_check_after_suspend_.*_xenial certification-status=blocker - suspend/1_driver_version_after_suspend_.*_xenial certification-status=blocker - suspend/1_resolution_after_suspend_.*_xenial certification-status=blocker - suspend/1_display_after_suspend_.*_xenial certification-status=blocker - suspend/1_glxgears_after_suspend_.*_xenial certification-status=blocker - suspend/1_video_after_suspend_.*_xenial certification-status=blocker + suspend/1_compiz_check_after_suspend_.*_auto certification-status=blocker + suspend/1_driver_version_after_suspend_.*_auto certification-status=blocker + suspend/1_resolution_after_suspend_.*_auto certification-status=blocker + suspend/1_display_after_suspend_.*_auto certification-status=blocker + suspend/1_glxgears_after_suspend_.*_auto certification-status=blocker + suspend/1_video_after_suspend_.*_auto certification-status=blocker after-suspend-manual-monitor/1_dim_brightness_.* certification-status=blocker id: after-suspend-graphics-discrete-gpu-cert-blockers @@ -185,12 +185,12 @@ unit: test plan _name: After suspend tests (discrete GPU, certification blockers only) _description: After suspend tests (discrete GPU, certification blockers only) include: - suspend/2_resolution_before_suspend_.*_xenial certification-status=blocker - suspend/2_suspend_after_switch_to_card_.*_xenial certification-status=blocker - suspend/2_compiz_check_after_suspend_.*_xenial certification-status=blocker - suspend/2_driver_version_after_suspend_.*_xenial certification-status=blocker - suspend/2_resolution_after_suspend_.*_xenial certification-status=blocker - suspend/2_display_after_suspend_.*_xenial certification-status=blocker - suspend/2_glxgears_after_suspend_.*_xenial certification-status=blocker - suspend/2_video_after_suspend_.*_xenial certification-status=blocker - after-suspend-manual-monitor/2_dim_brightness_.* certification-status=blocker + suspend/2_resolution_before_suspend_.*_auto certification-status=blocker + suspend/2_suspend_after_switch_to_card_.*_auto certification-status=blocker + suspend/2_compiz_check_after_suspend_.*_auto certification-status=blocker + suspend/2_driver_version_after_suspend_.*_auto certification-status=blocker + suspend/2_resolution_after_suspend_.*_auto certification-status=blocker + suspend/2_display_after_suspend_.*_auto certification-status=blocker + suspend/2_glxgears_after_suspend_.*_auto certification-status=blocker + suspend/2_video_after_suspend_.*_auto certification-status=blocker + after-suspend-manual-monitor/2_dim_brightness_.* certification-status=blocker diff --git a/units/info/jobs.pxu b/units/info/jobs.pxu index 3170566..93ccd92 100644 --- a/units/info/jobs.pxu +++ b/units/info/jobs.pxu @@ -310,7 +310,7 @@ _description: Lists the device driver and version for all audio devices. plugin: attachment category_id: com.canonical.plainbox::info id: info/network_devices -command: network_device_info +command: network_device_info.py info estimated_duration: 0.550 _description: Provides information about network devices diff --git a/units/oob-management/jobs.pxu b/units/oob-management/jobs.pxu index 5615a65..cf3ebd1 100644 --- a/units/oob-management/jobs.pxu +++ b/units/oob-management/jobs.pxu @@ -113,14 +113,14 @@ plugin: shell template-engine: jinja2 requires: {%- if __on_ubuntucore__ %} - # TODO: name is a guess until snap provided + {# TODO: name is a guess until snap provided #} snap.name == 'lms' {%- else %} package.name == 'lms' {% endif -%} command: {%- if __on_ubuntucore__ %} - # TODO: name is a guess until snap provided + {# TODO: name is a guess until snap provided #} SERVICE_NAME="snap.lms.lms.service" {%- else %} SERVICE_NAME="lms.service" diff --git a/units/stress/jobs.pxu b/units/stress/jobs.pxu index 261a0a3..756d537 100644 --- a/units/stress/jobs.pxu +++ b/units/stress/jobs.pxu @@ -71,7 +71,7 @@ id: power-management/suspend_30_cycles_with_reboots estimated_duration: 5400.0 depends: power-management/rtc - suspend/suspend_advanced + suspend/suspend_advanced_auto requires: executable.name == 'x-terminal-emulator' flags: noreturn @@ -79,8 +79,16 @@ user: root environ: PM_TEST_DRY_RUN command: pm_test reboot --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox --fwts --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE --suspends-before-reboot=30 -r 3 --silent --check-hardware-list +_summary: 30 suspend/resume cycles and 1 reboot, 3 times (automated stress test) _description: This is an automated stress test that will run a sequence of '30 suspend/resume cycles and one reboot' 3 times. +_siblings: [ + { "id": "power-management/suspend_30_cycles_with_coldboots", + "command": "pm_test poweroff --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox --fwts --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE --suspends-before-reboot=30 -r 3 --silent --check-hardware-list", + "_description": "This is an automated stress test that will run a sequence of '30 suspend/resume cycles and one poweroff' 3 times.", + "_summary": "30 suspend/resume cycles and 1 poweroff, 3 times (automated stress test)" + } + ] plugin: shell category_id: com.canonical.plainbox::stress @@ -118,8 +126,17 @@ id: power-management/suspend-30-cycles-log-check-with-reboots depends: power-management/suspend_30_cycles_with_reboots estimated_duration: 1.0 command: [ -e $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log ] && sleep_test_log_check -v s3 $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log +_summary: 30 suspend/resume cycles and 1 reboot, 3 times (check logs for errors) _description: Automated check of the '30 cycle suspend and 1 reboot times 3' logs for errors detected by fwts. +_siblings: [ + { "id": "power-management/suspend-30-cycles-log-check-with-coldboots", + "depends": "power-management/suspend_30_cycles_with_coldboots", + "command": "[ -e $PLAINBOX_SESSION_SHARE/pm_test.poweroff.3.log ] && sleep_test_log_check -v s3 $PLAINBOX_SESSION_SHARE/pm_test.poweroff.3.log", + "_description": "Automated check of the '30 cycle suspend and 1 poweroff times 3' logs for errors detected by fwts.", + "_summary": "30 suspend/resume cycles and 1 poweroff, 3 times (check logs for errors)" + } + ] plugin: attachment category_id: com.canonical.plainbox::stress @@ -136,8 +153,17 @@ id: power-management/suspend-30-cycle-log-attach-with-reboots estimated_duration: 1.0 depends: power-management/suspend_30_cycles_with_reboots command: [ -e $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log ] && cat $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log +_summary: 30 suspend/resume cycles and 1 reboot, 3 times (attach logs) _description: - Attaches the log from the '30 cycle Suspend/Resume and one reboot times 3' test if it exists + Attaches the log from the '30 cycle suspend/resume and one reboot times 3' test if it exists +_siblings: [ + { "id": "power-management/suspend-30-cycle-log-attach-with-coldboots", + "depends": "power-management/suspend_30_cycles_with_coldboots", + "command": "[ -e $PLAINBOX_SESSION_SHARE/pm_test.poweroff.3.log ] && cat $PLAINBOX_SESSION_SHARE/pm_test.poweroff.3.log", + "_description": "Attaches the log from the '30 cycle Suspend/Resume and one poweroff times 3' test if it exists", + "_summary": "30 suspend/resume cycles and 1 poweroff, 3 times (attach logs)" + } + ] plugin: shell category_id: com.canonical.plainbox::stress @@ -154,8 +180,17 @@ id: power-management/suspend-30-cycles-time-check-with-reboots estimated_duration: 1.0 depends: power-management/suspend_30_cycles_with_reboots command: [ -e $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log ] && sleep_time_check $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log +_summary: 30 suspend/resume cycles and 1 reboot, 3 times (check logs for timing issues) _description: - Checks the sleep times to ensure that a machine suspends and resumes within a given threshold + Checks the sleep times to ensure that a machine suspends and resumes within a given threshold (warm boots) +_siblings: [ + { "id": "power-management/suspend-30-cycles-time-check-with-coldboots", + "depends": "power-management/suspend_30_cycles_with_coldboots", + "command": "[ -e $PLAINBOX_SESSION_SHARE/pm_test.poweroff.3.log ] && sleep_time_check $PLAINBOX_SESSION_SHARE/pm_test.poweroff.3.log", + "_description": "Checks the sleep times to ensure that a machine suspends and resumes within a given threshold (cold boots)", + "_summary": "30 suspend/resume cycles and 1 poweroff, 3 times (check logs for timing issues)" + } + ] plugin: shell category_id: com.canonical.plainbox::stress diff --git a/units/stress/test-plan.pxu b/units/stress/test-plan.pxu index 2f6ff8b..8e7929a 100644 --- a/units/stress/test-plan.pxu +++ b/units/stress/test-plan.pxu @@ -51,6 +51,16 @@ include: power-management/suspend-30-cycle-log-attach-with-reboots power-management/suspend-30-cycles-time-check-with-reboots +id: stress-suspend-30-cycles-with-coldboots-automated +unit: test plan +_name: Suspend stress tests (with coldboots) +_description: Suspend stress tests (with coldboots) +include: + power-management/suspend_30_cycles_with_coldboots + power-management/suspend-30-cycles-log-check-with-coldboots + power-management/suspend-30-cycle-log-attach-with-coldboots + power-management/suspend-30-cycles-time-check-with-coldboots + id: stress-hibernate-30-cycles-automated unit: test plan _name: Hibernate stress tests diff --git a/units/suspend/suspend-graphics.pxu b/units/suspend/suspend-graphics.pxu index 43a7246..be820a7 100644 --- a/units/suspend/suspend-graphics.pxu +++ b/units/suspend/suspend-graphics.pxu @@ -3,8 +3,8 @@ template-resource: graphics_card template-filter: graphics_card.prime_gpu_offload == 'Off' plugin: shell category_id: com.canonical.plainbox::suspend -id: suspend/{index}_resolution_before_suspend_{product_slug}_xenial -after: graphics/{index}_switch_card_{product_slug}_xenial +id: suspend/{index}_resolution_before_suspend_{product_slug}_auto +after: graphics/{index}_auto_switch_card_{product_slug} estimated_duration: 1.2 _description: Record the current resolution before suspending. command: @@ -16,11 +16,11 @@ template-resource: graphics_card template-filter: graphics_card.prime_gpu_offload == 'Off' plugin: user-interact-verify category_id: com.canonical.plainbox::suspend -id: suspend/{index}_suspend_after_switch_to_card_{product_slug}_xenial +id: suspend/{index}_suspend_after_switch_to_card_{product_slug}_auto requires: sleep.mem == 'supported' rtc.state == 'supported' -after: graphics/{index}_switch_card_{product_slug}_xenial +after: graphics/{index}_auto_switch_card_{product_slug} user: root environ: PLAINBOX_SESSION_SHARE command: @@ -52,12 +52,12 @@ template-filter: graphics_card.prime_gpu_offload == 'Off' template-engine: jinja2 plugin: shell category_id: com.canonical.plainbox::suspend -id: suspend/{{ index }}_resolution_after_suspend_{{ product_slug }}_xenial +id: suspend/{{ index }}_resolution_after_suspend_{{ product_slug }}_auto estimated_duration: 1.2 depends: - suspend/{{ index }}_resolution_before_suspend_{{ product_slug }}_xenial + suspend/{{ index }}_resolution_before_suspend_{{ product_slug }}_auto {%- if gpu_count > "1" %} - suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial + suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto {%- else %} suspend/suspend_advanced {%- endif %} @@ -72,10 +72,10 @@ template-filter: graphics_card.prime_gpu_offload == 'Off' template-engine: jinja2 plugin: manual category_id: com.canonical.plainbox::suspend -id: suspend/{{ index }}_display_after_suspend_{{ product_slug }}_xenial +id: suspend/{{ index }}_display_after_suspend_{{ product_slug }}_auto depends: {%- if gpu_count > "1" %} - suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial + suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto {%- else %} suspend/suspend_advanced {%- endif %} @@ -94,11 +94,11 @@ template-filter: graphics_card.prime_gpu_offload == 'Off' template-engine: jinja2 plugin: user-interact-verify category_id: com.canonical.plainbox::suspend -id: suspend/{{ index }}_cycle_resolutions_after_suspend_{{ product_slug }}_xenial +id: suspend/{{ index }}_cycle_resolutions_after_suspend_{{ product_slug }}_auto requires: package.name == 'xorg' depends: {%- if gpu_count > "1" %} - suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial + suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto {%- else %} suspend/suspend_advanced {%- endif %} @@ -119,8 +119,8 @@ template-resource: graphics_card template-filter: graphics_card.prime_gpu_offload == 'Off' plugin: attachment category_id: com.canonical.plainbox::suspend -id: suspend/{index}_xrandr_screens_after_suspend.tar.gz_xenial -depends: suspend/{index}_cycle_resolutions_after_suspend_{product_slug}_xenial +id: suspend/{index}_xrandr_screens_after_suspend.tar.gz_auto +depends: suspend/{index}_cycle_resolutions_after_suspend_{product_slug}_auto command: [ -f $PLAINBOX_SESSION_SHARE/{index}_xrandr_screens_after_suspend.tgz ] && cat $PLAINBOX_SESSION_SHARE/{index}_xrandr_screens_after_suspend.tgz _description: This attaches screenshots from the suspend/cycle_resolutions_after_suspend test to the results submission. @@ -130,10 +130,10 @@ template-filter: graphics_card.prime_gpu_offload == 'Off' template-engine: jinja2 plugin: shell category_id: com.canonical.plainbox::suspend -id: suspend/{{ index }}_compiz_check_after_suspend_{{ product_slug }}_xenial +id: suspend/{{ index }}_compiz_check_after_suspend_{{ product_slug }}_auto depends: {%- if gpu_count > "1" %} - suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial + suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto {%- else %} suspend/suspend_advanced {%- endif %} @@ -150,10 +150,10 @@ template-resource: graphics_card template-engine: jinja2 plugin: user-interact-verify category_id: com.canonical.plainbox::suspend -id: suspend/{{ index }}_glxgears_after_suspend_{{ product_slug }}_xenial +id: suspend/{{ index }}_glxgears_after_suspend_{{ product_slug }}_auto depends: {%- if gpu_count > "1" %} - suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial + suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto {%- else %} suspend/suspend_advanced {%- endif %} @@ -176,10 +176,10 @@ _description: unit: template template-resource: graphics_card template-engine: jinja2 -id: suspend/{{ index }}_video_after_suspend_{{ product_slug }}_xenial +id: suspend/{{ index }}_video_after_suspend_{{ product_slug }}_auto depends: {%- if gpu_count > "1" %} - suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial + suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto {%- else %} suspend/suspend_advanced {%- endif %} @@ -206,10 +206,10 @@ template-filter: graphics_card.prime_gpu_offload == 'Off' template-engine: jinja2 plugin: shell category_id: com.canonical.plainbox::suspend -id: suspend/{{ index }}_driver_version_after_suspend_{{ product_slug }}_xenial +id: suspend/{{ index }}_driver_version_after_suspend_{{ product_slug }}_auto depends: {%- if gpu_count > "1" %} - suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial + suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto {%- else %} suspend/suspend_advanced {%- endif %} @@ -226,10 +226,10 @@ template-filter: graphics_card.prime_gpu_offload == 'Off' template-engine: jinja2 plugin: attachment category_id: com.canonical.plainbox::suspend -id: suspend/{{ index }}_suspend-single-log-attach_{{ product_slug }}_xenial +id: suspend/{{ index }}_suspend-single-log-attach_{{ product_slug }}_auto depends: {%- if gpu_count > "1" %} - suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial + suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto {%- else %} suspend/suspend_advanced {%- endif %} @@ -243,10 +243,10 @@ template-filter: graphics_card.prime_gpu_offload == 'Off' template-engine: jinja2 plugin: shell category_id: com.canonical.plainbox::suspend -id: suspend/{{ index }}_suspend-time-check_{{ product_slug }}_xenial +id: suspend/{{ index }}_suspend-time-check_{{ product_slug }}_auto depends: {%- if gpu_count > "1" %} - suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_xenial + suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto {%- else %} suspend/suspend_advanced {%- endif %} diff --git a/units/wireless/jobs.pxu b/units/wireless/jobs.pxu index 52b2b01..a186979 100644 --- a/units/wireless/jobs.pxu +++ b/units/wireless/jobs.pxu @@ -7,7 +7,7 @@ id: wireless/wireless_scanning_{{ interface }} _summary: Test system can discover Wi-Fi networks on {{ interface }} command: net_driver_info $NET_DRIVER_INFO - wifi_nmcli_test scan {{ interface }} + wifi_nmcli_test.py scan {{ interface }} plugin: shell category_id: com.canonical.plainbox::wireless estimated_duration: 6 @@ -31,7 +31,7 @@ _purpose: plugin: shell command: net_driver_info $NET_DRIVER_INFO - wifi_nmcli_test secured {{ interface }} "$WPA_BG_SSID" "$WPA_BG_PSK" + wifi_nmcli_test.py secured {{ interface }} "$WPA_BG_SSID" "$WPA_BG_PSK" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 flags: preserve-locale also-after-suspend also-after-suspend-manual @@ -52,7 +52,7 @@ _purpose: plugin: shell command: net_driver_info $NET_DRIVER_INFO - wifi_nmcli_test open {{ interface }} "$OPEN_BG_SSID" + wifi_nmcli_test.py open {{ interface }} "$OPEN_BG_SSID" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 flags: preserve-locale also-after-suspend also-after-suspend-manual @@ -73,7 +73,7 @@ _purpose: plugin: shell command: net_driver_info $NET_DRIVER_INFO - wifi_nmcli_test secured {{ interface }} "$WPA_N_SSID" "$WPA_N_PSK" + wifi_nmcli_test.py secured {{ interface }} "$WPA_N_SSID" "$WPA_N_PSK" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 flags: preserve-locale also-after-suspend also-after-suspend-manual @@ -94,7 +94,7 @@ _purpose: plugin: shell command: net_driver_info $NET_DRIVER_INFO - wifi_nmcli_test open {{ interface }} "$OPEN_N_SSID" + wifi_nmcli_test.py open {{ interface }} "$OPEN_N_SSID" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 flags: preserve-locale also-after-suspend also-after-suspend-manual @@ -115,7 +115,7 @@ _purpose: plugin: shell command: net_driver_info $NET_DRIVER_INFO - wifi_nmcli_test secured {{ interface }} "$WPA_AC_SSID" "$WPA_AC_PSK" + wifi_nmcli_test.py secured {{ interface }} "$WPA_AC_SSID" "$WPA_AC_PSK" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 flags: preserve-locale also-after-suspend also-after-suspend-manual @@ -137,7 +137,7 @@ _purpose: plugin: shell command: net_driver_info $NET_DRIVER_INFO - wifi_nmcli_test open {{ interface }} "$OPEN_AC_SSID" + wifi_nmcli_test.py open {{ interface }} "$OPEN_AC_SSID" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 flags: preserve-locale also-after-suspend also-after-suspend-manual @@ -442,3 +442,31 @@ command: estimated_duration: 330.0 _description: Tests the performance of a system's wireless connection through the iperf tool, using UDP packets. + + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.interface != 'UNKNOWN' +id: wireless/nm_connection_save_{category} +category_id: com.canonical.plainbox::wireless +_summary: Save any NetworkManager 802.11 configurations prior to testing +plugin: shell +user: root +command: + wifi_nmcli_backup.py save +estimated_duration: 2.0 +flags: preserve-locale also-after-suspend also-after-suspend-manual + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.interface != 'UNKNOWN' +id: wireless/nm_connection_restore_{category} +category_id: com.canonical.plainbox::wireless +_summary: Restore any NetworkManager 802.11 configurations after testing +plugin: shell +user: root +command: + wifi_nmcli_backup.py restore +estimated_duration: 2.0 +depends: wireless/nm_connection_save_{category} +flags: preserve-locale also-after-suspend also-after-suspend-manual \ No newline at end of file diff --git a/units/wireless/test-plan.pxu b/units/wireless/test-plan.pxu index 74bf271..8b4aafe 100644 --- a/units/wireless/test-plan.pxu +++ b/units/wireless/test-plan.pxu @@ -30,7 +30,10 @@ id: wireless-cert-automated unit: test plan _name: Wireless tests _description: Wireless connection tests +bootstrap_include: + device include: + wireless/nm_connection_save_.* wireless/wireless_scanning_.* certification-status=blocker wireless/wireless_connection_wpa_bg_nm_.* certification-status=blocker wireless/wireless_connection_open_bg_nm_.* certification-status=blocker @@ -38,36 +41,48 @@ include: wireless/wireless_connection_open_n_nm_.* certification-status=blocker wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + wireless/nm_connection_restore_.* id: after-suspend-wireless-cert-automated unit: test plan _name: Wireless tests (after suspend, automated) _description: Wireless connection tests (after suspend, automated) +bootstrap_include: + device include: + after-suspend-wireless/nm_connection_save_.* after-suspend-wireless/wireless_connection_wpa_bg_nm_.* certification-status=blocker after-suspend-wireless/wireless_connection_open_bg_nm_.* certification-status=blocker after-suspend-wireless/wireless_connection_wpa_n_nm_.* certification-status=blocker after-suspend-wireless/wireless_connection_open_n_nm_.* certification-status=blocker after-suspend-wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker after-suspend-wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + after-suspend-wireless/nm_connection_restore_.* id: after-suspend-manual-wireless-cert-automated unit: test plan _name: Wireless tests (after manual suspend, automated) _description: Wireless connection tests (after manual suspend, automated) +bootstrap_include: + device include: + after-suspend-manual-wireless/nm_connection_save_.* after-suspend-manual-wireless/wireless_connection_wpa_bg_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_open_bg_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_wpa_n_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_open_n_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + after-suspend-manual-wireless/nm_connection_restore_.* id: wireless-cert-blockers unit: test plan _name: Wireless tests (certification blockers only) _description: Wireless connection tests (certification blockers only) +bootstrap_include: + device include: + wireless/nm_connection_save_.* wireless/wireless_scanning_.* certification-status=blocker wireless/wireless_connection_wpa_bg_nm_.* certification-status=blocker wireless/wireless_connection_open_bg_nm_.* certification-status=blocker @@ -75,16 +90,21 @@ include: wireless/wireless_connection_open_n_nm_.* certification-status=blocker wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + wireless/nm_connection_restore_.* id: after-suspend-wireless-cert-blockers unit: test plan _name: Wireless tests (after manual suspend, certification blockers only) _description: Wireless connection tests (after manual suspend, certification blockers only) +bootstrap_include: + device include: + after-suspend-manual-wireless/nm_connection_save_.* after-suspend-manual-wireless/wireless_connection_wpa_bg_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_open_bg_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_wpa_n_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_open_n_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + after-suspend-manual-wireless/nm_connection_restore_.* |