diff options
author | PMR <pmr@pmr-lander> | 2021-04-23 08:42:24 +0000 |
---|---|---|
committer | PMR <pmr@pmr-lander> | 2021-04-23 08:42:24 +0000 |
commit | 1d22216c243b81adad86821768e56831e4871757 (patch) | |
tree | 293cd31f0af144d94bcab60b1602871ca85804ec | |
parent | 9dcda4961e48b5ec68ff7de60a205382f5952169 (diff) |
Import plainbox-provider-checkbox_0.58.0~rc1.orig.tar.gzupstream-0.58.0_rc1patched-0.58.0_rc1-1
49 files changed, 675 insertions, 234 deletions
diff --git a/bin/cpufreq_test.py b/bin/cpufreq_test.py index ec3cf6c..73fa651 100755 --- a/bin/cpufreq_test.py +++ b/bin/cpufreq_test.py @@ -20,7 +20,7 @@ """Test and validate SUT CPU scaling capabilities via CPUFreq.""" -from os import path +from os import path, geteuid import multiprocessing import collections import threading @@ -390,24 +390,29 @@ class CpuFreqTest: # prove that we are single-threaded again logging.info('* active threads: %i\n', threading.active_count()) - # display results - logging.warning('[CpuFreqTest Results]') # for --quiet mode + # process, then display results + results = self._process_results() + # provide time under test for debug/verbose output + end_time = time.time() - start_time + + print('[CpuFreqTest Results]') + logging.debug('[Test Took: %.3fs]', end_time) logging.info( ' - legend:\n' ' {core: {target_freq:' '[sampled_med_%, P/F, sampled_median],:.\n') - # format result dict for human consumption - logging.info( - pprint.pformat(self._process_results())) - # provide time under test for debug/verbose output - end_time = time.time() - start_time - logging.debug('[Test Took: %.3fs]', end_time) + if self.fail_count: + print( + pprint.pformat(results)) print('\n[Test Failed]\n' '* core fail_count =', self.fail_count) return 1 + logging.info( + pprint.pformat(results)) print('\n[Test Passed]') + return 0 def spawn_core_test(self): @@ -752,12 +757,17 @@ def parse_arg_logging(): def main(): # configure and start logging user_arg = parse_arg_logging() + # Make sure we're running with root permissions + if geteuid() != 0: + logging.error('You must be root to run this script') + return 1 # instantiate CpuFreqTest as cpu_freq_test cpu_freq_test = CpuFreqTest() # provide access to reset() method if user_arg.reset: print('[Reset CpuFreq Sysfs]') return cpu_freq_test.reset() + return cpu_freq_test.execute_test() diff --git a/bin/cpuid.py b/bin/cpuid.py index 3eebf1e..05a9629 100755 --- a/bin/cpuid.py +++ b/bin/cpuid.py @@ -83,6 +83,24 @@ is_64bit = ctypes.sizeof(ctypes.c_voidp) == 8 # [11:8] Family # [7:4] Model # [3:0] Stepping + +# Intel CPUID Hex Mapping +# 0x[1][2][3][4][5] +# [1] Extended Model +# [2] Extended Family +# [3] Family +# [4] Model +# [5] Stepping + +# AMD CPUID Hex Mapping +# 0x[1][2][3][4][5][6] +# [1] Extended Family +# [2] Extended Model +# [3] Reserved +# [4] Base Family +# [5] Base Model +# [6] Stepping + CPUIDS = { "Amber Lake": ['0x806e9'], "AMD EPYC": ['0x800f12'], @@ -97,7 +115,7 @@ CPUIDS = { '0x806ea', '0x906ea', '0x906eb', '0x906ec', '0x906ed'], "Cooper Lake": ['0x5065a', '0x5065b'], "Haswell": ['0x306c', '0x4065', '0x4066', '0x306f'], - "Ice Lake": ['0x706e'], + "Ice Lake": ['0x606e6', '0x606a6', '0x706e6'], "Ivy Bridge": ['0x306a', '0x306e'], "Kaby Lake": ['0x806e9', '0x906e9'], "Knights Landing": ['0x5067'], diff --git a/bin/disk_read_performance_test.sh b/bin/disk_read_performance_test.sh index d91dc7b..f416466 100755 --- a/bin/disk_read_performance_test.sh +++ b/bin/disk_read_performance_test.sh @@ -5,6 +5,9 @@ #Default to a lower bound of 15 MB/s DEFAULT_BUF_READ=${DISK_READ_PERF:-15} +DEFAULT_NVME_READ=${DISK_NVME_READ_PERF:-200} +DEFAULT_MDADM_READ=${DISK_MDADM_READ_PERF:-80} +DEFAULT_SSD_READ=${DISK_SSD_READ_PERF:-200} for disk in "$@"; do @@ -62,12 +65,12 @@ for disk in "$@"; do "ide" ) MIN_BUF_READ=40;; "mmc" ) MIN_BUF_READ=$DEFAULT_BUF_READ;; "mtd" ) MIN_BUF_READ=1;; - "nvme" ) MIN_BUF_READ=200;; + "nvme" ) MIN_BUF_READ=$DEFAULT_NVME_READ;; "nvdimm" ) MIN_BUF_READ=500;; - "mdadm" ) MIN_BUF_READ=80;; + "mdadm" ) MIN_BUF_READ=$DEFAULT_MDADM_READ;; "ata" ) MIN_BUF_READ=80;; "scsi" ) MIN_BUF_READ=100;; - "ssd" ) MIN_BUF_READ=200;; + "ssd" ) MIN_BUF_READ=$DEFAULT_SSD_READ;; * ) MIN_BUF_READ=$DEFAULT_BUF_READ;; esac echo "INFO: $disk_type: Using $MIN_BUF_READ MB/sec as the minimum throughput speed" diff --git a/bin/gateway_ping_test.py b/bin/gateway_ping_test.py index dc2e165..59f43d3 100755 --- a/bin/gateway_ping_test.py +++ b/bin/gateway_ping_test.py @@ -189,7 +189,8 @@ def ping(host, interface, count, deadline, verbose=False): r".*([0-9]*\.?[0-9]*.)% packet loss") ping_summary = {'transmitted': 0, 'received': 0, 'pct_loss': 0} try: - output = subprocess.check_output(command, universal_newlines=True) + output = subprocess.check_output( + command, universal_newlines=True, stderr=subprocess.PIPE) except OSError as exc: if exc.errno == errno.ENOENT: # No ping command present; @@ -200,6 +201,11 @@ def ping(host, interface, count, deadline, verbose=False): except subprocess.CalledProcessError as excp: # Ping returned fail exit code print(_("ERROR: ping result: {0}").format(excp)) + if excp.stderr: + print(excp.stderr) + if 'SO_BINDTODEVICE' in excp.stderr: + ping_summary['cause'] = ( + "Could not bind to the {} interface.".format(interface)) else: if verbose: print(output) @@ -277,6 +283,8 @@ def main(args): args.deadline, args.verbose) if ping_summary is None or ping_summary['received'] == 0: print(_("No Internet connection")) + if ping_summary.get('cause'): + print("Possible cause: {}".format(ping_summary['cause'])) return 1 elif ping_summary['transmitted'] != ping_summary['received']: print(_("Connection established, but lost {0}% of packets").format( diff --git a/bin/rotation_test.py b/bin/rotation_test.py index de70f4a..f3467b8 100755 --- a/bin/rotation_test.py +++ b/bin/rotation_test.py @@ -40,7 +40,7 @@ def main(): print("Changing rotation to: {}".format(rotation)) subprocess.check_call( ['xrandr', '--output', output, '--rotation', rotation]) - time.sleep(4) + time.sleep(8) if __name__ == '__main__': diff --git a/bin/storage_test.py b/bin/storage_test.py index 9efe41f..58453e2 100755 --- a/bin/storage_test.py +++ b/bin/storage_test.py @@ -25,15 +25,21 @@ def mountpoint(device): def find_largest_partition(device): - BlkDev = namedtuple('BlkDev', ['name', 'size', 'type']) - cmd = 'lsblk -b -l -n -o NAME,SIZE,TYPE {}'.format(device) + BlkDev = namedtuple('BlkDev', ['name', 'size', 'type', 'fstype']) + cmd = 'lsblk -b -l -n -o NAME,SIZE,TYPE,FSTYPE {}'.format(device) out = sp.check_output(cmd, shell=True) - blk_devs = [BlkDev(*p.strip().split()) - for p in out.decode(sys.stdout.encoding).splitlines()] - blk_devs[:] = [bd for bd in blk_devs if bd.type in ('part', 'md')] + blk_devs = [] + for entry in out.decode(sys.stdout.encoding).splitlines(): + params = entry.strip().split() + if len(params) == 3: + # filesystem info missing, so it's unknown + params.append(None) + blk_devs.append(BlkDev(*params)) + blk_devs[:] = [bd for bd in blk_devs if ( + bd.type in ('part', 'md') and bd.fstype is not None)] if not blk_devs: raise SystemExit( - 'ERROR: No partitions found on device {}'.format(device)) + 'ERROR: No suitable partitions found on device {}'.format(device)) blk_devs.sort(key=lambda bd: int(bd.size)) return blk_devs[-1].name diff --git a/bin/touchpad_confidence_bit.py b/bin/touchpad_confidence_bit.py new file mode 100755 index 0000000..5f94bb9 --- /dev/null +++ b/bin/touchpad_confidence_bit.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +import sys +from subprocess import check_output, CalledProcessError +from checkbox_support.parsers.udevadm import UdevadmParser + + +class TouchpadDevices: + + def __init__(self): + self.devices = {} + self._collect_devices() + + def _collect_devices(self): + cmd = ['udevadm', 'info', '--export-db'] + try: + output = check_output(cmd).decode(sys.stdout.encoding) + except CalledProcessError as err: + sys.stderr.write(err) + return + udev = UdevadmParser(output) + udev.run(self) + + def addDevice(self, device): + if getattr(device, 'category') == 'TOUCHPAD': + self.devices[getattr(device, 'product_slug') + ] = getattr(device, 'path') + + +def main(): + if len(sys.argv) != 2: + raise SystemExit('ERROR: expected a product slug') + product_slug = sys.argv[1] + + path = TouchpadDevices().devices[product_slug] + abs_path = "/sys" + path + "/capabilities/abs" + + f = open(abs_path, "r") + abs_cap_str = f.readline() + f.close() + support = (int(abs_cap_str[-15], 16) & 8) >> 3 + + if support == 0: + modalias_path = "/sys" + path + "/modalias" + f = open(modalias_path, "r") + modalias_str = f.readline() + f.close() + print("Touchpad modalias: {}".format(modalias_str[0:-2])) + print("Touchpad EV_ABS capabilities: {}".format(abs_cap_str[0:-2])) + sys.exit(1) + + return 0 + + +if __name__ == "__main__": + main() diff --git a/bin/ubuntucore_image_checks.py b/bin/ubuntucore_image_checks.py index 214fc42..e381e61 100755 --- a/bin/ubuntucore_image_checks.py +++ b/bin/ubuntucore_image_checks.py @@ -65,6 +65,7 @@ class ModelInfo(): def __init__(self): self.authority = None self.brand = None + self.grade = None for line in io.StringIO(Snapd().get_assertions('model').text): if ':' in line: entry = line.split(':', maxsplit=1) @@ -72,6 +73,8 @@ class ModelInfo(): self.authority = entry[1].strip() if entry[0] == 'brand-id': self.brand = entry[1].strip() + if entry[0] == 'grade': + self.grade = entry[1].strip() def test_model_authority(self): if not self.authority: @@ -87,6 +90,13 @@ class ModelInfo(): raise SystemExit('ERROR: model brand must be canonical') print('PASS') + def test_model_grade(self): + if not self.grade: + raise SystemExit('ERROR: failed to get model grade info') + if self.grade == 'dangerous': + raise SystemExit('ERROR: model grade must not be dangerous') + print('PASS') + def main(): if len(sys.argv) != 2: @@ -107,7 +117,9 @@ def main(): elif action == 'model-authority': modelinfo.test_model_authority() elif action == 'model-brand': - modelinfo.test_model_authority() + modelinfo.test_model_brand() + elif action == 'model-grade': + modelinfo.test_model_grade() else: raise SystemExit('ERROR: unrecognised action') diff --git a/bin/virtualization.py b/bin/virtualization.py index 10b827b..2f17d32 100755 --- a/bin/virtualization.py +++ b/bin/virtualization.py @@ -531,6 +531,129 @@ class RunCommand(object): self.returncode = proc.returncode +class UVTKVMTest(object): + + def __init__(self, image=None): + self.image = image + self.release = lsb_release.get_distro_information()["CODENAME"] + self.arch = check_output(['dpkg', '--print-architecture'], + universal_newlines=True).strip() + self.name = tempfile.mktemp()[5:] + + def run_command(self, cmd): + task = RunCommand(cmd) + if task.returncode != 0: + logging.error('Command {} returnd a code of {}'.format( + task.cmd, task.returncode)) + logging.error(' STDOUT: {}'.format(task.stdout)) + logging.error(' STDERR: {}'.format(task.stderr)) + return False + else: + logging.debug('Command {}:'.format(task.cmd)) + if task.stdout != '': + logging.debug(' STDOUT: {}'.format(task.stdout)) + elif task.stderr != '': + logging.debug(' STDERR: {}'.format(task.stderr)) + else: + logging.debug(' Command returned no output') + return True + + def get_image_or_source(self): + """ + An image can be specifed in a filesytem path and used directly in + uvt-create with the backing-image option or a url can be + specifed and used in uvt-simpletreams to generate an image. + """ + url = urlparse(self.image) + + if url.scheme == 'file' or os.path.isfile(url.path): + logging.debug("Cloud image exists locally at %s" % url.path) + self.image = url.path + else: + cmd = ("uvt-simplestreams-libvirt sync release={} " + "arch={}".format(self.release, self.arch)) + + if url.scheme == 'http': + # Path specified to use -source option + logging.debug("Using --source option for uvt-simpletreams") + cmd = cmd + " --source {} ".format(self.image) + + logging.debug("uvt-simplestreams-libvirt sync") + if not self.run_command(cmd): + return False + return True + + def cleanup(self): + """ + A combination of virsh destroy/undefine is used instead of + uvt-kvm destroy. When using uvt-kvm destroy the following bug + is seen: + https://bugs.launchpad.net/ubuntu/+source/uvtool/+bug/1452095 + """ + # Destroy vm + logging.debug("Destroy VM") + if not self.run_command('virsh destroy {}'.format(self.name)): + return False + + # Virsh undefine + logging.debug("Undefine VM") + if not self.run_command('virsh undefine {}'.format(self.name)): + return False + + # Purge/Remove simplestreams image + if not self.run_command("uvt-simplestreams-libvirt purge"): + return False + return True + + def start(self): + # Generate ssh key if needed + home_dir = os.environ['HOME'] + ssh_key_file = "{}/.ssh/id_rsa".format(home_dir) + + if not os.path.exists(ssh_key_file): + self.run_command("mkdir -p {}/.ssh".format(home_dir)) + + cmd = ('ssh-keygen -f {} -t rsa -N \'\''.format(ssh_key_file)) + if not self.run_command(cmd): + return False + + # Create vm + logging.debug("Creating VM") + cmd = ('uvt-kvm create {} arch={}'.format(self.name, self.arch)) + + logging.debug("Checking for local image") + try: + self.image.find(".img") > 0 + except AttributeError: + logging.debug("No user provided image found.") + logging.debug("I will attempt to sync the image from ubuntu.com") + else: + cmd = cmd + " --backing-image-file {} ".format(self.image) + + if not self.run_command(cmd): + return False + + logging.debug("Wait for VM to complete creation") + if not self.run_command('uvt-kvm wait {}'.format(self.name)): + return False + + logging.debug("List newly created vm") + cmd = ("uvt-kvm list") + if not self.run_command(cmd): + return False + + logging.debug("Verify VM was created with ssh") + if not self.run_command('uvt-kvm ssh {}'.format(self.name)): + return False + + logging.debug("Verify VM was created with ssh and run a command") + if not self.run_command('uvt-kvm ssh {} \"lsb_release -a \"' + .format(self.name)): + return False + + return True + + class LXDTest(object): def __init__(self, template=None, rootfs=None): @@ -696,6 +819,28 @@ class LXDTest(object): return True +def test_uvtkvm(args): + logging.debug("Executing UVT KVM Test") + # if args.image is not set and UVT_IMAGE_OR_SOURCE does not exist, a key + # error is generated we need to handle. + try: + image = args.image or os.environ['UVT_IMAGE_OR_SOURCE'] + except KeyError: + logging.warning("UVT_IMAGE_OR_SOURCE is not set") + image = None + uvt_test = UVTKVMTest(image) + uvt_test.get_image_or_source() + result = uvt_test.start() + uvt_test.cleanup() + + if result: + print("PASS: VM was succssfully started and checked") + sys.exit(0) + else: + print("FAIL: VM was not started and/or checked") + sys.exit(1) + + def test_lxd(args): logging.debug("Executing LXD Test") @@ -770,6 +915,8 @@ def main(): # Main cli options kvm_test_parser = subparsers.add_parser( 'kvm', help=("Run kvm virtualization test")) + uvt_kvm_test_parser = subparsers.add_parser( + 'uvt', help=("Run uvt kvm virtualization test")) lxd_test_parser = subparsers.add_parser( 'lxd', help=("Run the LXD validation test")) parser.add_argument('--debug', dest='log_level', @@ -786,6 +933,11 @@ def main(): help="Location for debugging output log. Defaults to %(default)s.") kvm_test_parser.set_defaults(func=test_kvm) + # Sub test options + uvt_kvm_test_parser.add_argument( + '-i', '--image', type=str) + uvt_kvm_test_parser.set_defaults(func=test_uvtkvm) + lxd_test_parser.add_argument( '--template', type=str, default=None) lxd_test_parser.add_argument( diff --git a/bin/wifi_nmcli_test.py b/bin/wifi_nmcli_test.py index 6f77376..e2c0a52 100755 --- a/bin/wifi_nmcli_test.py +++ b/bin/wifi_nmcli_test.py @@ -264,17 +264,12 @@ def hotspot(args): if retcode != 0: print("Set band failed\n") return retcode - cmd = "nmcli c modify TEST_CON wifi-sec.key-mgmt wpa-psk" + cmd = ("nmcli c modify TEST_CON wifi-sec.key-mgmt wpa-psk " + "wifi-sec.psk \"ubuntu1234\"") print_cmd(cmd) retcode = sp.call(cmd, shell=True) if retcode != 0: - print("Set key-mgmt failed\n") - return retcode - cmd = "nmcli connection modify TEST_CON wifi-sec.psk \"ubuntu1234\"" - print_cmd(cmd) - retcode = sp.call(cmd, shell=True) - if retcode != 0: - print("Set PSK failed\n") + print("Setting up wifi security failed\n") return retcode cmd = "nmcli connection up TEST_CON" print_cmd(cmd) diff --git a/bin/xrandr_cycle.py b/bin/xrandr_cycle.py index 8d87217..104ffbd 100755 --- a/bin/xrandr_cycle.py +++ b/bin/xrandr_cycle.py @@ -207,7 +207,7 @@ for mode in highest_modes: message = 'Set mode ' + mode[1] + ' for output ' + mode[0] success_messages.append(message) - time.sleep(3) # let the hardware recover a bit + time.sleep(8) # let the hardware recover a bit # Put things back the way we found them @@ -5,7 +5,7 @@ from plainbox.provider_manager import N_ setup( name='plainbox-provider-checkbox', namespace='com.canonical.certification', - version="0.57.0", + version="0.58.0rc1", description=N_("Checkbox provider"), gettext_domain='plainbox-provider-checkbox', strict=False, deprecated=False, diff --git a/units/audio/manifest.pxu b/units/audio/manifest.pxu index d3e285b..73ad218 100644 --- a/units/audio/manifest.pxu +++ b/units/audio/manifest.pxu @@ -16,6 +16,6 @@ value-type: bool unit: manifest entry id: has_audio_loopback_connector -prompt: Does this device have the following?: +_prompt: Does this device have the following?: _name: Audio Loopback Connector value-type: bool diff --git a/units/bluetooth/manifest.pxu b/units/bluetooth/manifest.pxu index 576f7a8..a2baf44 100644 --- a/units/bluetooth/manifest.pxu +++ b/units/bluetooth/manifest.pxu @@ -1,9 +1,9 @@ unit: manifest entry id: has_bt_adapter -_name: A Bluetooth Adapter +_name: A Bluetooth Module value-type: bool unit: manifest entry id: has_bt_smart -_name: Bluetooth Smart (4.0 or later) Support +_name: A Bluetooth Module with Smart (4.0 or later) Support value-type: bool diff --git a/units/cpu/jobs.pxu b/units/cpu/jobs.pxu index afdd6ea..b3167c4 100644 --- a/units/cpu/jobs.pxu +++ b/units/cpu/jobs.pxu @@ -181,8 +181,10 @@ _siblings: [ plugin: shell category_id: com.canonical.plainbox::cpu id: cpu/cpufreq_test-server +estimated_duration: 3.0 user: root command: cpufreq_test.py -q +requires: cpuinfo.scaling == 'supported' _summary: cpufreq scaling test _description: diff --git a/units/disk/jobs.pxu b/units/disk/jobs.pxu index 1a0f0d5..a7e3fd3 100644 --- a/units/disk/jobs.pxu +++ b/units/disk/jobs.pxu @@ -61,7 +61,7 @@ requires: _summary: Disk performance test for {product_slug} _description: Verify that disk storage performs at or above baseline performance user: root -environ: DISK_READ_PERF +environ: DISK_READ_PERF DISK_NVME_READ_PERF DISK_MDADM_READ_PERF command: disk_read_performance_test.sh {name} unit: template diff --git a/units/ethernet/manifest.pxu b/units/ethernet/manifest.pxu index 6936344..07b4654 100644 --- a/units/ethernet/manifest.pxu +++ b/units/ethernet/manifest.pxu @@ -1,4 +1,4 @@ unit: manifest entry id: has_ethernet_adapter -_name: An Ethernet Adapter +_name: An Ethernet Port value-type: bool diff --git a/units/firmware/jobs.pxu b/units/firmware/jobs.pxu index b0d69cb..eb8397c 100644 --- a/units/firmware/jobs.pxu +++ b/units/firmware/jobs.pxu @@ -88,11 +88,29 @@ command: _description: Attaches the FWTS Server Cert results log to the submission _summary: Attach FWTS Server Cert test log to submission +id: firmware/fwts_dump +category_id: com.canonical.plainbox::firmware +_summary: Run the FTWS dump command +plugin: shell +user: root +requires: executable.name == 'fwts' +command: + pushd "$PLAINBOX_SESSION_SHARE" > /dev/null || exit + fwts -d + +id: firmware/fwts_dump_acpi_attachment.gz +category_id: com.canonical.plainbox::firmware +_summary: Collect the ACPI tables dump from FWTS +plugin: attachment +depends: firmware/fwts_dump +command: + [ -f "$PLAINBOX_SESSION_SHARE/acpidump.log" ] && gzip -c "$PLAINBOX_SESSION_SHARE/acpidump.log" + id: firmware/tcglog-required-algs-sha256 category_id: com.canonical.plainbox::firmware -summary: Test that the SHA256 algorithm is present in the TCG event log -description: +_summary: Test that the SHA256 algorithm is present in the TCG event log +_description: Presence of support for the SHA256 algorithm is a requirement for enabling FDE support in Ubuntu Core 20 systems plugin: shell @@ -106,8 +124,8 @@ requires: id: firmware/tcglog-require-pe-image-digests category_id: com.canonical.plainbox::firmware -summary: Test format of digests for EV_EFI_BOOT_SERVICES_APPLICATION events -description: +_summary: Test format of digests for EV_EFI_BOOT_SERVICES_APPLICATION events +_description: Digests for EV_EFI_BOOT_SERVICES_APPLICATION events associated with PE images must be PE image digests rather than file digests. This test is a requirement for enabling FDE support in Ubuntu Core 20 systems @@ -122,7 +140,7 @@ requires: id: firmware/tcglog-dump-attachment category_id: com.canonical.plainbox::firmware -summary: Attach a dump of the TCG Event log for debugging +_summary: Attach a dump of the TCG Event log for debugging plugin: attachment user: root command: tcglog-dump diff --git a/units/firmware/test-plan.pxu b/units/firmware/test-plan.pxu index 1765ced..7db724d 100644 --- a/units/firmware/test-plan.pxu +++ b/units/firmware/test-plan.pxu @@ -36,3 +36,30 @@ include: firmware/tcglog-required-algs-sha256 firmware/tcglog-require-pe-image-digests firmware/tcglog-dump-attachment + + +id: iot-fwts-full +unit: test plan +_name: Test fwts diagnosis with iot project +_description: Test fwts diagnosis with iot project +include: +nested_part: + iot-fwts-manual + iot-fwts-automated + + +id: iot-fwts-manual +unit: test plan +_name: Test fwts diagnosis with iot project (manual) +_description: Test fwts diagnosis with project (manual) +include: + + +id: iot-fwts-automated +unit: test plan +_name: Test fwts diagnosis with iot project (automated) +_description: Test fwts diagnosis with iot project (automated) +include: + firmware/fwts_desktop_diagnosis + firmware/fwts_desktop_diagnosis_results.log.gz + diff --git a/units/gpio/manifest.pxu b/units/gpio/manifest.pxu index d7174ca..e48680b 100644 --- a/units/gpio/manifest.pxu +++ b/units/gpio/manifest.pxu @@ -1,5 +1,5 @@ unit: manifest entry id: gpio_loopback -prompt: Does this device have the following?: +_prompt: Does this device have the following?: _name: GPIO Loopback Connector -value-type: bool \ No newline at end of file +value-type: bool diff --git a/units/i2c/category.pxu b/units/i2c/category.pxu index b0020b1..16f0bfa 100644 --- a/units/i2c/category.pxu +++ b/units/i2c/category.pxu @@ -6,4 +6,4 @@ unit: category id: i2c -_name: I2C (Inter-Integrated Circuit) +_name: I²C (Inter-Integrated Circuit) diff --git a/units/i2c/jobs.pxu b/units/i2c/jobs.pxu index b0ff9d7..fa3e0b5 100644 --- a/units/i2c/jobs.pxu +++ b/units/i2c/jobs.pxu @@ -6,20 +6,17 @@ unit: job id: i2c/i2c-bus-detect -_summary: Check number of detected I2C bus -_purpose: - Verify if number of detected I2C bus is as expected -_steps: - 1. This task is fully automatic, when expected i2c bus number($I2C_BUS_NUMBER) - is set, this job will verify if detected number of i2c bus is as expected. - 2. If expected i2c bus number is not set, this job will pass if system - detected there's at least one i2c bus. +_summary: Check presence of an I²C bus +_description: + If an expected number of I²C buses is provided, the job will verify the + detected number is correct. If the expected number of buses is not provided + the job will pass if at least one I²C bus is detected. command: - if [ -z "${I2C_BUS_NUMBER+x}" ]; then - i2c_driver_test.py bus - else - i2c_driver_test.py bus -b "$I2C_BUS_NUMBER" - fi + if [ -z "${I2C_BUS_NUMBER+x}" ]; then + i2c_driver_test.py bus + else + i2c_driver_test.py bus -b "$I2C_BUS_NUMBER" + fi user: root plugin: shell category_id: i2c @@ -30,14 +27,11 @@ imports: from com.canonical.plainbox import manifest unit: job id: i2c/i2c-device-detect -_summary: Check if any I2C device detected -_purpose: - Verify if there's any I2C device -_steps: - 1. This task is fully automatic, test will pass if there's at least one - i2c device detected on any I2C bus. +_summary: Check if any I²C devices can be detected +_description: + The test will pass if there's at least one I²C device detected on any I²C bus. command: - i2c_driver_test.py device + i2c_driver_test.py device user: root plugin: shell category_id: i2c diff --git a/units/i2c/manifest.pxu b/units/i2c/manifest.pxu index ac944f3..8e39de2 100644 --- a/units/i2c/manifest.pxu +++ b/units/i2c/manifest.pxu @@ -6,5 +6,5 @@ unit: manifest entry id: has_i2c -_name: An I2C bus +_name: An I²C bus value-type: bool diff --git a/units/i2c/test-plan.pxu b/units/i2c/test-plan.pxu index 99e9aaf..fc626df 100644 --- a/units/i2c/test-plan.pxu +++ b/units/i2c/test-plan.pxu @@ -1,15 +1,22 @@ id: i2c-full unit: test plan -_name: I2c tests -_description: QA i2c tests for Snappy Ubuntu Core devices +_name: I²C tests +_description: I²C tests for Ubuntu Core devices include: nested_part: + i2c-manual i2c-automated +id: i2c-manual +unit: test plan +_name: Manual I²C tests +_description: Manual I²C tests for Ubuntu Core devices +include: + id: i2c-automated unit: test plan -_name: Automated i2c tests -_description: Automated i2c tests for Snappy Ubuntu Core devices +_name: Automated I²C tests +_description: Automated I²C tests for Ubuntu Core devices include: i2c/i2c-bus-detect i2c/i2c-device-detect diff --git a/units/image/jobs.pxu b/units/image/jobs.pxu index efe8d4e..d185550 100644 --- a/units/image/jobs.pxu +++ b/units/image/jobs.pxu @@ -1,8 +1,8 @@ id: image/kernel-publisher-canonical category_id: image -summary: Check that the kernel snap publisher is Canonical -description: +_summary: Check that the kernel snap publisher is Canonical +_description: During certification testing IoT devices must be running a kernel supplied by Canonical plugin: shell @@ -13,8 +13,8 @@ flags: preserve-locale id: image/kernel-tracking-stable category_id: image -summary: Check that the kernel snap is tracking stable channel -description: +_summary: Check that the kernel snap is tracking stable channel +_description: During certification testing IoT devices must be running a kernel that is on a stable channel plugin: shell @@ -25,8 +25,8 @@ flags: preserve-locale id: image/gadget-publisher-canonical category_id: image -summary: Check that the gadget snap publisher is Canonical -description: +_summary: Check that the gadget snap publisher is Canonical +_description: During certification testing IoT devices must be running a kernel supplied by Canonical plugin: shell @@ -37,8 +37,8 @@ flags: preserve-locale id: image/gadget-tracking-stable category_id: image -summary: Check that the gadget snap is tracking stable channel -description: +_summary: Check that the gadget snap is tracking stable channel +_description: During certification testing IoT devices must be running a gadget that is on a stable channel plugin: shell @@ -49,8 +49,8 @@ flags: preserve-locale id: image/model-authority-canonical category_id: image -summary: Check that model authority-id is canonical -description: +_summary: Check that model authority-id is canonical +_description: The authority-id declares on whose authority this assertion is made. This must be Canonical for the certification of IoT devices. plugin: shell @@ -61,12 +61,28 @@ flags: preserve-locale id: image/model-brand-canonical category_id: image -summary: Check the model brand-id is canoncial -description: +_summary: Check the model brand-id is canoncial +_description: For the certification of IoT devices canonical provided generic images must be used. Hence, the brand-id must be canonical. plugin: shell command: ubuntucore_image_checks.py model-brand estimated_duration: 2.0 -flags: preserve-locale \ No newline at end of file +flags: preserve-locale + +id: image/model-grade-not-dangerous +category_id: image +_summary: Check that the model grade is not missing or set to dangerous +requires: + lsb.distributor_id == "Ubuntu Core" and int(lsb.release) >= 20 +_description: + Images with the 'dangerous' grade (the lowest of all available grades) + results in certain security measures to be relaxed. + Images that require strict security related implementations must + have the model grade set to a grade higher than 'dangerous'. +plugin: shell +command: + ubuntucore_image_checks.py model-grade +estimated_duration: 2.0 +flags: preserve-locale diff --git a/units/image/test-plan.pxu b/units/image/test-plan.pxu index 48af204..73e5fa3 100644 --- a/units/image/test-plan.pxu +++ b/units/image/test-plan.pxu @@ -1,7 +1,7 @@ id: iot-cert-image-full unit: test plan -name: Sanity checks for images being certified on IoT devices +_name: Sanity checks for images being certified on IoT devices include: nested_part: iot-cert-image-manual @@ -9,12 +9,12 @@ nested_part: id: iot-cert-image-automated unit: test plan -name: Automated Sanity checks for images being certified on IoT devices +_name: Automated Sanity checks for images being certified on IoT devices include: image/.* id: iot-cert-image-manual unit: test plan -name: Manual Sanity checks for images being certified on IoT devices +_name: Manual Sanity checks for images being certified on IoT devices include: diff --git a/units/info/jobs.pxu b/units/info/jobs.pxu index ba6b376..40d31af 100644 --- a/units/info/jobs.pxu +++ b/units/info/jobs.pxu @@ -346,25 +346,30 @@ _description: Attaches information about disk partitions plugin: attachment category_id: com.canonical.plainbox::info id: info/buildstamp +template-engine: jinja2 estimated_duration: 0.1 _description: Attaches the buildstamp identifier for the OS _summary: Attaches the buildstamp identifier for the OS command: - if [ -s /var/lib/ubuntu_dist_channel ]; then - cat /var/lib/ubuntu_dist_channel - elif [ -s /etc/buildstamp ]; then - cat /etc/buildstamp - elif [ -s /run/mnt/ubuntu-seed/.disk/info ]; then - cat /run/mnt/ubuntu-seed/.disk/info - elif [ -s /etc/media-info ]; then - cat /etc/media-info - elif [ -s /writable/system-data/etc/buildstamp ]; then - cat /writable/system-data/etc/buildstamp - elif [ -e /var/lib/snapd/seed/seed.yaml ]; then - echo && date -r /var/lib/snapd/seed/seed.yaml -R - else - exit 1 - fi + {%- if __on_ubuntucore__ %} + if [ -s /run/mnt/ubuntu-seed/.disk/info ]; then + cat /run/mnt/ubuntu-seed/.disk/info + elif [ -s /writable/system-data/etc/buildstamp ]; then + cat /writable/system-data/etc/buildstamp + elif [ -e /var/lib/snapd/seed/seed.yaml ]; then + echo && date -r /var/lib/snapd/seed/seed.yaml -R + fi + {% else -%} + if [ -s /.disk/info ]; then # Ubuntu Classic + cat /.disk/info + elif [ -s /etc/media-info ]; then + cat /etc/media-info + elif [ -s /var/lib/ubuntu_dist_channel ]; then # PC projects + cat /var/lib/ubuntu_dist_channel + else + exit 1 + fi + {% endif -%} plugin: shell category_id: com.canonical.plainbox::info diff --git a/units/info/test-plan.pxu b/units/info/test-plan.pxu index 6e59a73..52e4da3 100644 --- a/units/info/test-plan.pxu +++ b/units/info/test-plan.pxu @@ -52,6 +52,7 @@ include: sysctl_attachment sysfs_attachment udev_attachment + firmware/fwts_dump_acpi_attachment.gz bootstrap_include: device diff --git a/units/keys/jobs.pxu b/units/keys/jobs.pxu index 3b42f3e..423b2f3 100644 --- a/units/keys/jobs.pxu +++ b/units/keys/jobs.pxu @@ -306,10 +306,10 @@ command: gsettings set org.gnome.settings-daemon.plugins.power power-button-action "$action" [[ $(grep -c "PBTN.*00000080" "$PLAINBOX_SESSION_SHARE"/power-button-event.log) -eq 1 ]] || \ [[ $(grep -c "PWRB.*00000080" "$PLAINBOX_SESSION_SHARE"/power-button-event.log) -eq 1 ]] -purpose: +_purpose: This test will check if power button event has reported correctly, the listener will wait for 10 seconds. -steps: +_steps: 1. Single press and release the power button in 10 seconds, some platforms might need long-press to trigger the PBTN or PWRB event 2. Check the number of output PBTN/PWRB event diff --git a/units/mediacard/test-plan.pxu b/units/mediacard/test-plan.pxu index 8b267a6..04151da 100644 --- a/units/mediacard/test-plan.pxu +++ b/units/mediacard/test-plan.pxu @@ -68,10 +68,38 @@ unit: test plan _name: Manual mediacard tests _description: Manual mediacard tests for Snappy Ubuntu Core devices include: - mediacard/.*-insert - mediacard/.*-storage - mediacard/.*-remove - mediacard/.*-performance-manual + mediacard/cf-insert + mediacard/cf-storage + mediacard/cf-remove + mediacard/cf-performance-manual + mediacard/mmc-insert + mediacard/mmc-storage + mediacard/mmc-remove + mediacard/mmc-performance-manual + mediacard/ms-insert + mediacard/ms-storage + mediacard/ms-remove + mediacard/ms-performance-manual + mediacard/msp-insert + mediacard/msp-storage + mediacard/msp-remove + mediacard/msp-performance-manual + mediacard/sd-insert + mediacard/sd-storage + mediacard/sd-remove + mediacard/sd-performance-manual + mediacard/sdhc-insert + mediacard/sdhc-storage + mediacard/sdhc-remove + mediacard/sdhc-performance-manual + mediacard/sdxc-insert + mediacard/sdxc-storage + mediacard/sdxc-remove + mediacard/sdxc-performance-manual + mediacard/xd-insert + mediacard/xd-storage + mediacard/xd-remove + mediacard/xd-performance-manual id: mediacard-automated unit: test plan diff --git a/units/miscellanea/jobs.pxu b/units/miscellanea/jobs.pxu index 5d51176..eb72d08 100644 --- a/units/miscellanea/jobs.pxu +++ b/units/miscellanea/jobs.pxu @@ -184,6 +184,8 @@ _description: Test to verify that the system uses production, rather than pre-release, versions of the kernel and the OS. command: check-prerelease.py +requires: + "Ubuntu Core" not in lsb.description plugin: shell category_id: com.canonical.plainbox::miscellanea @@ -493,3 +495,22 @@ _description: privileges _summary: Verify BMC user called 'maas' was successfully created + +id: miscellanea/ubuntu_drivers_list_oem_check +category_id: com.canonical.plainbox::miscellanea +_summary: Test the command to list-oem packages runs successfully +flags: simple +requires: executable.name == 'ubuntu-drivers' +command: + ubuntu-drivers list-oem --package-list="$PLAINBOX_SESSION_SHARE/ubuntu_drivers_list_oem_check" + +id: miscellanea/ubuntu_drivers_list_oem_check_attachment +category_id: com.canonical.plainbox::miscellanea +_summary: Attach the ubuntu-drivers output file if it exists +plugin: attachment +depends: miscellanea/ubuntu_drivers_list_oem_check +command: + if test -f "$PLAINBOX_SESSION_SHARE/ubuntu_drivers_list_oem_check"; then + cat "$PLAINBOX_SESSION_SHARE/ubuntu_drivers_list_oem_check" + fi + true diff --git a/units/miscellanea/snap-auto-connection.pxu b/units/miscellanea/snap-auto-connection.pxu new file mode 100644 index 0000000..1dee3f3 --- /dev/null +++ b/units/miscellanea/snap-auto-connection.pxu @@ -0,0 +1,15 @@ +# This template job can be used to check any required snap interface connections. +# For example, if you wish to check that the "home" +# plug of the "multipass" snap is connected to a corresponding slot, +# simply run the job com.canonical.certification::miscellanea/check-plug_multipass_home +unit: template +template-engine: jinja2 +template-resource: interface +template-filter: interface.type == 'plug' +id: miscellanea/check-plug_{{ snap }}_{{ name }} +_summary: Ensure the {{ snap }} snap's {{ name }} plug is connected +plugin: shell +command: + plug_connected_test.py {{ snap }} {{ name }} +category_id: com.canonical.plainbox::miscellanea +estimated_duration: 1.0 diff --git a/units/miscellanea/test-plan.pxu b/units/miscellanea/test-plan.pxu index 60741b6..97c94fc 100644 --- a/units/miscellanea/test-plan.pxu +++ b/units/miscellanea/test-plan.pxu @@ -65,7 +65,6 @@ mandatory_include: miscellanea/get_maas_version certification-status=blocker miscellanea/maas_user_check miscellanea/efi_boot_mode certification-status=blocker - miscellanea/secure_boot_mode miscellanea/reboot_firmware miscellanea/efi_pxeboot miscellanea/check_prerelease @@ -87,8 +86,6 @@ mandatory_include: miscellanea/submission-resources miscellanea/cpuid miscellanea/efi_boot_mode certification-status=blocker - miscellanea/efi_pxeboot - miscellanea/cpus_are_not_samples miscellanea/ipmi_test certification-status=blocker miscellanea/bmc_info miscellanea/dmitest_server diff --git a/units/power-management/jobs.pxu b/units/power-management/jobs.pxu index 9dc6851..d2ef21b 100644 --- a/units/power-management/jobs.pxu +++ b/units/power-management/jobs.pxu @@ -342,6 +342,7 @@ plugin: shell requires: cpuinfo.cpu_lpi_file in ('low_power_idle_cpu_residency_us', 'package_cstate_show') package.name == 'x11-xserver-utils' + sleep.mem_sleep == 's2idle' command: cpu_lpi_file=$(cpuinfo_resource.py | grep cpu_lpi_file | awk '{ print $2 }') if [ "$cpu_lpi_file" == "low_power_idle_cpu_residency_us" ]; then @@ -382,6 +383,7 @@ unit: job plugin: shell requires: cpuinfo.sys_lpi_file in ('low_power_idle_system_residency_us', 'slp_s0_residency_usec') + sleep.mem_sleep == 's2idle' command: sys_lpi_file=$(cpuinfo_resource.py | grep sys_lpi_file | awk '{ print $2 }') echo "mem_sleep: $(cat /sys/power/mem_sleep)" diff --git a/units/snapd/snapd.pxu b/units/snapd/snapd.pxu index fdc1922..65cf5a8 100644 --- a/units/snapd/snapd.pxu +++ b/units/snapd/snapd.pxu @@ -19,6 +19,7 @@ command: snap_tests.py search category_id: snapd estimated_duration: 10s flags: preserve-locale +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL CHECKBOX_RUNTIME id: snappy/snap-install template-engine: jinja2 @@ -33,7 +34,7 @@ category_id: snapd estimated_duration: 10s flags: preserve-locale user: root -environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL CHECKBOX_RUNTIME id: snappy/snap-remove template-engine: jinja2 @@ -48,7 +49,7 @@ category_id: snapd estimated_duration: 10s flags: preserve-locale user: root -environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL CHECKBOX_RUNTIME id: snappy/snap-refresh _summary: Test the snap refresh command is able to update the hello snap. @@ -115,7 +116,7 @@ command: snap_tests.py refresh category_id: snapd estimated_duration: 10s user: root -environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL CHECKBOX_RUNTIME id: snappy/snap-revert-automated template-engine: jinja2 @@ -129,7 +130,7 @@ command: snap_tests.py revert category_id: snapd estimated_duration: 10s user: root -environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL CHECKBOX_RUNTIME id: snappy/snap-reupdate-automated template-engine: jinja2 @@ -142,7 +143,7 @@ command: snap_tests.py reupdate category_id: snapd estimated_duration: 10s user: root -environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL CHECKBOX_RUNTIME id: snappy/os-refresh _summary: Refresh the system using the snap tool @@ -187,7 +188,7 @@ _summary: Rollback system update using the snap tool _purpose: Check core can be reverted by snap revert _steps: - 1. Check version number + 1. Check version number (Note the version number) snap list core 2. Revert snap revert core @@ -195,8 +196,10 @@ _steps: sudo reboot 4. Check version number snap list core + 5. Remove reverted version (and associated data) to make system clean + snap remove core --revision=<edge_revision> _verification: - Check core version is back to its stable version + Check core version at step 4 is back to its stable version plugin: manual depends: snappy/os-refresh category_id: snapd @@ -207,7 +210,7 @@ _summary: Rollback system update using the snap tool _purpose: Check core can be reverted by snap revert _steps: - 1. Check version number + 1. Check version number (Note the version number) snap list core 2. Revert snap revert core @@ -215,75 +218,15 @@ _steps: sudo reboot 4. Check version number snap list core + 5. Remove reverted version (and associated data) to make system clean + snap remove core --revision=<edge_revision> _verification: - Check core version is back to its stable version + Check core version at step 4 is back to its stable version plugin: manual depends: snappy/os-refresh-with-refresh-control category_id: snapd estimated_duration: 400 -id: snappy/os-fail-boot -_summary: Automatically rollback after failed boot after upgrade -_purpose: - Check system will rollback to original core snap if failed to boot the updated one -_steps: - 1. Remove reverted version (and associated data) - snap remove core --revision=<edge_revision> - 2. Check that the edge revision is back in the refresh list - snap refresh --list core - 3. Update - snap refresh core --edge - 4. Modify the GRUB Environment Block to simulate a failed boot - sudo /usr/bin/grub-editenv /boot/grub/grubenv set snap_mode=trying - 5. Reboot the system and log in - sudo reboot - 6. Check version number - snap list core -_verification: - Check system is currently booting the stable core version -plugin: manual -category_id: snapd -depends: snappy/os-revert -estimated_duration: 500 - -id: snappy/os-fail-boot-with-refresh-control -_summary: Automatically rollback after failed boot after upgrade -_purpose: - Check system will rollback to original core snap if failed to boot the updated one -_steps: - 1. Remove reverted version (and associated data) - snap remove core --revision=<edge_revision> - 2. Check that the edge revision is back in the refresh list - snap refresh --list core - 3. Update - snap refresh core --edge --ignore-validation - 4. Modify the GRUB Environment Block to simulate a failed boot - sudo /usr/bin/grub-editenv /boot/grub/grubenv set snap_mode=trying - 5. Reboot the system and log in - sudo reboot - 6. Check version number - snap list core -_verification: - Check system is currently booting the stable core version -plugin: manual -category_id: snapd -depends: snappy/os-revert-with-refresh-control -estimated_duration: 500 - -id: snappy/sshd -_summary: SSH is enabled and operational -_purpose: - Check if user can access the system through ssh from other machine -_steps: - 1. Execute following command on other machine in same network - ssh [user id]@[ip address of the testing system] - 2. Enter password to login -_verification: - Can log into system through ssh from other machine -plugin: manual -category_id: snapd -estimated_duration: 120 - id: snappy/test-store-install-beta _summary: Snappy install command - beta channel store _purpose: @@ -295,6 +238,7 @@ user: root category_id: snapd estimated_duration: 30s flags: preserve-locale +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL CHECKBOX_RUNTIME id: snappy/test-store-install-edge _summary: Snappy install command - edge channel store @@ -307,6 +251,7 @@ user: root category_id: snapd estimated_duration: 30s flags: preserve-locale +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL CHECKBOX_RUNTIME unit: template template-resource: com.canonical.certification::model_assertion diff --git a/units/snapd/test-plan.pxu b/units/snapd/test-plan.pxu index b476809..041bdb3 100644 --- a/units/snapd/test-plan.pxu +++ b/units/snapd/test-plan.pxu @@ -31,8 +31,6 @@ _description: include: snappy/os-refresh snappy/os-revert - snappy/os-fail-boot - snappy/sshd mandatory_include: snap bootstrap_include: @@ -47,8 +45,6 @@ _description: include: snappy/os-refresh-with-refresh-control snappy/os-revert-with-refresh-control - snappy/os-fail-boot-with-refresh-control - snappy/sshd mandatory_include: snap bootstrap_include: diff --git a/units/socketcan/manifest.pxu b/units/socketcan/manifest.pxu index 2c9b898..d2efeb5 100644 --- a/units/socketcan/manifest.pxu +++ b/units/socketcan/manifest.pxu @@ -1,6 +1,6 @@ unit: manifest entry id: socket_can_echo_server_running -prompt: Is the device connected to the following?: +_prompt: Is the device connected to the following?: _name: A SocketCAN Echo Server value-type: bool diff --git a/units/stress/stress-ng.pxu b/units/stress/stress-ng.pxu index 9cbe615..8dd6853 100644 --- a/units/stress/stress-ng.pxu +++ b/units/stress/stress-ng.pxu @@ -27,5 +27,7 @@ _description: same number of proccesses as online processors. plugin: shell estimated_duration: 1200.0 +environ: STRESS_NG_CLASSES_TIMEOUT command: - stress-ng --sequential 0 --class {stress-ng-class} + cd /var/tmp || exit $? + stress-ng --sequential 0 --class {stress-ng-class} --timeout "${{STRESS_NG_CLASSES_TIMEOUT:-30}}" diff --git a/units/submission/jobs.pxu b/units/submission/jobs.pxu index a8c8c7f..dc5d5a5 100644 --- a/units/submission/jobs.pxu +++ b/units/submission/jobs.pxu @@ -1,9 +1,14 @@ id: dkms_info_json +template-engine: jinja2 plugin: attachment category_id: com.canonical.plainbox::info command: + {%- if __on_ubuntucore__ %} + echo "{}" + {%- else %} dkms_info.py --format json | python3 -m plainbox dev parse dkms-info | \ jq '.dkms_info' + {% endif -%} _description: Attaches json dumps of installed dkms package information. _summary: Attaches json dumps of installed dkms package information. diff --git a/units/touchpad/jobs.pxu b/units/touchpad/jobs.pxu index bb6f596..e0d118b 100644 --- a/units/touchpad/jobs.pxu +++ b/units/touchpad/jobs.pxu @@ -220,28 +220,14 @@ _siblings: unit: template template-resource: device -template-filter: device.category == 'TOUCHPAD' +template-filter: + device.category == 'TOUCHPAD' and device.driver == 'hid-multitouch' template-unit: job plugin: shell category_id: com.canonical.plainbox::touchpad id: touchpad/palm-rejection-firmware-labeling_{product_slug} -requires: device.driver == 'hid-multitouch' estimated_duration: 5.0 -command: - abs_caps=$(cat </sys{path}/capabilities/abs) - abs_caps_hex=$((16#"$abs_caps")) - tool_type_bit=$((abs_caps_hex >> 55)) - support=$((tool_type_bit & 1)) - if [ $support -eq 1 ]; then - exit 0 - else - echo "Touchapd info:" - cat </sys{path}/name - cat </sys{path}/modalias - echo "Touchpad EV_ABS capabilities:" - echo "$abs_caps" - exit 1 - fi +command: touchpad_confidence_bit.py {product_slug} _summary: Touchpad EV_ABS capability check _description: Libinput firmware/labeling palm detection rely on touchpad ABS_MT_TOOL_TYPE diff --git a/units/touchpad/test-plan.pxu b/units/touchpad/test-plan.pxu index 39769d0..e03ea54 100644 --- a/units/touchpad/test-plan.pxu +++ b/units/touchpad/test-plan.pxu @@ -30,7 +30,7 @@ _description: Touchpad tests (Automated) include: touchpad/detected-as-mouse certification-status=blocker - touchpad/palm-rejection-firmware-labeling_.* certification-status=blocker + touchpad/palm-rejection-firmware-labeling_.* certification-status=non-blocker id: after-suspend-touchpad-cert-full diff --git a/units/ubuntucore/jobs.pxu b/units/ubuntucore/jobs.pxu index 9dbf44f..8cae699 100644 --- a/units/ubuntucore/jobs.pxu +++ b/units/ubuntucore/jobs.pxu @@ -49,3 +49,83 @@ _verification: Check if a new serial-assertion device-key got generated after reinstallation completes plugin: manual category_id: ubuntucore + +unit: template +template-resource: lsb +template-filter: lsb.distributor_id == 'Ubuntu Core' +template-engine: jinja2 +template-unit: job +id: ubuntucore/os-fail-boot-{{description}} +_summary: Automatically rollback after failed boot after upgrade +_purpose: + Check system will rollback to original core snap if failed to boot the updated one +_steps: + {% if release == '16' -%} + {% set release = '' -%} + {% endif -%} + 1. Check the current revision of core{{release}} + $ snap list core{{release}} + 2. Update to edge. + Note that system will automatically reboot in 1 minute after doing this command. + Please execute the command in step 3 in 1 minute to stop the automatic reboot. + $ sudo snap refresh core{{release}} --edge + 3. Cancel the automatic shutdown + $ sudo shutdown -c + 4. Simulate a failed boot by the following command + $ sudo sed -i 's/base_status=try/base_status=trying/' /var/lib/snapd/modeenv + 5. Reboot the system and log in + $ sudo reboot + 6. Check the revision of core{{release}} again + $ snap list core{{release}} +_verification: + Check system is still booting the stable core version (original revision) +plugin: manual +category_id: ubuntucore +estimated_duration: 500 + +unit: template +template-resource: lsb +template-filter: lsb.distributor_id == 'Ubuntu Core' +template-engine: jinja2 +template-unit: job +id: ubuntucore/os-fail-boot-with-refresh-control-{{description}} +_summary: Automatically rollback after failed boot after upgrade +_purpose: + Check system will rollback to original core snap if failed to boot the updated one +_steps: + {% if release == '16' -%} + {% set release = '' -%} + {% endif -%} + 1. Check the current revision of core{{release}} + $ snap list core{{release}} + 2. Update to edge. + Note that system will automatically reboot in 1 minute after doing this command. + Please execute the command in step 3 in 1 minute to stop the automatic reboot. + $ sudo snap refresh core{{release}} --edge --ignore-validation + 3. Cancel the automatic shutdown + $ sudo shutdown -c + 4. Simulate a failed boot by the following command + $ sudo sed -i 's/base_status=try/base_status=trying/' /var/lib/snapd/modeenv + 5. Reboot the system and log in + $ sudo reboot + 6. Check the revision of core{{release}} again + $ snap list core{{release}} +_verification: + Check system is still booting the stable core version (original revision) +plugin: manual +category_id: ubuntucore +estimated_duration: 500 + +id: ubuntucore/sshd +_summary: SSH is enabled and operational +_purpose: + Check if user can access the system through ssh from other machine +_steps: + 1. Execute following command on other machine in same network + $ ssh [user id]@[ip address of the testing system] + 2. Enter password to login +_verification: + Can log into system through ssh from other machine +plugin: manual +category_id: ubuntucore +estimated_duration: 120 diff --git a/units/ubuntucore/test-plan.pxu b/units/ubuntucore/test-plan.pxu index cdc03d7..73b0829 100644 --- a/units/ubuntucore/test-plan.pxu +++ b/units/ubuntucore/test-plan.pxu @@ -17,6 +17,10 @@ id: ubuntucore-manual unit: test plan _name: Manual Ubuntu Core OS feature tests _description: Manual OS feature tests for Ubuntu Core devices +bootstrap_include: + lsb include: ubuntucore/os-reinstall-mode ubuntucore/os-recovery-mode + ubuntucore/os-fail-boot-(?!with-refresh-control).* + ubuntucore/sshd diff --git a/units/usb/test-plan.pxu b/units/usb/test-plan.pxu index 2f31963..e4a3df1 100644 --- a/units/usb/test-plan.pxu +++ b/units/usb/test-plan.pxu @@ -201,15 +201,16 @@ include: id: usb-full unit: test plan _name: USB tests -_description: QA USB tests for Snappy Ubuntu Core devices +_description: QA USB tests for Ubuntu Core devices include: nested_part: usb-manual + usb-automated id: usb-manual unit: test plan _name: Manual USB tests -_description: Manual USB tests for Snappy Ubuntu Core devices +_description: Manual USB tests for Ubuntu Core devices include: usb/hid usb/insert @@ -219,7 +220,7 @@ include: id: usb-automated unit: test plan _name: Automated USB tests -_description: Automated USB tests for Snappy Ubuntu Core devices +_description: Automated USB tests for Ubuntu Core devices include: usb/storage-detect usb/storage-preinserted-.* @@ -229,7 +230,7 @@ bootstrap_include: id: usb3-full unit: test plan _name: USB3 tests -_description: QA USB3 tests for Snappy Ubuntu Core devices +_description: QA USB3 tests for Ubuntu Core devices include: nested_part: usb3-manual @@ -237,24 +238,45 @@ nested_part: id: usb3-manual unit: test plan _name: Manual USB3 tests -_description: Manual USB3 tests for Snappy Ubuntu Core devices +_description: Manual USB3 tests for Ubuntu Core devices include: usb3/insert usb3/storage-automated # depends on manual one, so not automated usb3/remove +id: usb3-automated +unit: test plan +_name: Automated USB3 tests +_description: Manual USB3 tests for Ubuntu Core devices +include: + id: usb-c-full unit: test plan _name: USB-C tests -_description: QA USB-C tests for Snappy Ubuntu Core devices +_description: QA USB-C tests for Ubuntu Core devices include: nested_part: usb-c-manual + usb-c-automated id: usb-c-manual unit: test plan _name: Manual USB-C tests -_description: Manual USB-C tests for Snappy Ubuntu Core devices +_description: Manual USB-C tests for Ubuntu Core devices +include: + usb-c/c-to-a-adapter/hid + usb-c/c-to-a-adapter/insert + usb-c/c-to-a-adapter/storage-automated + usb-c/c-to-a-adapter/remove + usb-c/hid + usb-c/insert + usb-c/storage-automated + usb-c/remove + +id: usb-c-automated +unit: test plan +_name: Automated USB-C tests +_description: Automated USB-C tests for Ubuntu Core devices include: usb-c/c-to-a-adapter/hid usb-c/c-to-a-adapter/insert @@ -268,7 +290,7 @@ include: id: after-suspend-usb-full unit: test plan _name: USB tests (after suspend) -_description: QA USB tests for Snappy Ubuntu Core devices +_description: QA USB tests for Ubuntu Core devices include: nested_part: after-suspend-usb-manual @@ -276,7 +298,7 @@ nested_part: id: after-suspend-usb-manual unit: test plan _name: Manual USB tests (after suspend) -_description: Manual USB tests for Snappy Ubuntu Core devices +_description: Manual USB tests for Ubuntu Core devices include: after-suspend-usb/hid after-suspend-usb/insert @@ -286,7 +308,7 @@ include: id: after-suspend-usb3-full unit: test plan _name: USB3 tests (after suspend) -_description: QA USB3 tests for Snappy Ubuntu Core devices +_description: QA USB3 tests for Ubuntu Core devices include: nested_part: after-suspend-usb3-manual @@ -294,16 +316,22 @@ nested_part: id: after-suspend-usb3-manual unit: test plan _name: Manual USB3 tests (after suspend) -_description: Manual USB3 tests for Snappy Ubuntu Core devices +_description: Manual USB3 tests for Ubuntu Core devices include: after-suspend-usb3/insert after-suspend-usb3/storage-automated # depends on manual one, so not automated after-suspend-usb3/remove +id: after-suspend-usb3-automated +unit: test plan +_name: Automated USB3 tests (after suspend) +_description: Automated USB3 tests for Ubuntu Core devices +include: + id: after-suspend-usb-c-full unit: test plan _name: USB-C tests (after suspend) -_description: QA USB-C tests for Snappy Ubuntu Core devices +_description: QA USB-C tests for Ubuntu Core devices include: nested_part: after-suspend-usb-c-manual @@ -311,7 +339,7 @@ nested_part: id: after-suspend-usb-c-manual unit: test plan _name: Manual USB-C tests (after suspend) -_description: Manual USB-C tests for Snappy Ubuntu Core devices +_description: Manual USB-C tests for Ubuntu Core devices include: after-suspend-usb-c/c-to-a-adapter/hid after-suspend-usb-c/c-to-a-adapter/insert @@ -322,10 +350,16 @@ include: after-suspend-usb-c/storage-automated after-suspend-usb-c/remove +id: after-suspend-usb-c-automated +unit: test plan +_name: Automated USB-C tests (after suspend) +_description: Automated USB-C tests for Ubuntu Core devices +include: + id: after-suspend-usb-automated unit: test plan _name: Automated USB tests -_description: Automated USB tests for Snappy Ubuntu Core devices +_description: Automated USB tests for Ubuntu Core devices include: after-suspend-usb/storage-detect after-suspend-usb/storage-preinserted-.* diff --git a/units/virtualization/jobs.pxu b/units/virtualization/jobs.pxu index 9471031..2b6fd99 100644 --- a/units/virtualization/jobs.pxu +++ b/units/virtualization/jobs.pxu @@ -2,13 +2,13 @@ plugin: shell category_id: com.canonical.plainbox::virtualization id: virtualization/kvm_check_vm user: root -environ: KVM_TIMEOUT KVM_IMAGE http_proxy https_proxy +environ: UVT_IMAGE_OR_SOURCE http_proxy https_proxy estimated_duration: 300.0 requires: - package.name == 'qemu-system' - package.name == 'qemu-utils' + package.name == 'uvtool' + package.name == 'uvtool-libvirt' virtualization.kvm == 'supported' -command: virtualization.py --debug kvm --log-file="$PLAINBOX_SESSION_SHARE"/virt_debug +command: virtualization.py --debug uvt _description: Verifies that a KVM guest can be created and booted using an Ubuntu Server cloud image. diff --git a/units/watchdog/manifest.pxu b/units/watchdog/manifest.pxu index d80d7e1..e93385f 100644 --- a/units/watchdog/manifest.pxu +++ b/units/watchdog/manifest.pxu @@ -1,5 +1,5 @@ unit: manifest entry id: has_hardware_watchdog -_name: Hardware Watchdog +_name: A Hardware Watchdog Timer value-type: bool diff --git a/units/watchdog/test-plan.pxu b/units/watchdog/test-plan.pxu index 01057d0..417ef50 100644 --- a/units/watchdog/test-plan.pxu +++ b/units/watchdog/test-plan.pxu @@ -1,27 +1,23 @@ id: watchdog-full unit: test plan _name: Watchdog tests -_description: - QA test plan that includes watchdog tests -estimated_duration: 1m +_description: Watchdog tests for Ubuntu Core devices include: nested_part: watchdog-manual + watchdog-automated id: watchdog-manual unit: test plan _name: Manual watchdog tests -_description: Manual watchdog tests for Snappy Ubuntu Core devices +_description: Manual watchdog tests for Ubuntu Core devices include: - watchdog/systemd-config watchdog/trigger-system-reset id: watchdog-automated unit: test plan _name: Automated watchdog tests -_description: - QA test plan that includes automated watchdog tests -estimated_duration: 1s +_description: Automated watchdog tests for Ubuntu Core devices include: watchdog/detect watchdog/systemd-config diff --git a/units/wireless/manifest.pxu b/units/wireless/manifest.pxu index ed92bf6..38353b4 100644 --- a/units/wireless/manifest.pxu +++ b/units/wireless/manifest.pxu @@ -1,4 +1,4 @@ unit: manifest entry id: has_wlan_adapter -_name: A WLAN Adapter +_name: A Wi-Fi Module value-type: bool diff --git a/units/wwan/manifest.pxu b/units/wwan/manifest.pxu index b15b01f..8420e2e 100644 --- a/units/wwan/manifest.pxu +++ b/units/wwan/manifest.pxu @@ -6,5 +6,5 @@ unit: manifest entry id: has_wwan_module -_name: WWAN module +_name: A WWAN Module value-type: bool |