diff options
author | PMR <pmr@pmr-lander> | 2021-06-30 15:56:35 +0000 |
---|---|---|
committer | PMR <pmr@pmr-lander> | 2021-06-30 15:56:35 +0000 |
commit | e24158af0b4b66cde3dd3d7f2c5f198f0b8b4ebe (patch) | |
tree | fb72199fc1701394aa710499e3ff206d7e0dc6cc | |
parent | 529c39ee0a1d7daa2ae578722ccefbe2279ee388 (diff) |
Import plainbox-provider-checkbox_0.59.0~rc1.orig.tar.gzupstream-0.59.0_rc1patched-0.59.0_rc1-1
33 files changed, 613 insertions, 210 deletions
diff --git a/bin/fde_tests.py b/bin/fde_tests.py index cc75a69..0e4858b 100755 --- a/bin/fde_tests.py +++ b/bin/fde_tests.py @@ -16,7 +16,6 @@ the desktop installer. """ import os -import re import subprocess as sp import sys @@ -91,15 +90,9 @@ def main(): cryptinfo = sp.check_output(cmd, shell=True).decode( sys.stdout.encoding).strip() except sp.CalledProcessError: - raise SystemExit('ERROR: dmsetup failed') - print(cryptinfo, '\n') - - # use the type as the final arbiter of success - regexp = re.compile(r'type:\ *LUKS\d$', re.MULTILINE) - if regexp.search(cryptinfo): - print('Full Disk Encryption is operational on this device') - else: - raise SystemExit('ERROR: cryptsetup did not report LUKS in use') + raise SystemExit('ERROR: cryptsetup check failed') + print(cryptinfo) + print('\nFull Disk Encryption is operational on this device') if __name__ == "__main__": diff --git a/bin/kernel_taint_test.py b/bin/kernel_taint_test.py index 259c05c..de59bbe 100755 --- a/bin/kernel_taint_test.py +++ b/bin/kernel_taint_test.py @@ -60,23 +60,45 @@ def get_modules(): return(modules) -def print_out_of_tree_modules(modules): - print("* Modules not in-tree:") +def process_out_of_tree_modules(modules): + mod_list = [] + modules = remove_ignored_modules(modules) for mod in modules: cmd = 'modinfo -F intree %s' % mod if not check_output(shlex.split(cmd), universal_newlines=True): - print(" %s" % mod) + mod_list.append(mod) + return(mod_list) -def print_GPL_incompatible_modules(modules): - print("* Modules with GPL Incompatible Licenses:") +def process_GPL_incompatible_modules(modules): + mod_list = [] + modules = remove_ignored_modules(modules) for mod in modules: cmd = 'modinfo -F license %s' % mod license = check_output(shlex.split(cmd), universal_newlines=True).strip() if "GPL" not in license and "MIT" not in license: - print(" %s: %s" % (mod, license)) + mod_list.append((mod, license)) + return(mod_list) + + +def remove_ignored_modules(modules): + # Remove modules we know will fail, but accept + ignored_modules = ['zfs', + 'zunicode', + 'zlua', + 'zavl', + 'icp', + 'zcommon', + 'znvpair', + 'spl'] + for ignore_mod in ignored_modules: + try: + modules.remove(ignore_mod) + except ValueError: + pass + return(modules) def report_failures(taints): @@ -107,14 +129,30 @@ def report_failures(taints): modules = get_modules() print("Taint bit value: {} ({})".format(i, taint_meanings[i])) if i == 0: # List GPL incompatible modules and licenses - print_GPL_incompatible_modules(modules) - if i == 12: # List out-of-tree modules - print_out_of_tree_modules(modules) - if i == 11: + proprietary_modules = process_GPL_incompatible_modules(modules) + if proprietary_modules: + print("* Modules with GPL Incompatible Licenses:") + for mod in proprietary_modules: + print(" %s: %s" % (mod[0], mod[1])) + count += 1 + else: + print("* Proprietary modules found, " + "but they are expected and OK") + elif i == 11: print("* Firmware workarounds are expected and OK") - continue - count += 1 - + elif i == 12: # List out-of-tree modules + out_of_tree_modules = process_out_of_tree_modules(modules) + if len(out_of_tree_modules) > 0: + print("* Modules not in-tree:") + for mod in out_of_tree_modules: + print(" %s" % mod) + count += 1 + else: + print("* Out of Tree modules found, " + "but they are expected and OK") + else: + print("Taint bit value: {} ({})".format(i, taint_meanings[i])) + count += 1 if taints == 0: print("No kernel taints detected.") diff --git a/bin/network.py b/bin/network.py index 60f7b0a..3ed4770 100755 --- a/bin/network.py +++ b/bin/network.py @@ -631,18 +631,19 @@ def interface_test(args): error_number = 0 # Stop all other interfaces - extra_interfaces = \ - [iface for iface in os.listdir("/sys/class/net") - if iface != "lo" and iface != args.interface] + if not args.dont_toggle_ifaces: + extra_interfaces = \ + [iface for iface in os.listdir("/sys/class/net") + if iface != "lo" and iface != args.interface] - for iface in extra_interfaces: - logging.debug("Shutting down interface:%s", iface) - try: - check_call(["ip", "link", "set", "dev", iface, "down"]) - except CalledProcessError as interface_failure: - logging.error("Failed to shut down %s:%s", - iface, interface_failure) - error_number = 3 + for iface in extra_interfaces: + logging.debug("Shutting down interface:%s", iface) + try: + check_call(["ip", "link", "set", "dev", iface, "down"]) + except CalledProcessError as interface_failure: + logging.error("Failed to shut down %s:%s", + iface, interface_failure) + error_number = 3 if error_number == 0: start_time = datetime.datetime.now() @@ -664,14 +665,16 @@ def interface_test(args): time.sleep(30) first_loop = False - for iface in extra_interfaces: - logging.debug("Restoring interface:%s", iface) - try: - check_call(["ip", "link", "set", "dev", iface, "up"]) - wait_for_iface_up(iface, args.iface_timeout) - except CalledProcessError as interface_failure: - logging.error("Failed to restore %s:%s", iface, interface_failure) - error_number = 3 + if not args.dont_toggle_ifaces: + for iface in extra_interfaces: + logging.debug("Restoring interface:%s", iface) + try: + check_call(["ip", "link", "set", "dev", iface, "up"]) + wait_for_iface_up(iface, args.iface_timeout) + except CalledProcessError as interface_failure: + logging.error( + "Failed to restore %s:%s", iface, interface_failure) + error_number = 3 # Restore routing table to original state temp.seek(0) @@ -833,6 +836,9 @@ TEST_TARGET_IPERF = iperf-server.example.com test_parser.add_argument( '--reverse', default=False, action="store_true", help="Run in reverse mode (server sends, client receives)") + test_parser.add_argument( + '--dont-toggle-ifaces', default=False, action="store_true", + help="Do not turn of other interfaces while testing.") # Sub info options info_parser.add_argument( diff --git a/bin/removable_storage_test.py b/bin/removable_storage_test.py index 4253cbf..a3eaa4b 100755 --- a/bin/removable_storage_test.py +++ b/bin/removable_storage_test.py @@ -6,6 +6,7 @@ import dbus import hashlib import logging import os +import platform import re import shlex import subprocess @@ -476,14 +477,24 @@ class DiskTest(): udev_devices = get_udev_block_devices(udev_client) # Get a collection of all udev devices corresponding to xhci devices udev_devices_xhci = get_udev_xhci_devices(udev_client) + if platform.machine() in ("aarch64", "armv7l"): + enumerator = GUdev.Enumerator(client=udev_client) + udev_devices_xhci = [ + device for device in enumerator.execute() + if (device.get_driver() == 'xhci-hcd')] for udev_device_xhci in udev_devices_xhci: pci_slot_name = udev_device_xhci.get_property('PCI_SLOT_NAME') + xhci_devpath = udev_device_xhci.get_property('DEVPATH') for udev_device in udev_devices: devpath = udev_device.get_property('DEVPATH') if (self._compare_pci_slot_from_devpath(devpath, pci_slot_name)): self.rem_disks_xhci[ udev_device.get_property('DEVNAME')] = 'xhci' + if platform.machine() in ("aarch64", "armv7l"): + if xhci_devpath in devpath: + self.rem_disks_xhci[ + udev_device.get_property('DEVNAME')] = 'xhci' return self.rem_disks_xhci def mount(self): diff --git a/bin/short-idle-check.sh b/bin/short-idle-check.sh new file mode 100755 index 0000000..34069e3 --- /dev/null +++ b/bin/short-idle-check.sh @@ -0,0 +1,193 @@ +#!/bin/bash + +usage() { + cat <<EOU + +${0} - check short idle residency + + Usage: ${0} [ -s <interval> ] + + -s <interval> -- specify a idle time interval in seconds + +EOU +} + +re='^[0-9]+$' +sleep_time=20 + +while [ $# -gt 0 ] +do + case "$1" in + -s) + if ! [[ $2 =~ $re ]]; then + usage + exit 1 + fi + sleep_time=${2} + break + ;; + --help) + usage + exit 1 + ;; + *) + usage + exit 1 + ;; + esac + shift +done + +msr_support=$(find /dev/cpu -name msr) +if [ -z "$msr_support" ]; then + echo "Attempting to load Intel MSR kernel module..." + modprobe msr +fi + +cstate_pkg_list=$(ls /sys/bus/event_source/devices/cstate_pkg/events/) +msr_pc2=0 +msr_pc3=0 +msr_pc6=0 +msr_pc7=0 +msr_pc8=0 +msr_pc9=0 +msr_pc10=0 + +for event in $cstate_pkg_list; +do + case "$event" in + "c2-residency") + msr_pc2=1 + ;; + "c3-residency") + msr_pc3=1 + ;; + "c6-residency") + msr_pc6=1 + ;; + "c7-residency") + msr_pc7=1 + ;; + "c8-residency") + msr_pc8=1 + ;; + "c9-residency") + msr_pc9=1 + ;; + "c10-residency") + msr_pc10=1 + ;; + esac +done + +# Find the platform's cstate accroding to +# registered event node +# https://elixir.bootlin.com/linux/latest/source/arch/x86/events/intel/cstate.c#L504 +# +# Find the MSR register in +# https://elixir.bootlin.com/linux/latest/source/arch/x86/include/asm/msr-index.h#L285 +# NHM support +if [ $((msr_pc2+msr_pc8+msr_pc9+msr_pc10)) -eq 0 ] && [ $msr_pc3 -eq 1 ] && [ $msr_pc6 -eq 1 ] && [ $msr_pc7 -eq 1 ]; then + echo "Identified device as supporting Intel Nehalem C-states" + counter_pc7=$(rdmsr -p 0 -o 0x3fa) + sleep "$sleep_time" + new_counter_pc7=$(rdmsr -p 0 -o 0x3fa) + delt_pc7=$((new_counter_pc7-counter_pc7)) + echo "Target MSR PC7 residency delta before/after idle is $delt_pc7" + if [ $delt_pc7 -gt 0 ]; then + echo "PASS: Time spent in PC7 state" + exit 0 + else + exit 1 + fi +fi + +# SNB support +if [ $((msr_pc8+msr_pc9+msr_pc10)) -eq 0 ] && [ $msr_pc2 -eq 1 ] && [ $msr_pc3 -eq 1 ] && [ $msr_pc6 -eq 1 ] && [ $msr_pc7 -eq 1 ]; then + echo "Identified device as supporting Intel Sandybridge C-states" + counter_pc7=$(rdmsr -p 0 -o 0x3fa) + sleep "$sleep_time" + new_counter_pc7=$(rdmsr -p 0 -o 0x3fa) + delt_pc7=$((new_counter_pc7-counter_pc7)) + echo "Target MSR PC7 residency delta before/after idle is $delt_pc7" + if [ $delt_pc7 -gt 0 ]; then + echo "PASS: Time spent in PC7 state" + exit 0 + else + exit 1 + fi +fi + +# SLM support with SLM_PKG_C6_USE_C7_MSR +if [ $((msr_pc2+msr_pc3+msr_pc7+msr_pc8+msr_pc9+msr_pc10)) -eq 0 ] && [ $msr_pc6 -eq 1 ]; then + echo "Identified device as supporting Intel Silvermont C-states" + counter_pc6=$(rdmsr -p 0 -o 0x3fa) + sleep "$sleep_time" + new_counter_pc6=$(rdmsr -p 0 -o 0x3fa) + delt_pc6=$((new_counter_pc6-counter_pc6)) + echo "Target MSR PC6 residency delta before/after idle is $delt_pc6" + if [ $delt_pc6 -gt 0 ]; then + echo "PASS: Time spent in PC6 state" + exit 0 + else + exit 1 + fi +fi + +# KNL support +if [ $((msr_pc7+msr_pc8+msr_pc9+msr_pc10)) -eq 0 ] && [ $msr_pc2 -eq 1 ] && [ $msr_pc3 -eq 1 ] && [ $msr_pc6 -eq 1 ]; then + echo "Identified device as supporting Intel Knights Landing C-states" + counter_pc6=$(rdmsr -p 0 -o 0x3f9) + sleep "$sleep_time" + new_counter_pc6=$(rdmsr -p 0 -o 0x3f9) + delt_pc6=$((new_counter_pc6-counter_pc6)) + echo "Target MSR PC6 residency delta before/after idle is $delt_pc6" + if [ $delt_pc6 -gt 0 ]; then + echo "PASS: Time spent in PC6 state" + exit 0 + else + exit 1 + fi +fi + +# GLM support +if [ $((msr_pc7+msr_pc8+msr_pc9)) -eq 0 ] && [ $msr_pc2 -eq 1 ] && [ $msr_pc3 -eq 1 ] && [ $msr_pc6 -eq 1 ] && [ $msr_pc10 -eq 1 ]; then + echo "Identified device as supporting Intel Goldmont C-states" + counter_pc6=$(rdmsr -p 0 -o 0x3f9) + counter_pc10=$(rdmsr -p 0 -o 0x632) + sleep "$sleep_time" + new_counter_pc6=$(rdmsr -p 0 -o 0x3f9) + new_counter_pc10=$(rdmsr -p 0 -o 0x632) + delt_pc6=$((new_counter_pc6-counter_pc6)) + delt_pc10=$((new_counter_pc10-counter_pc10)) + echo "Target MSR PC6 residency delta before/after idle is $delt_pc6" + if [ $((delt_pc6+delt_pc10)) -gt 0 ]; then + echo "PASS: Time spent in at least one of PC6 or PC10 state" + exit 0 + else + exit 1 + fi +fi + +# ADL/ICL/CNL/HSWULT +echo "Assuming device supports one of Alderlake/Icelake/Cannonlake/Haswell C-states" +counter_pc8=$(rdmsr -p 0 -o 0x630) +counter_pc9=$(rdmsr -p 0 -o 0x631) +counter_pc10=$(rdmsr -p 0 -o 0x632) +sleep "$sleep_time" +new_counter_pc8=$(rdmsr -p 0 -o 0x630) +new_counter_pc9=$(rdmsr -p 0 -o 0x631) +new_counter_pc10=$(rdmsr -p 0 -o 0x632) +delt_pc8=$((new_counter_pc8-counter_pc8)) +delt_pc9=$((new_counter_pc9-counter_pc9)) +delt_pc10=$((new_counter_pc10-counter_pc10)) +echo "PC8 MSR residency delta before/after idle is $delt_pc8" +echo "PC9 MSR residency delta before/after idle is $delt_pc9" +echo "PC10 MSR residency delta before/after idle is $delt_pc10" + +if [ $((delt_pc8+delt_pc9+delt_pc10)) -gt 0 ]; then + echo "PASS: Time spent in at least one of PC8, PC9 or PC10 states" + exit 0 +fi + +exit 1 diff --git a/bin/snap_confinement_test.py b/bin/snap_confinement_test.py new file mode 100755 index 0000000..d682a86 --- /dev/null +++ b/bin/snap_confinement_test.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +# Copyright 2021 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Patrick Liu <patrick.liu@canonical.com> +# +# Checkbox is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3, +# as published by the Free Software Foundation. +# +# Checkbox is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Checkbox. If not, see <http://www.gnu.org/licenses/>. + +import json +import logging +import sys +from checkbox_support.snap_utils.snapd import Snapd + +features_should_include = [ + "kernel:caps", + "kernel:dbus", + "kernel:domain", + "kernel:file", + "kernel:mount", + "kernel:namespaces", + "kernel:network", + "kernel:ptrace", + "kernel:signal", + "parser:unsafe", +] + + +def main(): + + data = Snapd().get_system_info() + + confinement = data["confinement"] + if confinement == "strict": + print("Test PASS") + return 0 + + sandbox_features = data["sandbox-features"] + sandbox_features_output = ( + "\nOUTPUT: confinement: {}\nOUTPUT: sandbox-features:\n{}".format( + confinement, json.dumps(sandbox_features, indent=2) + ) + ) + + missing_features = [] + if "apparmor" not in sandbox_features: + logging.error("Cannot find 'apparmor' in sandbox-features") + else: + for feature in features_should_include: + if feature not in sandbox_features["apparmor"]: + missing_features.append(feature) + + if missing_features: + logging.error("Cannot find '{}' in apparmor".format(missing_features)) + + categories_to_check = ["mount", "udev"] + for category in categories_to_check: + if category not in sandbox_features: + logging.error( + "Cannot find '{}' in sandbox-features".format(category) + ) + break + for feature in sandbox_features[category]: + if "cgroup-v2" in feature: + logging.error("cgroup({}) must NOT be v2".format(feature)) + + return sandbox_features_output + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/bin/ubuntucore_image_checks.py b/bin/ubuntucore_image_checks.py index e381e61..ff14784 100755 --- a/bin/ubuntucore_image_checks.py +++ b/bin/ubuntucore_image_checks.py @@ -6,6 +6,7 @@ # Jonathan Cave <jonathan.cave@canonical.com> import io +import os import sys from checkbox_support.snap_utils.snapd import Snapd @@ -91,10 +92,14 @@ class ModelInfo(): print('PASS') def test_model_grade(self): + MODEL_GRADE = os.environ.get('MODEL_GRADE', 'secured') 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') + if self.grade != MODEL_GRADE: + raise SystemExit('ERROR: model grade is "{}",'.format(self.grade) + + ' but "{}" is expected'.format(MODEL_GRADE)) print('PASS') diff --git a/bin/virtualization.py b/bin/virtualization.py index 2f17d32..a3794de 100755 --- a/bin/virtualization.py +++ b/bin/virtualization.py @@ -26,7 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. from argparse import ArgumentParser import os import logging -import lsb_release import requests import shlex from subprocess import ( @@ -125,6 +124,33 @@ QEMU_ARCH_CONFIG = { } +def get_release_to_test(): + try: + import distro + if distro.id() == 'ubuntu-core': + return '{}.04'.format(distro.version()) + return distro.version() + except (ImportError, CalledProcessError): + import lsb_release + return lsb_release.get_distro_information()["RELEASE"] + + +def get_codename_to_test(): + try: + import distro + if distro.id() == 'ubuntu-core': + codename = 'focal' + if distro.version() == '18': + codename = 'bionic' + elif distro.version() == '16': + codename = 'xenial' + return codename + return distro.codename().split()[0].lower() + except (ImportError, CalledProcessError): + import lsb_release + lsb_release.get_distro_information()["CODENAME"] + + class QemuRunner(object): def __init__(self, arch): self.arch = arch @@ -197,7 +223,7 @@ class KVMTest(object): self.arch = check_output(['dpkg', '--print-architecture'], universal_newlines=True).strip() self.qemu_config = QEMU_ARCH_CONFIG[self.arch] - self.release = lsb_release.get_distro_information()["CODENAME"] + self.release = get_codename_to_test() def url_to_path(self, image_path): """ @@ -287,7 +313,7 @@ class KVMTest(object): url.path == '' or not (url.path.endswith(".img") or url.path.endswith(".tar.gz")) - ): + ): # If we have a relative URL (local copies of official images) # http://192.168.0.1/ or http://192.168.0.1/images/ cloud_iso = _construct_filename() @@ -535,10 +561,11 @@ class UVTKVMTest(object): def __init__(self, image=None): self.image = image - self.release = lsb_release.get_distro_information()["CODENAME"] + self.release = get_codename_to_test() self.arch = check_output(['dpkg', '--print-architecture'], universal_newlines=True).strip() - self.name = tempfile.mktemp()[5:] + # max len(name) is 8 chars for use with test-snapd-uvtool snap + self.name = tempfile.mktemp()[-8:] def run_command(self, cmd): task = RunCommand(cmd) @@ -558,11 +585,25 @@ class UVTKVMTest(object): logging.debug(' Command returned no output') return True + def ssh_command(self, private_key_file, cmd): + task = RunCommand("uvt-kvm ip {}".format(self.name)) + if task.returncode != 0: + logging.error('Command {} returnd a code of {}'.format( + task.cmd, task.returncode)) + return False + vm_ip = task.stdout + + ssh_cmd = ('ssh ubuntu@{} ' + '-o UserKnownHostsFile=/dev/null ' + '-o StrictHostKeyChecking=no ' + '-i {} {}').format(vm_ip, private_key_file, cmd) + return self.run_command(ssh_cmd) + 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. + specifed and used in uvt-simplestreams to generate an image. """ url = urlparse(self.image) @@ -607,49 +648,54 @@ class UVTKVMTest(object): 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)) + with tempfile.TemporaryDirectory( + dir=os.path.expandvars("$PLAINBOX_SESSION_SHARE")) as tmp_dir: + ssh_private_key_file = "{}/id_rsa".format(tmp_dir) + ssh_public_key_file = "{}/id_rsa.pub".format(tmp_dir) + + if not os.path.exists(ssh_private_key_file): + cmd = ('ssh-keygen -f {} -t rsa -N \'\''.format( + ssh_private_key_file)) + if not self.run_command(cmd): + return False + + # Create vm + logging.debug("Creating VM") + cmd = ('uvt-kvm create --ssh-public-key-file {} {} arch={}'.format( + ssh_public_key_file, 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) - 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("Wait for VM to complete creation") + cmd = 'uvt-kvm wait --ssh-private-key-file {} {}'.format( + ssh_private_key_file, self.name) + if not self.run_command(cmd): + return False - logging.debug("List newly created vm") - cmd = ("uvt-kvm list") - if not self.run_command(cmd): - 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") + if not self.ssh_command(ssh_private_key_file, ""): + 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 + logging.debug("Verify VM was created with ssh and run a command") + cmd = "lsb_release -a" + if not self.ssh_command(ssh_private_key_file, cmd): + return False return True @@ -664,7 +710,7 @@ class LXDTest(object): self.name = 'testbed' self.image_alias = uuid4().hex self.default_remote = "ubuntu:" - self.os_version = lsb_release.get_distro_information()["RELEASE"] + self.os_version = get_release_to_test() def run_command(self, cmd): task = RunCommand(cmd) @@ -5,7 +5,7 @@ from plainbox.provider_manager import N_ setup( name='plainbox-provider-checkbox', namespace='com.canonical.certification', - version="0.58.0", + version="0.59.0rc1", description=N_("Checkbox provider"), gettext_domain='plainbox-provider-checkbox', strict=False, deprecated=False, diff --git a/units/bluetooth/jobs.pxu b/units/bluetooth/jobs.pxu index 03e1e02..3f174bf 100644 --- a/units/bluetooth/jobs.pxu +++ b/units/bluetooth/jobs.pxu @@ -224,7 +224,7 @@ _purpose: _steps: 1. Enable a Bluetooth Smart keyboard, and put it into paring mode. 2. Commence the test to do the auto-pairing, you will be asked to select targeting keyboard from the list. - 3. After it's paired and connected, enter some text with your keyboard and close the small input test tool. + 3. After it's paired and connected, enter some text with your keyboard. _verification: Did the Bluetooth Smart keyboard work as expected? diff --git a/units/cpu/jobs.pxu b/units/cpu/jobs.pxu index b3167c4..6d1321a 100644 --- a/units/cpu/jobs.pxu +++ b/units/cpu/jobs.pxu @@ -157,6 +157,7 @@ plugin: attachment category_id: com.canonical.plainbox::cpu estimated_duration: 0.5 id: cpu/cstates_results.log +requires: cpuinfo.platform not in ("aarch64", "armv7l") after: cpu/cstates command: [ -e "${PLAINBOX_SESSION_SHARE}"/fwts_cstates_results.log ] && cat "${PLAINBOX_SESSION_SHARE}"/fwts_cstates_results.log diff --git a/units/cpu/test-plan.pxu b/units/cpu/test-plan.pxu index eb2dabb..46e9ac4 100644 --- a/units/cpu/test-plan.pxu +++ b/units/cpu/test-plan.pxu @@ -32,8 +32,6 @@ include: cpu/offlining_test certification-status=blocker cpu/topology certification-status=blocker cpu/clocktest - power-management/cpu-low-power-idle - power-management/system-low-power-idle id: cpu-cert-blockers unit: test plan diff --git a/units/ethernet/test-plan.pxu b/units/ethernet/test-plan.pxu index 5e003ae..cfc23bd 100644 --- a/units/ethernet/test-plan.pxu +++ b/units/ethernet/test-plan.pxu @@ -68,6 +68,9 @@ include: ethernet/ethtool_info ethernet/ethertool_check_.* ethernet/multi_iperf3_nic_device.* +bootstrap_include: + device + executable id: server-ethernet-underspeed unit: test plan @@ -79,3 +82,6 @@ include: ethernet/ethtool_info ethernet/ethertool_check_.* ethernet/multi_iperf3_nic_underspeed_device.* +bootstrap_include: + device + executable diff --git a/units/firmware/jobs.pxu b/units/firmware/jobs.pxu index eb8397c..e03648d 100644 --- a/units/firmware/jobs.pxu +++ b/units/firmware/jobs.pxu @@ -105,47 +105,3 @@ 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: - Presence of support for the SHA256 algorithm is a requirement for enabling FDE - support in Ubuntu Core 20 systems -plugin: shell -user: root -command: tcglog-check -required-algs sha256 -imports: from com.canonical.plainbox import manifest -requires: - cpuinfo.platform == 'x86_64' - manifest.has_tpm2_chip == 'True' - executable.name == 'tcglog-check' - -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: - 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 -plugin: shell -user: root -command: tcglog-check -require-pe-image-digests -imports: from com.canonical.plainbox import manifest -requires: - cpuinfo.platform == 'x86_64' - manifest.has_tpm2_chip == 'True' - executable.name == 'tcglog-check' - -id: firmware/tcglog-dump-attachment -category_id: com.canonical.plainbox::firmware -_summary: Attach a dump of the TCG Event log for debugging -plugin: attachment -user: root -command: tcglog-dump -imports: from com.canonical.plainbox import manifest -requires: - cpuinfo.platform == 'x86_64' - manifest.has_tpm2_chip == 'True' - executable.name == 'tcglog-dump' diff --git a/units/firmware/test-plan.pxu b/units/firmware/test-plan.pxu index 7db724d..4f63d19 100644 --- a/units/firmware/test-plan.pxu +++ b/units/firmware/test-plan.pxu @@ -11,33 +11,6 @@ bootstrap_include: fwts -id: firmware-uc20-fde-full -unit: test plan -_name: Test firmware compatibility with UC20 FDE -_description: Test firmware compatibility with UC20 FDE -include: -nested_part: - firmware-uc20-fde-manual - firmware-uc20-fde-automated - - -id: firmware-uc20-fde-manual -unit: test plan -_name: Test firmware compatibility with UC20 FDE (manual) -_description: Test firmware compatibility with UC20 FDE (manual) -include: - - -id: firmware-uc20-fde-automated -unit: test plan -_name: Test firmware compatibility with UC20 FDE (automated) -_description: Test firmware compatibility with UC20 FDE (automated) -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 diff --git a/units/image/jobs.pxu b/units/image/jobs.pxu index d185550..d5aa7d4 100644 --- a/units/image/jobs.pxu +++ b/units/image/jobs.pxu @@ -71,16 +71,18 @@ command: estimated_duration: 2.0 flags: preserve-locale -id: image/model-grade-not-dangerous +id: image/model-grade category_id: image -_summary: Check that the model grade is not missing or set to dangerous +_summary: Check that the model grade is correctly set 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'. + have the model grade set to non-dangerous grades - either the highest + grade of 'secured', or a grade passed to checkbox for checking via the + MODEL_GRADE configuration variable. plugin: shell command: ubuntucore_image_checks.py model-grade diff --git a/units/info/jobs.pxu b/units/info/jobs.pxu index 40d31af..d2ed96b 100644 --- a/units/info/jobs.pxu +++ b/units/info/jobs.pxu @@ -75,6 +75,10 @@ id: lspci_attachment plugin: attachment category_id: com.canonical.plainbox::info command: + if [[ ! -d "/proc/bus/pci" ]]; then + echo "No PCI bus found" + exit 0 + fi if [[ -v SNAP ]]; then lspci -i "$SNAP"/usr/share/misc/pci.ids -vvnn else @@ -358,6 +362,8 @@ command: 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 {% else -%} if [ -s /.disk/info ]; then # Ubuntu Classic @@ -486,6 +492,7 @@ command: cat "$SNAP"/parts_meta_info || true # should always have parts info from content snap cat "$CHECKBOX_RUNTIME"/parts_meta_info -environ: SNAP +environ: SNAP CHECKBOX_RUNTIME +user: root estimated_duration: 0.02 _summary: Attaches an information about all parts that constituted this snap diff --git a/units/keys/jobs.pxu b/units/keys/jobs.pxu index 423b2f3..6c4fc99 100644 --- a/units/keys/jobs.pxu +++ b/units/keys/jobs.pxu @@ -310,9 +310,9 @@ _purpose: This test will check if power button event has reported correctly, the listener will wait for 10 seconds. _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 + 1. Run the test (you have 10 seconds from now on) + 2. Long-press power button about 3~4 seconds one time (the PBTN/PWRB event will show below) + 3. Check the number of output PBTN/PWRB event should be Once. plugin: manual category_id: com.canonical.plainbox::keys diff --git a/units/miscellanea/jobs.pxu b/units/miscellanea/jobs.pxu index eb72d08..a1eab66 100644 --- a/units/miscellanea/jobs.pxu +++ b/units/miscellanea/jobs.pxu @@ -431,7 +431,7 @@ estimated_duration: 20.0 id: miscellanea/sosreport user: root requires: executable.name == 'sosreport' -command: sosreport --batch -n lxd --tmp-dir "$PLAINBOX_SESSION_SHARE" +command: sos report --batch -n lxd --tmp-dir "$PLAINBOX_SESSION_SHARE" _summary: Generate baseline sosreport _description: Generates a baseline sosreport of logs and system data diff --git a/units/monitor/jobs.pxu b/units/monitor/jobs.pxu index f5e4974..2ba9e99 100644 --- a/units/monitor/jobs.pxu +++ b/units/monitor/jobs.pxu @@ -158,9 +158,10 @@ command: brightness_test.py _purpose: This test will test changes to screen brightness _steps: - 1. Click "Test" to try to dim the screen. - 2. Check if the screen was dimmed approximately to half of the maximum brightness. - 3. The screen will go back to the original brightness in 2 seconds. + 1. Change screen brightness to maximum. + 2. Click "Test" to try to dim the screen. + 3. Check if the screen was dimmed approximately to half of the maximum brightness. + 4. The screen will go back to the original brightness in 2 seconds. _verification: Was your screen dimmed approximately to half of the maximum brightness? diff --git a/units/power-management/jobs.pxu b/units/power-management/jobs.pxu index d2ef21b..726b4ae 100644 --- a/units/power-management/jobs.pxu +++ b/units/power-management/jobs.pxu @@ -331,6 +331,31 @@ plugin: shell command: failed_service_check.sh estimated_duration: 1.0 +id: power-management/idle-screen-on-residency-check +category_id: com.canonical.plainbox::power-management +_summary: Test if CPU records time in desired low power C-state when idle +_description: + When the system has the screen on, but the CPU is idle, it should enter deeper idle state + to reduce power consumption. The expected states are identified as PC8, PC9 and PC10. + For more detail refer to https://01.org/blogs/qwang59/2020/linux-s0ix-troubleshooting +unit: job +plugin: shell +requires: + cpuinfo.type == 'GenuineIntel' + package.name == 'msr-tools' + sleep.mem_sleep == 's2idle' +command: + short-idle-check.sh -s 20 + RET=$? + if [ $RET -ne 0 ]; then + echo "The CPU package target idle state residency is 0." + echo "It will consume more power when the system has the screen on, but the CPU is idle." + echo "More detail is in https://01.org/blogs/qwang59/2020/linux-s0ix-troubleshooting." + exit 1 + fi +user: root +estimated_duration: 22 + id: power-management/cpu-low-power-idle category_id: com.canonical.plainbox::power-management _summary: CPU low power idle residency check diff --git a/units/power-management/test-plan.pxu b/units/power-management/test-plan.pxu index 8391bca..0cc9997 100644 --- a/units/power-management/test-plan.pxu +++ b/units/power-management/test-plan.pxu @@ -86,3 +86,12 @@ _description: Manual power tests for Snappy Ubuntu Core devices include: power-management/poweroff-manual power-management/reboot-manual + +id: power-management-cpu-cstate-cert-automated +unit: test plan +_name: CPU package cstate tests +_description: CPU package cstate tests for Ubuntu PC devices +include: + power-management/idle-screen-on-residency-check + power-management/cpu-low-power-idle + power-management/system-low-power-idle diff --git a/units/serial/packaging.pxu b/units/serial/packaging.pxu new file mode 100644 index 0000000..da25e8e --- /dev/null +++ b/units/serial/packaging.pxu @@ -0,0 +1,3 @@ +unit: packaging meta-data +os-id: debian +Depends: python3-serial diff --git a/units/serial/test-plan.pxu b/units/serial/test-plan.pxu index 2369427..faf4e27 100644 --- a/units/serial/test-plan.pxu +++ b/units/serial/test-plan.pxu @@ -20,6 +20,8 @@ _name: Automated serial tests _description: Automated serial tests for Snappy Ubuntu Core devices include: serial/loopback-.* +bootstrap_include: + serial_ports_static id: after-suspend-serial-full unit: test plan diff --git a/units/snapd/snapd.pxu b/units/snapd/snapd.pxu index 65cf5a8..6a3b04d 100644 --- a/units/snapd/snapd.pxu +++ b/units/snapd/snapd.pxu @@ -273,3 +273,14 @@ command: category_id: snapd estimated_duration: 1.0 flags: preserve-locale + +id: snappy/test-snap-confinement-mode +_summary: Test if the snap confinement mode is strict +_purpose: + Test if the snap confinement mode is `strict` + If not, list the missing features +plugin: shell +command: snap_confinement_test.py +user: root +category_id: snapd +estimated_duration: 1s \ No newline at end of file diff --git a/units/snapd/test-plan.pxu b/units/snapd/test-plan.pxu index 041bdb3..fb27fc4 100644 --- a/units/snapd/test-plan.pxu +++ b/units/snapd/test-plan.pxu @@ -68,6 +68,7 @@ include: snappy/test-store-install-beta snappy/test-store-install-edge snappy/test-store-config-.* + snappy/test-snap-confinement-mode mandatory_include: snap bootstrap_include: diff --git a/units/touchpad/jobs.pxu b/units/touchpad/jobs.pxu index e0d118b..220b3c9 100644 --- a/units/touchpad/jobs.pxu +++ b/units/touchpad/jobs.pxu @@ -142,11 +142,12 @@ estimated_duration: 120.0 _purpose: Determine that the drag and drop function is working as expected. _steps: - 1. Browse to the examples folder in the current user's home directory - 2. Double tap and hold to select the "Ubuntu_Free_Culture_Showcase" folder - 3. Drag the selected folder to the desktop and remove finger from touchpad. + 1. Press 'PrtScn' key to take a screenshot + 2. Tap 'Files' on dock(launcher bar) to open Home\Pictures folder + 3. Double tap and hold the Screenshot* file + 4. Drag the selected file to the Home folder and remove finger from touchpad. _verification: - Did a selected folder move to the desktop? + Does drag and drop work on Touchpad? _siblings: [{ "id": "touchpad/drag-and-drop-after-suspend", "depends": "suspend/suspend_advanced touchpad/drag-and-drop" }] diff --git a/units/touchscreen/jobs.pxu b/units/touchscreen/jobs.pxu index 3676980..060e0c6 100644 --- a/units/touchscreen/jobs.pxu +++ b/units/touchscreen/jobs.pxu @@ -55,8 +55,11 @@ _description: PURPOSE: Check touchscreen drag & drop STEPS: - 1. Tap and hold an object on the desktop - 2. Drag and drop the object in a different location + 1. Press 'PrtScn' key to create a screenshot + 2. Tap 'Files' on dock(launcher bar) to open Home folder + 3. Double Tap 'Pictures' folder to open Pictures folder + 4. Tap and hold the Screenshot* files on the Pictures folder + 5. Drag and drop the Screenshot* files to Home folder VERIFICATION: Does drag and drop work? flags: also-after-suspend-manual diff --git a/units/virtualization/jobs.pxu b/units/virtualization/jobs.pxu index 2b6fd99..2b903c7 100644 --- a/units/virtualization/jobs.pxu +++ b/units/virtualization/jobs.pxu @@ -5,8 +5,10 @@ user: root environ: UVT_IMAGE_OR_SOURCE http_proxy https_proxy estimated_duration: 300.0 requires: - package.name == 'uvtool' - package.name == 'uvtool-libvirt' + executable.name == 'uvt-kvm' + executable.name == 'uvt-simplestreams-libvirt' + executable.name == 'virsh' + executable.name == 'ssh-keygen' virtualization.kvm == 'supported' command: virtualization.py --debug uvt _description: diff --git a/units/virtualization/test-plan.pxu b/units/virtualization/test-plan.pxu new file mode 100644 index 0000000..16f4c73 --- /dev/null +++ b/units/virtualization/test-plan.pxu @@ -0,0 +1,19 @@ +id: virtualization-full +unit: test plan +_name: Virtualization tests +include: +nested_part: + virtualization-manual + virtualization-automated + +id: virtualization-manual +unit: test plan +_name: Manual virtualization tests +include: + +id: virtualization-automated +unit: test plan +_name: Automated virtualization tests +include: + virtualization/kvm_check_vm + virtualization/verify_lxd \ No newline at end of file diff --git a/units/wireless/nm-hotspot.pxu b/units/wireless/nm-hotspot.pxu index ca62c7a..609c3c0 100644 --- a/units/wireless/nm-hotspot.pxu +++ b/units/wireless/nm-hotspot.pxu @@ -10,10 +10,12 @@ command: net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py ap {{ interface }} bg plugin: shell -category_id: com.canonical.plainbox::wireless +category_id: wifi_ap estimated_duration: 10 flags: preserve-locale also-after-suspend requires: + wifi_interface_mode.{{ interface }}_AP == 'supported' + net_if_management.device == '{{ interface }}' and net_if_management.master_mode_managed_by == 'NetworkManager' {%- if __on_ubuntucore__ %} connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager' {%- else %} @@ -31,10 +33,12 @@ command: net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py ap {{ interface }} a plugin: shell -category_id: com.canonical.plainbox::wireless +category_id: wifi_ap estimated_duration: 10 flags: preserve-locale also-after-suspend requires: + wifi_interface_mode.{{ interface }}_AP == 'supported' + net_if_management.device == '{{ interface }}' and net_if_management.master_mode_managed_by == 'NetworkManager' {%- if __on_ubuntucore__ %} connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager' {%- else %} diff --git a/units/wireless/test-plan.pxu b/units/wireless/test-plan.pxu index 6b2b8c1..b7448cb 100644 --- a/units/wireless/test-plan.pxu +++ b/units/wireless/test-plan.pxu @@ -229,6 +229,7 @@ _name: Automated tests for wifi master mode _description: Automated tests for using System as Access Point include: + # wifi-ap set (see net-if-management resource) wireless/wifi_ap_open_b_no_sta_.*_auto wireless/wifi_ap_open_g_no_sta_.*_auto wireless/wifi_ap_wpa_b_no_sta_.*_auto @@ -236,6 +237,8 @@ include: wireless/wifi_ap_wpa_b_with_sta_.*_auto wireless/wifi_ap_wpa_g_with_sta_.*_auto wireless/wifi_ap_setup_wizard_.*_auto + # NetworkManager set (see net-if-management resource) + wireless/nmcli_wifi_ap_.* bootstrap_include: device wifi_interface_mode @@ -273,6 +276,7 @@ _name: QA tests for wifi master mode (after suspend) _description: System as Access Point tests include: + # wifi-ap set (see net-if-management resource) after-suspend-wireless/wifi_ap_open_b_no_sta_.*_auto after-suspend-wireless/wifi_ap_open_g_no_sta_.*_auto after-suspend-wireless/wifi_ap_wpa_b_no_sta_.*_auto @@ -280,6 +284,8 @@ include: after-suspend-wireless/wifi_ap_wpa_b_with_sta_.*_auto after-suspend-wireless/wifi_ap_wpa_g_with_sta_.*_auto after-suspend-wireless/wifi_ap_setup_wizard_.*_auto + # NetworkManager set (see net-if-management resource) + after-suspend-wireless/nmcli_wifi_ap_.* bootstrap_include: device wifi_interface_mode diff --git a/units/wireless/wifi-ap.pxu b/units/wireless/wifi-ap.pxu index 622d70f..ad5dfae 100644 --- a/units/wireless/wifi-ap.pxu +++ b/units/wireless/wifi-ap.pxu @@ -8,7 +8,7 @@ _summary: Create open 802.11a Wi-Fi AP on {interface} with no STA (Manual) plugin: manual requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 _purpose: Check that the system can create an open 802.11a Access Point without any STA connection @@ -64,7 +64,7 @@ command: fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale also-after-suspend @@ -79,7 +79,7 @@ _summary: Create open 802.11b Wi-Fi AP on {interface} with no STA (Manual) plugin: manual requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 _purpose: Check that the system can create an open 802.11b Access Point without any STA connection @@ -135,7 +135,7 @@ command: fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale also-after-suspend @@ -150,7 +150,7 @@ _summary: Create open 802.11g Wi-Fi AP on {interface} with no STA (Manual) plugin: manual requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 _purpose: Check that the system can create an open 802.11g Access Point without any STA connection @@ -206,7 +206,7 @@ command: fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale also-after-suspend @@ -221,7 +221,7 @@ _summary: Create open 802.11ad Wi-Fi AP on {interface} with no STA (Manual) plugin: manual requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 _purpose: Check that the system can create an open 802.11ad Access Point without any STA connection @@ -277,7 +277,7 @@ command: fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale also-after-suspend @@ -292,7 +292,7 @@ _summary: Create WPA2 802.11a Wi-Fi AP on {interface} with no STA (Manual) plugin: manual requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 _purpose: Check that the system can create a WPA2 802.11a Access Point without any STA connection @@ -350,7 +350,7 @@ command: fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale also-after-suspend @@ -365,7 +365,7 @@ _summary: Create WPA2 802.11b Wi-Fi AP on {interface} with no STA (Manual) plugin: manual requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{{ interface }}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 _purpose: Check that the system can create a WPA2 802.11b Access Point without any STA connection @@ -423,7 +423,7 @@ command: fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale also-after-suspend @@ -438,7 +438,7 @@ _summary: Create WPA2 802.11g Wi-Fi AP on {interface} with no STA (Manual) plugin: manual requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 _purpose: Check that the system can create a WPA2 802.11g Access Point without any STA connection @@ -496,7 +496,7 @@ command: fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale also-after-suspend @@ -511,7 +511,7 @@ _summary: Create WPA2 802.11ad Wi-Fi AP on {interface} with no STA (Manual) plugin: manual requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 _purpose: Check that the system can create a WPA2 802.11ad Access Point without any STA connection @@ -569,7 +569,7 @@ command: fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale also-after-suspend @@ -584,7 +584,7 @@ _summary: Create WPA2 802.11a Wi-Fi AP on {interface} with active STA (Manual) plugin: user-interact-verify requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID command: @@ -622,7 +622,7 @@ _summary: Create WPA2 802.11a Wi-Fi Access Point on {interface} with active STA plugin: shell requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID WIFI_AP_SETUPTIME command: @@ -670,7 +670,7 @@ _summary: Create WPA2 802.11b Wi-Fi AP on {interface} with active STA (Manual) plugin: user-interact-verify requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID command: @@ -708,7 +708,7 @@ _summary: Create WPA2 802.11b Wi-Fi Access Point on {interface} with active STA plugin: shell requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID WIFI_AP_SETUPTIME command: @@ -756,7 +756,7 @@ _summary: Create WPA2 802.11g Wi-Fi AP on {interface} with active STA (Manual) plugin: user-interact-verify requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID command: @@ -794,7 +794,7 @@ _summary: Create WPA2 802.11g Wi-Fi Access Point on {interface} with active STA plugin: shell requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID WIFI_AP_SETUPTIME command: @@ -842,7 +842,7 @@ _summary: Create WPA2 802.11ad Wi-Fi AP on {interface} with active STA (Manual) plugin: user-interact-verify requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID command: @@ -880,7 +880,7 @@ _summary: Create WPA2 802.11ad Wi-Fi Access Point on {interface} with active STA plugin: shell requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID WIFI_AP_SETUPTIME command: @@ -928,7 +928,7 @@ _summary: Create Access Point on {interface} using wifi-ap.setup-wizard plugin: shell requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 20.0 user: root command: @@ -976,7 +976,7 @@ command: reboot requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale noreturn autorestart @@ -1010,7 +1010,7 @@ command: reboot requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME flags: preserve-locale noreturn @@ -1041,7 +1041,7 @@ command: fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' depends: wireless/wifi_ap_across_reboot_{interface}_setup estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME @@ -1066,7 +1066,7 @@ command: if [ "$RES" -eq 2 ]; then exit 0; else exit 1; fi requires: wifi_interface_mode.{interface}_AP == 'supported' - snap.name == 'wifi-ap' + net_if_management.device == '{interface}' and net_if_management.master_mode_managed_by == 'wifi-ap' depends: wireless/wifi_ap_across_reboot_{interface}_setup_manual estimated_duration: 120.0 environ: WIFI_AP_SETUPTIME |