Merge ~dirksu/plainbox-provider-pc-sanity:check_wifi6e into plainbox-provider-pc-sanity:master

Proposed by Dirk Su
Status: Merged
Merged at revision: 7ddff4e65052090eb2276d13f5842d289ee1e77b
Proposed branch: ~dirksu/plainbox-provider-pc-sanity:check_wifi6e
Merge into: plainbox-provider-pc-sanity:master
Diff against target: 94 lines (+59/-0)
3 files modified
bin/check_wifi6e.py (+41/-0)
units/pc-sanity/pc-sanity-check-devices.pxu (+16/-0)
units/pc-sanity/pc-sanity.pxu (+2/-0)
Reviewer Review Type Date Requested Status
Kai-Chuan Hsieh Approve
Review via email: mp+415882@code.launchpad.net

Commit message

Check if wifi 6GHz band enabled with kernel version less then 5.15

To post a comment you must log in.
Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :
Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote :

Should add test case to both pc-sanity-smoke-test and pc-sanity-smoke-test-no-dgpu-switching.
The rest looks good to me.

Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote (last edit ):

For running the script, you require the package supports iw and uname, please add it to the pxu file as required package for running the test case. It should be coreutils and iw in this case.

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :
Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/check_wifi6e.py b/bin/check_wifi6e.py
2new file mode 100755
3index 0000000..bdbd9a6
4--- /dev/null
5+++ b/bin/check_wifi6e.py
6@@ -0,0 +1,41 @@
7+#!/usr/bin/env python3
8+# -*- coding: utf-8 -*-
9+
10+import subprocess
11+import sys
12+
13+
14+def main():
15+ if len(sys.argv) < 2:
16+ print(sys.argv[0] + " [interface]")
17+ return 0
18+
19+ kernel_version = subprocess.getoutput("uname -r").split(".")
20+ if int(kernel_version[1]) > 15:
21+ return 0
22+
23+ _6g_start = 5945
24+ _6g_end = 7125
25+
26+ data = subprocess.run(
27+ ["iw", sys.argv[1], "info"],
28+ capture_output=True,
29+ encoding='utf-8')
30+ if data.returncode:
31+ print(sys.argv[1] + " is not valid wireless interface")
32+ return 0
33+ index = data.stdout[data.stdout.find('wiphy') + 6]
34+ data = subprocess.getoutput("iw phy" + index + " info").splitlines()
35+ for i, line in enumerate(data):
36+ if 'Frequencies' in line:
37+ while data[i + 1].startswith('\t\t\t'):
38+ if 'disabled' not in (data[i + 1]):
39+ freq = int(data[i + 1].split()[1])
40+ if freq > _6g_start and freq < _6g_end:
41+ raise SystemExit("Contain 6Ghz band and Kernel not over 5.15") # noqa: E501
42+ i = i + 1
43+ return 0
44+
45+
46+if __name__ == '__main__':
47+ main()
48diff --git a/units/pc-sanity/pc-sanity-check-devices.pxu b/units/pc-sanity/pc-sanity-check-devices.pxu
49index 2b9bb09..f66c128 100644
50--- a/units/pc-sanity/pc-sanity-check-devices.pxu
51+++ b/units/pc-sanity/pc-sanity-check-devices.pxu
52@@ -51,6 +51,22 @@ _summary: Check if kernel log contains mt7921e failed to start WM firmware
53 _description:
54 Check if the system experience mt7921e failed to start WM firmware.
55
56+unit: template
57+template-resource: device
58+template-filter:
59+ device.category == 'WIRELESS'
60+template-unit: job
61+plugin: shell
62+category_id: com.canonical.plainbox::miscellanea
63+id: miscellanea/check_{interface}_wifi6e_enabled
64+requires:
65+ package.name == 'coreutils'
66+ package.name == 'iw'
67+command: check_wifi6e.py {interface}
68+_summary: Check the status of Wifi6e
69+_description:
70+ Check if the system enable Wifi6e 6GHz band with Kernel less then 5.15
71+
72 plugin: shell
73 category_id: com.canonical.plainbox::miscellanea
74 id: miscellanea/intel_pmc_core
75diff --git a/units/pc-sanity/pc-sanity.pxu b/units/pc-sanity/pc-sanity.pxu
76index b6f006a..bdf203d 100644
77--- a/units/pc-sanity/pc-sanity.pxu
78+++ b/units/pc-sanity/pc-sanity.pxu
79@@ -47,6 +47,7 @@ include:
80 com.canonical.certification::miscellanea/check_.*_unchecked_msr_access_error
81 com.canonical.certification::miscellanea/check_.*_start_rt_ucode_failed
82 com.canonical.certification::miscellanea/check_.*_start_wm_firmware_failed
83+ com.canonical.certification::miscellanea/check_.*_wifi6e_enabled
84 exclude:
85 com.canonical.certification::suspend/bluetooth_obex_send_before_suspend
86 com.canonical.certification::suspend/bluetooth_obex_send_after_suspend_auto
87@@ -109,6 +110,7 @@ include:
88 com.canonical.certification::miscellanea/check_.*_unchecked_msr_access_error
89 com.canonical.certification::miscellanea/check_.*_start_rt_ucode_failed
90 com.canonical.certification::miscellanea/check_.*_start_wm_firmware_failed
91+ com.canonical.certification::miscellanea/check_.*_wifi6e_enabled
92 exclude:
93 com.canonical.certification::after-suspend-bluetooth4/beacon_.*
94 com.canonical.certification::bluetooth4/beacon_eddystone.*

Subscribers

People subscribed via source and target branches