Merge ~jocave/plainbox-provider-checkbox:move-wireless-jobs-to-newer-templated-version into plainbox-provider-checkbox:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 754f075c2179c3e9100d3659c732e58695135550
Merged at revision: 95380fb6ce65d5966415e985688fffc285a5c0bb
Proposed branch: ~jocave/plainbox-provider-checkbox:move-wireless-jobs-to-newer-templated-version
Merge into: plainbox-provider-checkbox:master
Diff against target: 1208 lines (+347/-725)
5 files modified
bin/net_driver_info (+41/-0)
bin/wifi_nmcli_test (+154/-0)
units/suspend/suspend.pxu (+4/-421)
units/wireless/jobs.pxu (+122/-278)
units/wireless/test-plan.pxu (+26/-26)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+332116@code.launchpad.net

Description of the change

Big import of newer templated wireless jobs and removal of old suspend jobs that should now be covered by the after suspend flag.

Landing this will require quick follow ups in:
 - plainbox-provider-snappy: remove the wireless jobs so we just have the one copy
 - plainbox-provider-sru: update the sru test plan to use the templated jobs
 - plainbox-provider-certification-client: identify if any of the pre-16.04 test plans need to be updated, the 16.04 test plan should be fine as is all nested test plans now

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

1. Previous job definitions were running commands as root, are we able to run the python wrapper as the normal user now?
2. Lots of new jobs are using the environ filed which is not needed when running command as a non root user (See http://plainbox.readthedocs.io/en/latest/manpages/plainbox-job-units.html). You can delete those lines.
3. What happens if $NET_DRIVER_INFO is not set? should we condition the call to bin/net_driver_info only if the variable exists?
4. Can all _manual connection tests benefit from the python tool? to get rid again of the inline bash commands?

review: Needs Information
Revision history for this message
Jonathan Cave (jocave) wrote :

1. Previous job definitions were running commands as root, are we able to run the python wrapper as the normal user now?

The python wrapper is inherited from p-p-s where is was run non-root for quite a while. I believe it should be find running as non-root. I tried running this on my desktop as my normal user and it worked fine (apart from a bug in zesty's nmcli itself).

2. Lots of new jobs are using the environ filed which is not needed when running command as a non root user (See http://plainbox.readthedocs.io/en/latest/manpages/plainbox-job-units.html). You can delete those lines.

Thanks, updated branch to remove those. (squashed into first commit)

3. What happens if $NET_DRIVER_INFO is not set? should we condition the call to bin/net_driver_info only if the variable exists?

The environment variable is used to request the script print the information it can find about drivers that are of special interest to the user. If the variable is missing the script should still work and only print information for drivers that sysfs indicates are of class network.

4. Can all _manual connection tests benefit from the python tool? to get rid again of the inline bash commands?

I decide to not touch these jobs as I didn't know anything about what their target audience is. They are quite different to any of the other tests as the manual part of the test seems to refer to configuration Access Points.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Thanks for the update.

For Zesty (as it will hit sru testing), I'd add a special case handler and/or execute the split in a try/except block.

review: Needs Fixing
Revision history for this message
Taihsiang Ho (tai271828) wrote :

For desktop we are testing trusty, xenial, zesty and artful(soon), so if these four releases are compatible with this script and could use this script to perform the tests. That would be great.

Revision history for this message
Jonathan Cave (jocave) wrote :

Updated with zesty bug handling

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Thanks for bringing this improved version to p-p-c, LGTM.

review: Approve
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

One thing I didin't notice is that using the also-after-suspend flag adds a dependency on suspend/suspend_advanced_auto which is not desirable on client cert test plan where we run just suspend/suspend_avdanced (manual). I'd then create a second version of the after suspend nested part for manual QA test plans to avoid bringing an unexpected dep. Don't forget to also add the also-after-suspend-manual flag to job definitions.

We can still land this MR, I'll propose the fix to add support for manual nested part.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/net_driver_info b/bin/net_driver_info
0new file mode 1007550new file mode 100755
index 0000000..ee5db46
--- /dev/null
+++ b/bin/net_driver_info
@@ -0,0 +1,41 @@
1#!/usr/bin/env python3
2# Copyright 2017 Canonical Ltd.
3# All rights reserved.
4#
5# Written by:
6# Jonathan Cave <jonathan.cave@canonical.com>
7#
8# Print info about drivers we can identify automatically and also those we
9# identify in the special interest list!
10
11from pathlib import Path
12import sys
13
14# Store pairs of (interface, driver)
15driver_list = []
16
17# Find drivers in sysfs
18for interface in Path("/sys/class/net").iterdir():
19 mod_path = Path("{}/device/driver/module".format(interface))
20 if mod_path.is_symlink():
21 driver_list.append((interface.name, mod_path.resolve().name))
22
23# Add user requested modules to the list. Create "unknown" interfaces if none
24# of the identified interfaces above are using it
25for user_driver in sys.argv[1:]:
26 if Path("/sys/module/{}".format(user_driver)).exists():
27 if not any(x[1] == user_driver for x in driver_list):
28 driver_list.append(("unknown", user_driver))
29 else:
30 print("Requested driver {} not loaded\n".format(user_driver))
31
32# Produce the output
33for interface, driver in driver_list:
34 print("Interface {} using module {}".format(interface, driver))
35 sysfs_path = Path("/sys/module/{}/parameters".format(driver))
36 if sysfs_path.is_dir():
37 print(" Parameters:")
38 for path in Path(sysfs_path).iterdir():
39 if path.is_file():
40 print(" {}: {}".format(path.name, path.read_text().strip()))
41 print()
diff --git a/bin/wifi_nmcli_test b/bin/wifi_nmcli_test
0new file mode 10075542new file mode 100755
index 0000000..24359c2
--- /dev/null
+++ b/bin/wifi_nmcli_test
@@ -0,0 +1,154 @@
1#!/usr/bin/env python3
2# Copyright 2017 Canonical Ltd.
3# All rights reserved.
4#
5# Written by:
6# Jonathan Cave <jonathan.cave@canonical.com>
7#
8# wireless connection tests using nmcli
9
10
11import argparse
12import functools
13import subprocess as sp
14import sys
15
16
17print = functools.partial(print, flush=True)
18
19
20def print_head(txt):
21 print("##", txt)
22
23
24def print_cmd(cmd):
25 print("+", cmd)
26
27
28def cleanup_nm_connections():
29 print_head("Cleaning up NM connections")
30 cmd = "nmcli -t -f TYPE,UUID,NAME c"
31 print_cmd(cmd)
32 output = sp.check_output(cmd, shell=True)
33 for line in output.decode(sys.stdout.encoding).splitlines():
34 type, uuid, name = line.strip().split(':')
35 if type == '802-11-wireless':
36 print("Deleting connection", name)
37 cmd = "nmcli c delete {}".format(uuid)
38 print_cmd(cmd)
39 sp.call(cmd, shell=True)
40 print()
41
42
43def device_rescan():
44 print_head("Calling a rescan")
45 cmd = "nmcli d wifi rescan"
46 print_cmd(cmd)
47 sp.call(cmd, shell=True)
48 print()
49
50
51def list_aps(args):
52 print_head("List APs")
53 count = 0
54 cmd = "nmcli -t -f SSID,CHAN,FREQ,SIGNAL d wifi list ifname {}".format(
55 args.device)
56 print_cmd(cmd)
57 output = sp.check_output(cmd, shell=True)
58 for line in output.decode(sys.stdout.encoding).splitlines():
59 # lp bug #1723372 - extra line in output on zesty
60 if line.strip() == args.device:
61 continue
62 ssid, channel, frequency, signal = line.strip().split(':')
63 print("SSID: {} Chan: {} Freq: {} Signal: {}".format(
64 ssid, channel, frequency, signal))
65 if hasattr(args, 'essid'):
66 if ssid == args.essid:
67 count += 1
68 else:
69 count += 1
70 print()
71 return count
72
73
74def open_connection(args):
75 print_head("Connection attempt")
76 cmd = "nmcli d wifi connect {} ifname {} name TEST_CON".format(
77 args.essid, args.device)
78 print_cmd(cmd)
79 sp.call(cmd, shell=True)
80 cmd = "nmcli -m tabular -t -f GENERAL.STATE d show {}".format(args.device)
81 print_cmd(cmd)
82 output = sp.check_output(cmd, shell=True)
83 state = output.decode(sys.stdout.encoding).strip()
84 print(state)
85 rc = 1
86 if state.startswith('100'):
87 rc = 0
88 print()
89 return rc
90
91
92def secured_connection(args):
93 print_head("Connection attempt")
94 cmd = "nmcli d wifi connect {} password {} ifname {} name TEST_CON".format(
95 args.essid, args.psk, args.device)
96 print_cmd(cmd)
97 sp.call(cmd, shell=True)
98 cmd = "nmcli -m tabular -t -f GENERAL.STATE d show {}".format(args.device)
99 print_cmd(cmd)
100 output = sp.check_output(cmd, shell=True)
101 state = output.decode(sys.stdout.encoding).strip()
102 print(state)
103 rc = 1
104 if state.startswith('100'):
105 rc = 0
106 print()
107 return rc
108
109
110if __name__ == '__main__':
111 parser = argparse.ArgumentParser(
112 description='WiFi connection test using mmcli')
113
114 subparsers = parser.add_subparsers(dest='test_type')
115 subparsers.required = True
116
117 parser_scan = subparsers.add_parser(
118 'scan', help='Test can scan for networks only')
119 parser_scan.add_argument(
120 'device', type=str, help='Device name e.g. wlan0')
121
122 parser_open = subparsers.add_parser(
123 'open', help='Test connection to an open access point')
124 parser_open.add_argument(
125 'device', type=str, help='Device name e.g. wlan0')
126 parser_open.add_argument('essid', type=str, help='ESSID')
127 parser_open.set_defaults(func=open_connection)
128
129 parser_secured = subparsers.add_parser(
130 'secured', help='Test connection to a secured access point')
131 parser_secured.add_argument(
132 'device', type=str, help='Device name e.g. wlan0')
133 parser_secured.add_argument('essid', type=str, help='ESSID')
134 parser_secured.add_argument('psk', type=str, help='Pre-Shared Key')
135 parser_secured.set_defaults(func=secured_connection)
136 args = parser.parse_args()
137
138 cleanup_nm_connections()
139 device_rescan()
140 count = list_aps(args)
141
142 if args.test_type == 'scan':
143 if count == 0:
144 print("Failed to find any APs")
145 sys.exit(1)
146 else:
147 print("Found {} access points".format(count))
148 sys.exit(0)
149
150 if args.func:
151 try:
152 sys.exit(args.func(args))
153 finally:
154 cleanup_nm_connections()
diff --git a/units/suspend/suspend.pxu b/units/suspend/suspend.pxu
index 287071a..2949ba0 100644
--- a/units/suspend/suspend.pxu
+++ b/units/suspend/suspend.pxu
@@ -49,17 +49,6 @@ _description:
49 Dumps memory info to a file for comparison after suspend test has been run49 Dumps memory info to a file for comparison after suspend test has been run
50command: meminfo_resource > $PLAINBOX_SESSION_SHARE/meminfo_before_suspend50command: meminfo_resource > $PLAINBOX_SESSION_SHARE/meminfo_before_suspend
5151
52plugin: shell
53category_id: com.canonical.plainbox::suspend
54id: suspend/wireless_before_suspend
55depends: wireless/wireless_connection
56requires: device.category == 'WIRELESS'
57command: nmcli -t -f UUID con status > $PLAINBOX_SESSION_SHARE/connections && connect_wireless && gateway_ping_test --interface=`(nmcli dev list 2>/dev/null || nmcli dev show) | grep -B 1 -e 'wireless' -e 'wifi' | grep GENERAL.DEVICE | awk '{print $2}'` && for con in `cat $PLAINBOX_SESSION_SHARE/connections`; do nmcli con up uuid "$con"; done
58estimated_duration: 20.0
59_description:
60 This test disconnects all connections and then connects to the wireless
61 interface. It then checks the connection to confirm it's working as expected.
62
63unit: template52unit: template
64template-resource: device53template-resource: device
65template-filter: device.category == 'NETWORK'54template-filter: device.category == 'NETWORK'
@@ -76,22 +65,6 @@ command: network -i {interface} -t iperf
76_description:65_description:
77 This test executes iperf connection performance/stability against device {__index__} ({interface}) before suspend.66 This test executes iperf connection performance/stability against device {__index__} ({interface}) before suspend.
7867
79unit: template
80template-resource: device
81template-filter: device.category == 'WIRELESS'
82plugin: shell
83category_id: com.canonical.plainbox::suspend
84id: suspend/iperf_before_suspend_wifi_auto_device{__index__}_{interface}
85depends: wireless/wireless_connection
86estimated_duration: 20.0
87requires:
88 package.name == 'iperf'
89user: root
90environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS
91command: network -i {interface} -t iperf
92_description:
93 This test executes iperf connection performance/stability against device {__index__} ({interface}) before suspend.
94
95plugin: shell68plugin: shell
96category_id: com.canonical.plainbox::suspend69category_id: com.canonical.plainbox::suspend
97id: suspend/iperf_before_suspend_mobilebroadband_gsm_auto70id: suspend/iperf_before_suspend_mobilebroadband_gsm_auto
@@ -99,7 +72,7 @@ depends: mobilebroadband/gsm_connection
99estimated_duration: 20.072estimated_duration: 20.0
100user: root73user: root
101environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS74environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS
102command: 75command:
103 INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep gsm |cut -d ":" -f 13`76 INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep gsm |cut -d ":" -f 13`
104 [ -z $INTERFACE ] && exit 177 [ -z $INTERFACE ] && exit 1
105 network test -i $INTERFACE -t iperf78 network test -i $INTERFACE -t iperf
@@ -113,7 +86,7 @@ depends: mobilebroadband/cdma_connection
113estimated_duration: 20.086estimated_duration: 20.0
114user: root87user: root
115environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS88environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS
116command: 89command:
117 INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep cdma |cut -d ":" -f 13`90 INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep cdma |cut -d ":" -f 13`
118 [ -z $INTERFACE ] && exit 191 [ -z $INTERFACE ] && exit 1
119 network test -i $INTERFACE -t iperf92 network test -i $INTERFACE -t iperf
@@ -630,395 +603,6 @@ _description:
630 VERIFICATION:603 VERIFICATION:
631 Does the display work normally after resuming from suspend using the {vendor} {product} graphics card?604 Does the display work normally after resuming from suspend using the {vendor} {product} graphics card?
632605
633plugin: shell
634category_id: com.canonical.plainbox::suspend
635id: suspend/wireless_after_suspend
636depends: suspend/suspend_advanced suspend/wireless_before_suspend
637requires:
638 device.category == 'WIRELESS'
639command: connect_wireless && gateway_ping_test --interface=`(nmcli dev list 2>/dev/null || nmcli dev show) | grep -B 1 -e wireless -e wifi | grep GENERAL.DEVICE | awk '{print $2}'` && for con in `cat $PLAINBOX_SESSION_SHARE/connections`; do nmcli con up uuid "$con"; done
640estimated_duration: 20.0
641_description:
642 This test checks that the wireless interface is working after suspending the system. It
643 disconnects all interfaces and then connects to the wireless interface and checks that the
644 connection is working as expected.
645
646plugin: shell
647category_id: com.canonical.plainbox::suspend
648id: suspend/wireless_connection_after_suspend_wpa_bg
649depends: suspend/suspend_advanced
650estimated_duration: 20.0
651requires:
652 device.category == 'WIRELESS'
653 environment.ROUTERS == 'multiple'
654user: root
655environ: WPA_BG_SSID WPA_BG_PSK
656command:
657 trap "nmcli con delete id $WPA_BG_SSID" EXIT
658 if create_connection wifi $WPA_BG_SSID --security=wpa --key=$WPA_BG_PSK; then
659 connect_wireless # lp:1471663
660 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
661 iw dev $INTERFACE link
662 gateway_ping_test --interface=$INTERFACE
663 STATUS=$?
664 # We reconnect the Ethernet connection if any (lp:1471663)
665 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
666 if [[ ! -z $WIRED ]]; then
667 nmcli c up uuid $WIRED
668 fi
669 exit $STATUS
670 else
671 exit 1
672 fi
673_description:
674 Tests that the systems wireless hardware can connect to a router using WPA
675 security and the 802.11b/g protocols after the system has been suspended.
676
677plugin: shell
678category_id: com.canonical.plainbox::suspend
679id: suspend/wireless_connection_after_suspend_open_bg
680depends: suspend/suspend_advanced
681estimated_duration: 1.2
682requires:
683 device.category == 'WIRELESS'
684 environment.ROUTERS == 'multiple'
685user: root
686environ: OPEN_BG_SSID
687command:
688 trap "nmcli con delete id $OPEN_BG_SSID" EXIT
689 if create_connection wifi $OPEN_BG_SSID; then
690 connect_wireless # lp:1471663
691 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
692 iw dev $INTERFACE link
693 gateway_ping_test --interface=$INTERFACE
694 STATUS=$?
695 # We reconnect the Ethernet connection if any (lp:1471663)
696 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
697 if [[ ! -z $WIRED ]]; then
698 nmcli c up uuid $WIRED
699 fi
700 exit $STATUS
701 else
702 exit 1
703 fi
704_description:
705 Tests that the systems wireless hardware can connect to a router using no
706 security and the 802.11b/g protocols after the system has been suspended.
707
708plugin: shell
709category_id: com.canonical.plainbox::suspend
710id: suspend/wireless_connection_after_suspend_wpa_n
711depends: suspend/suspend_advanced
712estimated_duration: 1.2
713requires:
714 device.category == 'WIRELESS'
715 environment.ROUTERS == 'multiple'
716user: root
717environ: WPA_N_SSID WPA_N_PSK
718command:
719 trap "nmcli con delete id $WPA_N_SSID" EXIT
720 if create_connection wifi $WPA_N_SSID --security=wpa --key=$WPA_N_PSK; then
721 connect_wireless # lp:1471663
722 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
723 iw dev $INTERFACE link
724 gateway_ping_test --interface=$INTERFACE
725 STATUS=$?
726 # We reconnect the Ethernet connection if any (lp:1471663)
727 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
728 if [[ ! -z $WIRED ]]; then
729 nmcli c up uuid $WIRED
730 fi
731 exit $STATUS
732 else
733 exit 1
734 fi
735_description:
736 Tests that the systems wireless hardware can connect to a router using WPA
737 security and the 802.11n protocol after the system has been suspended.
738
739plugin: shell
740category_id: com.canonical.plainbox::suspend
741id: suspend/wireless_connection_after_suspend_open_n
742depends: suspend/suspend_advanced
743estimated_duration: 1.2
744requires:
745 device.category == 'WIRELESS'
746 environment.ROUTERS == 'multiple'
747user: root
748environ: OPEN_N_SSID
749command:
750 trap "nmcli con delete id $OPEN_N_SSID" EXIT
751 if create_connection wifi $OPEN_N_SSID; then
752 connect_wireless # lp:1471663
753 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
754 iw dev $INTERFACE link
755 gateway_ping_test --interface=$INTERFACE
756 STATUS=$?
757 # We reconnect the Ethernet connection if any (lp:1471663)
758 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
759 if [[ ! -z $WIRED ]]; then
760 nmcli c up uuid $WIRED
761 fi
762 exit $STATUS
763 else
764 exit 1
765 fi
766_description:
767 Tests that the systems wireless hardware can connect to a router using no
768 security and the 802.11n protocol after the system has been suspended.
769
770plugin: shell
771category_id: com.canonical.plainbox::suspend
772id: suspend/wireless_connection_after_suspend_wpa_ac
773depends: suspend/suspend_advanced
774estimated_duration: 1.2
775requires:
776 device.category == 'WIRELESS'
777 environment.ROUTERS == 'multiple'
778 IEEE_80211.ac == 'supported'
779user: root
780environ: WPA_AC_SSID WPA_AC_PSK
781command:
782 trap "nmcli con delete id $WPA_AC_SSID" EXIT
783 if create_connection wifi $WPA_AC_SSID --security=wpa --key=$WPA_AC_PSK; then
784 connect_wireless # lp:1471663
785 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
786 iw dev $INTERFACE link
787 gateway_ping_test --interface=$INTERFACE
788 STATUS=$?
789 # We reconnect the Ethernet connection if any (lp:1471663)
790 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
791 if [[ ! -z $WIRED ]]; then
792 nmcli c up uuid $WIRED
793 fi
794 exit $STATUS
795 else
796 exit 1
797 fi
798_description:
799 Tests that the systems wireless hardware can connect to a router using WPA
800 security and the 802.11ac protocol after the system has been suspended.
801
802plugin: shell
803category_id: com.canonical.plainbox::suspend
804id: suspend/wireless_connection_after_suspend_open_ac
805depends: suspend/suspend_advanced
806estimated_duration: 1.2
807requires:
808 device.category == 'WIRELESS'
809 environment.ROUTERS == 'multiple'
810 IEEE_80211.ac == 'supported'
811user: root
812environ: OPEN_AC_SSID
813command:
814 trap "nmcli con delete id $OPEN_AC_SSID" EXIT
815 if create_connection wifi $OPEN_AC_SSID; then
816 connect_wireless # lp:1471663
817 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
818 iw dev $INTERFACE link
819 gateway_ping_test --interface=$INTERFACE
820 STATUS=$?
821 # We reconnect the Ethernet connection if any (lp:1471663)
822 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
823 if [[ ! -z $WIRED ]]; then
824 nmcli c up uuid $WIRED
825 fi
826 exit $STATUS
827 else
828 exit 1
829 fi
830_description:
831 Tests that the systems wireless hardware can connect to a router using no
832 security and the 802.11ac protocol after the system has been suspended.
833
834plugin: shell
835category_id: com.canonical.plainbox::suspend
836id: suspend/wireless_connection_after_suspend_wpa_bg_auto
837depends: suspend/suspend_advanced_auto
838estimated_duration: 1.2
839requires:
840 device.category == 'WIRELESS'
841 environment.ROUTERS == 'multiple'
842user: root
843environ: WPA_BG_SSID WPA_BG_PSK
844command:
845 trap "nmcli con delete id $WPA_BG_SSID" EXIT
846 if create_connection wifi $WPA_BG_SSID --security=wpa --key=$WPA_BG_PSK; then
847 connect_wireless # lp:1471663
848 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
849 iw dev $INTERFACE link
850 gateway_ping_test --interface=$INTERFACE
851 STATUS=$?
852 # We reconnect the Ethernet connection if any (lp:1471663)
853 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
854 if [[ ! -z $WIRED ]]; then
855 nmcli c up uuid $WIRED
856 fi
857 exit $STATUS
858 else
859 exit 1
860 fi
861_description:
862 Tests that the systems wireless hardware can connect to a router using WPA
863 security and the 802.11b/g protocols after the system has been suspended.
864
865plugin: shell
866category_id: com.canonical.plainbox::suspend
867id: suspend/wireless_connection_after_suspend_open_bg_auto
868depends: suspend/suspend_advanced_auto
869estimated_duration: 1.2
870requires:
871 device.category == 'WIRELESS'
872 environment.ROUTERS == 'multiple'
873user: root
874environ: OPEN_BG_SSID
875command:
876 trap "nmcli con delete id $OPEN_BG_SSID" EXIT
877 if create_connection wifi $OPEN_BG_SSID; then
878 connect_wireless # lp:1471663
879 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
880 iw dev $INTERFACE link
881 gateway_ping_test --interface=$INTERFACE
882 STATUS=$?
883 # We reconnect the Ethernet connection if any (lp:1471663)
884 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
885 if [[ ! -z $WIRED ]]; then
886 nmcli c up uuid $WIRED
887 fi
888 exit $STATUS
889 else
890 exit 1
891 fi
892_description:
893 Tests that the systems wireless hardware can connect to a router using no
894 security and the 802.11b/g protocols after the system has been suspended.
895
896plugin: shell
897category_id: com.canonical.plainbox::suspend
898id: suspend/wireless_connection_after_suspend_wpa_n_auto
899depends: suspend/suspend_advanced_auto
900estimated_duration: 1.2
901requires:
902 device.category == 'WIRELESS'
903 environment.ROUTERS == 'multiple'
904user: root
905environ: WPA_N_SSID WPA_N_PSK
906command:
907 trap "nmcli con delete id $WPA_N_SSID" EXIT
908 if create_connection wifi $WPA_N_SSID --security=wpa --key=$WPA_N_PSK; then
909 connect_wireless # lp:1471663
910 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
911 iw dev $INTERFACE link
912 gateway_ping_test --interface=$INTERFACE
913 STATUS=$?
914 # We reconnect the Ethernet connection if any (lp:1471663)
915 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
916 if [[ ! -z $WIRED ]]; then
917 nmcli c up uuid $WIRED
918 fi
919 exit $STATUS
920 else
921 exit 1
922 fi
923_description:
924 Tests that the systems wireless hardware can connect to a router using WPA
925 security and the 802.11n protocol after the system has been suspended.
926
927plugin: shell
928category_id: com.canonical.plainbox::suspend
929id: suspend/wireless_connection_after_suspend_open_n_auto
930depends: suspend/suspend_advanced_auto
931estimated_duration: 1.2
932requires:
933 device.category == 'WIRELESS'
934 environment.ROUTERS == 'multiple'
935user: root
936environ: OPEN_N_SSID
937command:
938 trap "nmcli con delete id $OPEN_N_SSID" EXIT
939 if create_connection wifi $OPEN_N_SSID; then
940 connect_wireless # lp:1471663
941 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
942 iw dev $INTERFACE link
943 gateway_ping_test --interface=$INTERFACE
944 STATUS=$?
945 # We reconnect the Ethernet connection if any (lp:1471663)
946 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
947 if [[ ! -z $WIRED ]]; then
948 nmcli c up uuid $WIRED
949 fi
950 exit $STATUS
951 else
952 exit 1
953 fi
954_description:
955 Tests that the systems wireless hardware can connect to a router using no
956 security and the 802.11n protocol after the system has been suspended.
957
958plugin: shell
959category_id: com.canonical.plainbox::suspend
960id: suspend/wireless_connection_after_suspend_wpa_ac_auto
961depends: suspend/suspend_advanced_auto
962estimated_duration: 1.2
963requires:
964 device.category == 'WIRELESS'
965 environment.ROUTERS == 'multiple'
966 IEEE_80211.ac == 'supported'
967user: root
968environ: WPA_AC_SSID WPA_AC_PSK
969command:
970 trap "nmcli con delete id $WPA_AC_SSID" EXIT
971 if create_connection wifi $WPA_AC_SSID --security=wpa --key=$WPA_AC_PSK; then
972 connect_wireless # lp:1471663
973 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
974 iw dev $INTERFACE link
975 gateway_ping_test --interface=$INTERFACE
976 STATUS=$?
977 # We reconnect the Ethernet connection if any (lp:1471663)
978 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
979 if [[ ! -z $WIRED ]]; then
980 nmcli c up uuid $WIRED
981 fi
982 exit $STATUS
983 else
984 exit 1
985 fi
986_description:
987 Tests that the systems wireless hardware can connect to a router using WPA
988 security and the 802.11ac protocol after the system has been suspended.
989
990plugin: shell
991category_id: com.canonical.plainbox::suspend
992id: suspend/wireless_connection_after_suspend_open_ac_auto
993depends: suspend/suspend_advanced_auto
994estimated_duration: 1.2
995requires:
996 device.category == 'WIRELESS'
997 environment.ROUTERS == 'multiple'
998 IEEE_80211.ac == 'supported'
999user: root
1000environ: OPEN_AC_SSID
1001command:
1002 trap "nmcli con delete id $OPEN_AC_SSID" EXIT
1003 if create_connection wifi $OPEN_AC_SSID; then
1004 connect_wireless # lp:1471663
1005 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
1006 iw dev $INTERFACE link
1007 gateway_ping_test --interface=$INTERFACE
1008 STATUS=$?
1009 # We reconnect the Ethernet connection if any (lp:1471663)
1010 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
1011 if [[ ! -z $WIRED ]]; then
1012 nmcli c up uuid $WIRED
1013 fi
1014 exit $STATUS
1015 else
1016 exit 1
1017 fi
1018_description:
1019 Tests that the systems wireless hardware can connect to a router using no
1020 security and the 802.11ac protocol after the system has been suspended.
1021
1022unit: template606unit: template
1023template-resource: device607template-resource: device
1024template-filter: device.category == 'NETWORK'608template-filter: device.category == 'NETWORK'
@@ -1058,7 +642,7 @@ depends: suspend/suspend_advanced_auto
1058estimated_duration: 20.0642estimated_duration: 20.0
1059user: root643user: root
1060environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS644environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS
1061command: 645command:
1062 INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep gsm |cut -d ":" -f 13`646 INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep gsm |cut -d ":" -f 13`
1063 [ -z $INTERFACE ] && exit 1647 [ -z $INTERFACE ] && exit 1
1064 network test -i $INTERFACE -t iperf648 network test -i $INTERFACE -t iperf
@@ -1072,7 +656,7 @@ depends: suspend/suspend_advanced_auto
1072estimated_duration: 20.0656estimated_duration: 20.0
1073user: root657user: root
1074environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS658environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS
1075command: 659command:
1076 INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep cdma |cut -d ":" -f 13`660 INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep cdma |cut -d ":" -f 13`
1077 [ -z $INTERFACE ] && exit 1661 [ -z $INTERFACE ] && exit 1
1078 network test -i $INTERFACE -t iperf662 network test -i $INTERFACE -t iperf
@@ -2895,4 +2479,3 @@ estimated_duration: 0.5
2895command:2479command:
2896 [ -e ${PLAINBOX_SESSION_SHARE}/fwts_oops_results_after_s3.log ] && xz -c ${PLAINBOX_SESSION_SHARE}/fwts_oops_results_after_s3.log | base642480 [ -e ${PLAINBOX_SESSION_SHARE}/fwts_oops_results_after_s3.log ] && xz -c ${PLAINBOX_SESSION_SHARE}/fwts_oops_results_after_s3.log | base64
2897_description: Attaches the FWTS oops results log to the submission after suspend2481_description: Attaches the FWTS oops results log to the submission after suspend
2898
diff --git a/units/wireless/jobs.pxu b/units/wireless/jobs.pxu
index 89868ef..2834c1d 100644
--- a/units/wireless/jobs.pxu
+++ b/units/wireless/jobs.pxu
@@ -1,234 +1,153 @@
1plugin: shell1unit: template
2category_id: com.canonical.plainbox::wireless2template-resource: device
3id: wireless/wireless_scanning3template-filter: device.category == 'WIRELESS'
4requires:4template-engine: jinja2
5 package.name == 'network-manager'5template-unit: job
6 device.category == 'WIRELESS'6id: wireless/wireless_scanning_{{ interface }}
7_summary: Test system can discover Wi-Fi networks on {{ interface }}
7command:8command:
8 rfkill unblock wlan wifi9 net_driver_info $NET_DRIVER_INFO
9 if rfkill list wlan wifi | grep -q 'Hard blocked: yes'; then10 wifi_nmcli_test scan {{ interface }}
10 echo "Hard block is applied to WiFi device. Please remove and retest."
11 exit 1
12 fi
13 wireless_networks=`(nmcli -f SSID dev wifi list 2>/dev/null || nmcli -f SSID dev wifi)`
14 if [ `echo "$wireless_networks" | wc -l` -gt 1 ]; then
15 echo "Wireless networks discovered: "
16 echo "$wireless_networks"
17 exit 0
18 fi
19 echo "No wireless networks discovered."
20 exit 1
21estimated_duration: 0.645
22_description: Wireless scanning test. It scans and reports on discovered APs.
23
24plugin: shell11plugin: shell
25category_id: com.canonical.plainbox::wireless12category_id: com.canonical.plainbox::wireless
26id: wireless/info_automated13estimated_duration: 6
27requires:
28 package.name == 'network-manager'
29 device.category == 'WIRELESS'
30command: udev_resource -f WIRELESS | awk "/interface: / { print \$2 }" | xargs -n 1 network_info
31estimated_duration: 1.2
32_description:
33 This is an automated test to gather some info on the current state of your wireless devices. If no devices are found, the test will exit with an error.
34
35plugin: user-interact-verify
36category_id: com.canonical.plainbox::wireless
37id: wireless/wireless_connection
38command: network_check
39estimated_duration: 120.0
40requires: device.category == 'WIRELESS'
41_description:14_description:
42 PURPOSE:15 Check system can find a wireless network AP nearby
43 This test will check your wireless connection.16flags: preserve-locale also-after-suspend
44 STEPS:17requires:
45 1. Click on the Network icon in the panel.18 {%- if "SNAP_NAME" in __system_env__ %}
46 2. Select a network below the 'Wireless networks' section.19 connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager'
47 3. Click "Test" to verify that it's possible to establish an HTTP connection.20 {% endif -%}
48 VERIFICATION:
49 Did a notification show and was the connection correctly established?
5021
22unit: template
23template-resource: device
24template-filter: device.category == 'WIRELESS'
25template-engine: jinja2
26template-unit: job
27id: wireless/wireless_connection_wpa_bg_nm_{{ interface }}
28_summary: Connect to WPA-encrypted 802.11b/g Wi-Fi network on {{ interface }}
29_purpose:
30 Check system can connect to 802.11b/g AP with wpa security
51plugin: shell31plugin: shell
52category_id: com.canonical.plainbox::wireless
53id: wireless/wireless_connection_wpa_bg
54requires:
55 device.category == 'WIRELESS'
56 environment.ROUTERS == 'multiple'
57user: root
58environ: WPA_BG_SSID WPA_BG_PSK
59command:32command:
60 trap "nmcli con delete id $WPA_BG_SSID" EXIT33 net_driver_info $NET_DRIVER_INFO
61 if create_connection wifi $WPA_BG_SSID --security=wpa --key=$WPA_BG_PSK; then34 wifi_nmcli_test secured {{ interface }} "$WPA_BG_SSID" "$WPA_BG_PSK"
62 connect_wireless # lp:147166335category_id: com.canonical.plainbox::wireless
63 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
64 iw dev $INTERFACE link
65 gateway_ping_test --interface=$INTERFACE
66 STATUS=$?
67 # We reconnect the Ethernet connection if any (lp:1471663)
68 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
69 if [[ ! -z $WIRED ]]; then
70 nmcli c up uuid $WIRED
71 fi
72 exit $STATUS
73 else
74 exit 1
75 fi
76estimated_duration: 30.036estimated_duration: 30.0
77_description:37flags: preserve-locale also-after-suspend
78 Tests that the systems wireless hardware can connect to a router using WPA38requires:
79 security and the 802.11b/g protocols.39 {%- if "SNAP_NAME" in __system_env__ %}
40 connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager'
41 {% endif -%}
8042
43unit: template
44template-resource: device
45template-filter: device.category == 'WIRELESS'
46template-engine: jinja2
47template-unit: job
48id: wireless/wireless_connection_open_bg_nm_{{ interface }}
49_summary: Connect to unencrypted 802.11b/g Wi-Fi network on {{ interface }}
50_purpose:
51 Check system can connect to insecure 802.11b/g AP
81plugin: shell52plugin: shell
82category_id: com.canonical.plainbox::wireless
83id: wireless/wireless_connection_open_bg
84requires:
85 device.category == 'WIRELESS'
86 environment.ROUTERS == 'multiple'
87user: root
88environ: OPEN_BG_SSID
89command:53command:
90 trap "nmcli con delete id $OPEN_BG_SSID" EXIT54 net_driver_info $NET_DRIVER_INFO
91 if create_connection wifi $OPEN_BG_SSID; then55 wifi_nmcli_test open {{ interface }} "$OPEN_BG_SSID"
92 connect_wireless # lp:147166356category_id: com.canonical.plainbox::wireless
93 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
94 iw dev $INTERFACE link
95 gateway_ping_test --interface=$INTERFACE
96 STATUS=$?
97 # We reconnect the Ethernet connection if any (lp:1471663)
98 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
99 if [[ ! -z $WIRED ]]; then
100 nmcli c up uuid $WIRED
101 fi
102 exit $STATUS
103 else
104 exit 1
105 fi
106estimated_duration: 30.057estimated_duration: 30.0
107_description:58flags: preserve-locale also-after-suspend
108 Tests that the systems wireless hardware can connect to a router using no59requires:
109 security and the 802.11b/g protocols.60 {%- if "SNAP_NAME" in __system_env__ %}
61 connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager'
62 {% endif -%}
11063
64unit: template
65template-resource: device
66template-filter: device.category == 'WIRELESS'
67template-engine: jinja2
68template-unit: job
69id: wireless/wireless_connection_wpa_n_nm_{{ interface }}
70_summary: Connect to WPA-encrypted 802.11n Wi-Fi network on {{ interface }}
71_purpose:
72 Check system can connect to 802.11n AP with wpa security
111plugin: shell73plugin: shell
112category_id: com.canonical.plainbox::wireless
113id: wireless/wireless_connection_wpa_n
114requires:
115 device.category == 'WIRELESS'
116 environment.ROUTERS == 'multiple'
117user: root
118environ: WPA_N_SSID WPA_N_PSK
119command:74command:
120 trap "nmcli con delete id $WPA_N_SSID" EXIT75 net_driver_info $NET_DRIVER_INFO
121 if create_connection wifi $WPA_N_SSID --security=wpa --key=$WPA_N_PSK; then76 wifi_nmcli_test secured {{ interface }} "$WPA_N_SSID" "$WPA_N_PSK"
122 connect_wireless # lp:147166377category_id: com.canonical.plainbox::wireless
123 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
124 iw dev $INTERFACE link
125 gateway_ping_test --interface=$INTERFACE
126 STATUS=$?
127 # We reconnect the Ethernet connection if any (lp:1471663)
128 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
129 if [[ ! -z $WIRED ]]; then
130 nmcli c up uuid $WIRED
131 fi
132 exit $STATUS
133 else
134 exit 1
135 fi
136estimated_duration: 30.078estimated_duration: 30.0
137_description:79flags: preserve-locale also-after-suspend
138 Tests that the systems wireless hardware can connect to a router using WPA80requires:
139 security and the 802.11n protocol.81 wireless_sta_protocol.{{ interface }}_n == 'supported'
82 {%- if "SNAP_NAME" in __system_env__ %}
83 connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager'
84 {% endif -%}
14085
86unit: template
87template-resource: device
88template-filter: device.category == 'WIRELESS'
89template-engine: jinja2
90template-unit: job
91id: wireless/wireless_connection_open_n_nm_{{ interface }}
92_summary: Connect to unencrypted 802.11n Wi-Fi network on {{ interface }}
93_purpose:
94 Check system can connect to insecure 802.11n AP
141plugin: shell95plugin: shell
142category_id: com.canonical.plainbox::wireless
143id: wireless/wireless_connection_open_n
144requires:
145 device.category == 'WIRELESS'
146 environment.ROUTERS == 'multiple'
147user: root
148environ: OPEN_N_SSID
149command:96command:
150 trap "nmcli con delete id $OPEN_N_SSID" EXIT97 net_driver_info $NET_DRIVER_INFO
151 if create_connection wifi $OPEN_N_SSID; then98 wifi_nmcli_test open {{ interface }} "$OPEN_N_SSID"
152 connect_wireless # lp:147166399category_id: com.canonical.plainbox::wireless
153 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
154 iw dev $INTERFACE link
155 gateway_ping_test --interface=$INTERFACE
156 STATUS=$?
157 # We reconnect the Ethernet connection if any (lp:1471663)
158 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
159 if [[ ! -z $WIRED ]]; then
160 nmcli c up uuid $WIRED
161 fi
162 exit $STATUS
163 else
164 exit 1
165 fi
166estimated_duration: 30.0100estimated_duration: 30.0
167_description:101flags: preserve-locale also-after-suspend
168 Tests that the systems wireless hardware can connect to a router using no102requires:
169 security and the 802.11n protocol.103 wireless_sta_protocol.{{ interface }}_n == 'supported'
104 {%- if "SNAP_NAME" in __system_env__ %}
105 connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager'
106 {% endif -%}
170107
108unit: template
109template-resource: device
110template-filter: device.category == 'WIRELESS'
111template-engine: jinja2
112template-unit: job
113id: wireless/wireless_connection_wpa_ac_nm_{{ interface }}
114_summary: Connect to WPA-encrypted 802.11ac Wi-Fi network on {{ interface }}
115_purpose:
116 Check system can connect to 802.11ac AP with wpa security
171plugin: shell117plugin: shell
172category_id: com.canonical.plainbox::wireless
173id: wireless/wireless_connection_wpa_ac
174requires:
175 device.category == 'WIRELESS'
176 environment.ROUTERS == 'multiple'
177 IEEE_80211.ac == 'supported'
178user: root
179environ: WPA_AC_SSID WPA_AC_PSK
180command:118command:
181 trap "nmcli con delete id $WPA_AC_SSID" EXIT119 net_driver_info $NET_DRIVER_INFO
182 if create_connection wifi $WPA_AC_SSID --security=wpa --key=$WPA_AC_PSK; then120 wifi_nmcli_test secured {{ interface }} "$WPA_AC_SSID" "$WPA_AC_PSK"
183 connect_wireless # lp:1471663121category_id: com.canonical.plainbox::wireless
184 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
185 iw dev $INTERFACE link
186 gateway_ping_test --interface=$INTERFACE
187 STATUS=$?
188 # We reconnect the Ethernet connection if any (lp:1471663)
189 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
190 if [[ ! -z $WIRED ]]; then
191 nmcli c up uuid $WIRED
192 fi
193 exit $STATUS
194 else
195 exit 1
196 fi
197estimated_duration: 30.0122estimated_duration: 30.0
198_description:123flags: preserve-locale also-after-suspend
199 Tests that the systems wireless hardware can connect to a router using WPA124requires:
200 security and the 802.11ac protocol.125 wireless_sta_protocol.{{ interface }}_ac == 'supported'
126 {%- if "SNAP_NAME" in __system_env__ %}
127 connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager'
128 {% endif -%}
201129
130unit: template
131template-resource: device
132template-filter: device.category == 'WIRELESS'
133template-engine: jinja2
134template-unit: job
135id: wireless/wireless_connection_open_ac_nm_{{ interface }}
136_summary: Connect to unencrypted 802.11ac Wi-Fi network on {{ interface }}
137_purpose:
138 Check system can connect to insecure 802.11ac AP
202plugin: shell139plugin: shell
203category_id: com.canonical.plainbox::wireless
204id: wireless/wireless_connection_open_ac
205requires:
206 device.category == 'WIRELESS'
207 environment.ROUTERS == 'multiple'
208 IEEE_80211.ac == 'supported'
209user: root
210environ: OPEN_AC_SSID
211command:140command:
212 trap "nmcli con delete id $OPEN_AC_SSID" EXIT141 net_driver_info $NET_DRIVER_INFO
213 if create_connection wifi $OPEN_AC_SSID; then142 wifi_nmcli_test open {{ interface }} "$OPEN_AC_SSID"
214 connect_wireless # lp:1471663143category_id: com.canonical.plainbox::wireless
215 INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'`
216 iw dev $INTERFACE link
217 gateway_ping_test --interface=$INTERFACE
218 STATUS=$?
219 # We reconnect the Ethernet connection if any (lp:1471663)
220 WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)")
221 if [[ ! -z $WIRED ]]; then
222 nmcli c up uuid $WIRED
223 fi
224 exit $STATUS
225 else
226 exit 1
227 fi
228estimated_duration: 30.0144estimated_duration: 30.0
229_description:145flags: preserve-locale also-after-suspend
230 Tests that the systems wireless hardware can connect to a router using no146requires:
231 security and the 802.11ac protocol.147 wireless_sta_protocol.{{ interface }}_ac == 'supported'
148 {%- if "SNAP_NAME" in __system_env__ %}
149 connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager'
150 {% endif -%}
232151
233plugin: user-interact-verify152plugin: user-interact-verify
234category_id: com.canonical.plainbox::wireless153category_id: com.canonical.plainbox::wireless
@@ -525,78 +444,3 @@ command:
525estimated_duration: 330.0444estimated_duration: 330.0
526_description:445_description:
527 Tests the performance of a system's wireless connection through the iperf tool, using UDP packets.446 Tests the performance of a system's wireless connection through the iperf tool, using UDP packets.
528
529unit: template
530template-resource: device
531template-filter:
532 device.category == 'WIRELESS'
533plugin: shell
534category_id: com.canonical.plainbox::wireless
535id: wireless/stress_performance_device{__index__}_{interface}
536estimated_duration: 330.0
537requires:
538 package.name == 'iperf'
539environ: TEST_TARGET_IPERF
540user: root
541command: network test -i {interface} -t stress
542_description:
543 This test executes iperf to generate a load on the network device {__index__} ({interface}) and then performs a ping test to watch for dropped packets and very large latency periods.
544
545plugin: shell
546category_id: com.canonical.plainbox::wireless
547id: wireless/wireless_extension
548requires: device.category == 'WIRELESS'
549command: wireless_ext
550estimated_duration: 1.2
551_description:
552 Test that the MAC80211 modules are loaded and wireless extensions are working.
553
554unit: template
555template-resource: device
556template-filter: device.category == 'WIRELESS'
557plugin: shell
558category_id: com.canonical.plainbox::wireless
559id: wireless/iwconfig_check_device{__index__}_{interface}
560estimated_duration: 1.2
561command: iwconfig {interface}
562_description:
563 This test executes iwconfig requests against wireless device {__index__} ({interface}).
564
565plugin: user-interact-verify
566category_id: com.canonical.plainbox::wireless
567id: wireless/wireless_rfkill
568command: rfkill list | zenity --text-info --title rfkill-Info
569estimated_duration: 120.0
570requires: device.category == 'WIRELESS'
571_description:
572 PURPOSE:
573 This test will check whether or not your driver responds to rfkill commands.
574 STEPS:
575 1. Use the hardware switch on the side of your device to switch off wireless.
576 2. If you do not have a hardware switch disable wireless from the network manager icon in the panel
577 3. Click "Test" to verify that the hard or soft blocks are in place.
578 VERIFICATION:
579 Did the hard or soft blocks show on in the dialog?
580
581unit: template
582template-resource: device
583template-filter: device.category == 'WIRELESS'
584plugin: user-interact-verify
585category_id: com.canonical.plainbox::wireless
586id: wireless/maximum_bandwidth_device{__index__}_{interface}
587estimated_duration: 120.0
588requires:
589 package.name == 'zenity'
590 package.name == 'iperf'
591environ: TEST_TARGET_IPERF
592user: root
593command: network test -i {interface} -t iperf 2>&1 | cat - <(echo; echo "Verify the result and click OK to decide on the outcome") | zenity --text-info --title 'mobile broadband max bw {interface}'
594_purpose:
595 User verification of whether the observed transfer throughput is acceptable
596 for the type and maximum speed of wireless device {__index__} ({interface}).
597_steps:
598 1. Click "Test".
599 2. Read the network test summary and confirm that the throughput is acceptable.
600 3. If needed, click "Test" again to repeat the transfer test.
601_verification:
602 Was the reported throughput acceptable for the type and maximum speed of this interface?
diff --git a/units/wireless/test-plan.pxu b/units/wireless/test-plan.pxu
index b4cf2f7..e1b6cfd 100644
--- a/units/wireless/test-plan.pxu
+++ b/units/wireless/test-plan.pxu
@@ -19,38 +19,38 @@ unit: test plan
19_name: Wireless tests19_name: Wireless tests
20_description: Wireless connection tests20_description: Wireless connection tests
21include:21include:
22 wireless/wireless_scanning certification-status=blocker22 wireless/wireless_scanning_.* certification-status=blocker
23 wireless/wireless_connection_wpa_bg certification-status=blocker23 wireless/wireless_connection_wpa_bg_nm_.* certification-status=blocker
24 wireless/wireless_connection_open_bg certification-status=blocker24 wireless/wireless_connection_open_bg_nm_.* certification-status=blocker
25 wireless/wireless_connection_wpa_n certification-status=blocker25 wireless/wireless_connection_wpa_n_nm_.* certification-status=blocker
26 wireless/wireless_connection_open_n certification-status=blocker26 wireless/wireless_connection_open_n_nm_.* certification-status=blocker
27 wireless/wireless_connection_wpa_ac certification-status=blocker27 wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker
28 wireless/wireless_connection_open_ac certification-status=blocker28 wireless/wireless_connection_open_ac_nm_.* certification-status=blocker
2929
30id: after-suspend-wireless-cert-automated30id: after-suspend-wireless-cert-automated
31unit: test plan31unit: test plan
32_name: Wireless tests (after suspend, automated)32_name: Wireless tests (after suspend, automated)
33_description: Wireless connection tests (after suspend, automated)33_description: Wireless connection tests (after suspend, automated)
34include:34include:
35 suspend/wireless_connection_after_suspend_wpa_bg certification-status=blocker35 after-suspend-wireless/wireless_connection_wpa_bg_nm_.* certification-status=blocker
36 suspend/wireless_connection_after_suspend_open_bg certification-status=blocker36 after-suspend-wireless/wireless_connection_open_bg_nm_.* certification-status=blocker
37 suspend/wireless_connection_after_suspend_wpa_n certification-status=blocker37 after-suspend-wireless/wireless_connection_wpa_n_nm_.* certification-status=blocker
38 suspend/wireless_connection_after_suspend_open_n certification-status=blocker38 after-suspend-wireless/wireless_connection_open_n_nm_.* certification-status=blocker
39 suspend/wireless_connection_after_suspend_wpa_ac certification-status=blocker39 after-suspend-wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker
40 suspend/wireless_connection_after_suspend_open_ac certification-status=blocker40 after-suspend-wireless/wireless_connection_open_ac_nm_.* certification-status=blocker
4141
42id: wireless-cert-blockers42id: wireless-cert-blockers
43unit: test plan43unit: test plan
44_name: Wireless tests (certification blockers only)44_name: Wireless tests (certification blockers only)
45_description: Wireless connection tests (certification blockers only)45_description: Wireless connection tests (certification blockers only)
46include:46include:
47 wireless/wireless_scanning certification-status=blocker47 wireless/wireless_scanning_.* certification-status=blocker
48 wireless/wireless_connection_wpa_bg certification-status=blocker48 wireless/wireless_connection_wpa_bg_nm_.* certification-status=blocker
49 wireless/wireless_connection_open_bg certification-status=blocker49 wireless/wireless_connection_open_bg_nm_.* certification-status=blocker
50 wireless/wireless_connection_wpa_n certification-status=blocker50 wireless/wireless_connection_wpa_n_nm_.* certification-status=blocker
51 wireless/wireless_connection_open_n certification-status=blocker51 wireless/wireless_connection_open_n_nm_.* certification-status=blocker
52 wireless/wireless_connection_wpa_ac certification-status=blocker52 wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker
53 wireless/wireless_connection_open_ac certification-status=blocker53 wireless/wireless_connection_open_ac_nm_.* certification-status=blocker
5454
55id: after-suspend-wireless-cert-blockers55id: after-suspend-wireless-cert-blockers
56unit: test plan56unit: test plan
@@ -58,9 +58,9 @@ _name: Wireless tests (after suspend, certification blockers only)
58_description:58_description:
59 Wireless connection tests (after suspend, certification blockers only)59 Wireless connection tests (after suspend, certification blockers only)
60include:60include:
61 suspend/wireless_connection_after_suspend_wpa_bg certification-status=blocker61 after-suspend-wireless/wireless_connection_wpa_bg_nm_.* certification-status=blocker
62 suspend/wireless_connection_after_suspend_open_bg certification-status=blocker62 after-suspend-wireless/wireless_connection_open_bg_nm_.* certification-status=blocker
63 suspend/wireless_connection_after_suspend_wpa_n certification-status=blocker63 after-suspend-wireless/wireless_connection_wpa_n_nm_.* certification-status=blocker
64 suspend/wireless_connection_after_suspend_open_n certification-status=blocker64 after-suspend-wireless/wireless_connection_open_n_nm_.* certification-status=blocker
65 suspend/wireless_connection_after_suspend_wpa_ac certification-status=blocker65 after-suspend-wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker
66 suspend/wireless_connection_after_suspend_open_ac certification-status=blocker66 after-suspend-wireless/wireless_connection_open_ac_nm_.* certification-status=blocker

Subscribers

People subscribed via source and target branches