Merge ~sylvain-pineau/plainbox-provider-resource:fix_flake8_shellcheck_errors into plainbox-provider-resource:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: e5959f6a045d0e3784575424b07c432eb300aed1
Merged at revision: 9e5f8cff2b244b4e11eb96fbd9f56ee50e9c93cd
Proposed branch: ~sylvain-pineau/plainbox-provider-resource:fix_flake8_shellcheck_errors
Merge into: plainbox-provider-resource:master
Diff against target: 307 lines (+47/-36)
12 files modified
bin/block_device_resource.py (+3/-2)
bin/cpuinfo_resource.py (+3/-1)
bin/efi_resource.py (+2/-1)
bin/graphics_card_resource.py (+5/-2)
bin/lsb_resource.py (+1/-3)
bin/mobilebroadband_resource.sh (+6/-9)
bin/module_resource.py (+1/-0)
bin/optical_resource.py (+1/-0)
bin/udev_resource.py (+4/-3)
jobs/resource.pxu (+19/-14)
requirements/container-tests-provider-resource-generic (+1/-1)
requirements/deb-base.txt (+1/-0)
Reviewer Review Type Date Requested Status
Devices Certification Bot Needs Fixing
Sylvain Pineau (community) Approve
Review via email: mp+387517@code.launchpad.net

Description of the change

sylvain@sylvain-ThinkPad-T480s:/tmp/plainbox-provider-resource$ ./manage.py test
test_job_command_jobs/resource.pxu:103-109_module (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:111-119_package (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:121-128_executable (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:130-135_device (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:137-142_removable_partition (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:144-153_staging/udev (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:155-166_dmi_present (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:168-175_dmi (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:177-182_efi (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:184-189_uname (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:191-196_sleep (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:198-205_optical_drive_{name} (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:207-212_block_device (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:214-219_display (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:221-235_usb (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:237-242_xinput (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:244-252_environment (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:254-258_mobilebroadband (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:260-272_virtualization (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:274-278_IEEE_80211 (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:280-291_wireless_sta_protocol (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:293-303_rtc (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:305-338_requirements (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:340-344_graphics_card (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:346-352_fwts (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:354-361_mir (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:363-373_wifi_interface_mode (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:375-382_snap (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:384-391_interface (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:393-400_connections (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:402-409_model_assertion (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:411-418_serial_assertion (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:420-432_serial_ports_static (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:434-443_ubuntu_core_features (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:445-457_net_if_management (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:459-469_net_if_management_attachment (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:471-480_bootloader (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:482-495_nvdimm_resource (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:67-72_cpuinfo (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:74-80_cdimage (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:82-87_dpkg (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:89-94_lsb (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_job_command_jobs/resource.pxu:96-101_meminfo (plainbox.provider_manager.InlineShellcheckTests) ... ok
test_shellcheck_/tmp/plainbox-provider-resource/bin/mobilebroadband_resource.sh (plainbox.provider_manager.ShellcheckTests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/block_device_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/bootloader_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/cdimage_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/cpuinfo_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/display_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/dmi_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/dpkg_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/efi_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/graphics_card_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/lsb_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/meminfo_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/module_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/net_if_management.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/optical_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/snapd_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/udev2resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/udev_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/uname_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test_flake8_/tmp/plainbox-provider-resource/bin/xinput_resource.py (plainbox.provider_manager.Flake8Tests) ... ok
test (test_net_if_management.Test_CARA_T) ... ok
test (test_net_if_management.Test_CASCADE_500) ... ok
test (test_net_if_management.Test_RPI2_UC16_CCONF) ... ok
test (test_net_if_management.Test_RPI3B_UC16_CLOUDINIT) ... ok
test (test_net_if_management.Test_XENIAL_DESKTOP) ... ok

----------------------------------------------------------------------
Ran 68 tests in 4.519s

OK

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

re-starting from a fresh proposal

review: Approve
Revision history for this message
Devices Certification Bot (ce-certification-qa) wrote :

The merge was fine but running tests failed.

[bionic] [12:15:02] starting container
Device project added to bionic-testing
[xenial] [12:15:11] starting container
Device project added to xenial-testing
[bionic] [12:15:16] provisioning container
[focal] [12:15:20] starting container
[xenial] [12:15:21] provisioning container
Device project added to focal-testing
[focal] [12:15:35] provisioning container
[bionic] [12:15:49] Starting tests...
[bionic] Found a test script: ./requirements/container-tests-provider-resource-generic
[xenial] [12:15:51] Starting tests...
[xenial] Found a test script: ./requirements/container-tests-provider-resource-generic
[focal] [12:16:14] Starting tests...
[focal] Found a test script: ./requirements/container-tests-provider-resource-generic
[xenial] [12:17:00] container-tests-provider-resource-generic: PASS
[xenial] [12:17:00] Fixing file permissions in source directory
[xenial] [12:17:00] Destroying container
[bionic] [12:17:19] container-tests-provider-resource-generic: PASS
[bionic] [12:17:19] Fixing file permissions in source directory
[bionic] [12:17:19] Destroying container
[focal] [12:17:23] container-tests-provider-resource-generic: FAIL
[focal] output: https://paste.ubuntu.com/p/SPVGScYyzx/
[focal] [12:17:26] Fixing file permissions in source directory
[focal] [12:17:26] Destroying container

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/block_device_resource.py b/bin/block_device_resource.py
index 2ce9d29..ad6c5fb 100755
--- a/bin/block_device_resource.py
+++ b/bin/block_device_resource.py
@@ -33,7 +33,7 @@ def usb_support(name, version):
33 path = rootdir_pattern.sub('', os.readlink('/sys/block/%s' % name))33 path = rootdir_pattern.sub('', os.readlink('/sys/block/%s' % name))
3434
35 # Remove the usb config.interface part of the path35 # Remove the usb config.interface part of the path
36 m = re.match('((.*usb\d+).*\/)\d-[\d\.:\-]+\/.*', path)36 m = re.match('((.*usb\d+).*\/)\d-[\d\.:\-]+\/.*', path) # noqa: W605
37 if m:37 if m:
38 device_path = m.group(1)38 device_path = m.group(1)
39 hub_port_path = m.group(2)39 hub_port_path = m.group(2)
@@ -137,8 +137,9 @@ def smart_support(name):
137 break137 break
138 return supported138 return supported
139139
140
140for path in glob('/sys/block/*/device') + glob('/sys/block/*/dm'):141for path in glob('/sys/block/*/device') + glob('/sys/block/*/dm'):
141 name = re.sub('.*/(.*?)/(device|dm)', '\g<1>', path)142 name = re.sub('.*/(.*?)/(device|dm)', '\g<1>', path) # noqa: W605
142 state = device_state(name)143 state = device_state(name)
143 usb2 = usb_support(name, 2.00)144 usb2 = usb_support(name, 2.00)
144 usb3 = usb_support(name, 3.00)145 usb3 = usb_support(name, 3.00)
diff --git a/bin/cpuinfo_resource.py b/bin/cpuinfo_resource.py
index d00eeab..31e8b63 100755
--- a/bin/cpuinfo_resource.py
+++ b/bin/cpuinfo_resource.py
@@ -29,7 +29,9 @@ CPUINFO_FILENAME = "/proc/cpuinfo"
29FREQUENCY_FILENAME = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"29FREQUENCY_FILENAME = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"
3030
31# Filename where available frequency governors are stored.31# Filename where available frequency governors are stored.
32GOVERNORS_FILENAME = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"32GOVERNORS_FILENAME = (
33 "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors")
34
3335
34class CpuinfoResult:36class CpuinfoResult:
3537
diff --git a/bin/efi_resource.py b/bin/efi_resource.py
index 2f53720..fa1e270 100755
--- a/bin/efi_resource.py
+++ b/bin/efi_resource.py
@@ -24,7 +24,8 @@ from checkbox_support.parsers.efi import EfiParser
2424
2525
26# Command to retrieve efi information.26# Command to retrieve efi information.
27COMMAND = "[ -d /sys/firmware/efi ] && cat /var/log/kern.log* | grep -m 1 -o --color=never 'EFI v.*' || true"27COMMAND = ("[ -d /sys/firmware/efi ] && cat /var/log/kern.log* | "
28 "grep -m 1 -o --color=never 'EFI v.*' || true")
2829
2930
30class EfiResult:31class EfiResult:
diff --git a/bin/graphics_card_resource.py b/bin/graphics_card_resource.py
index 110c5f4..edd3b3b 100755
--- a/bin/graphics_card_resource.py
+++ b/bin/graphics_card_resource.py
@@ -31,6 +31,7 @@ def slugify(_string):
31 "-_.{}{}".format(string.ascii_letters, string.digits))31 "-_.{}{}".format(string.ascii_letters, string.digits))
32 return ''.join(c if c in valid_chars else '_' for c in _string)32 return ''.join(c if c in valid_chars else '_' for c in _string)
3333
34
34def subprocess_lines_generator(command):35def subprocess_lines_generator(command):
35 """36 """
36 Generator that opens a subprocess and spits out lines37 Generator that opens a subprocess and spits out lines
@@ -118,8 +119,9 @@ def main():
118119
119 # udev_devices generates one dict per device, the list shown120 # udev_devices generates one dict per device, the list shown
120 # below filters that to only VIDEO ones121 # below filters that to only VIDEO ones
121 video_devices = list(r for r in udev_devices(udev_output)122 video_devices = list(
122 if r.get("category", "") == 'VIDEO')123 r for r in udev_devices(udev_output) if r.get(
124 "category", "") == 'VIDEO')
123 video_devices.sort(key=lambda r: bus_ordering(r))125 video_devices.sort(key=lambda r: bus_ordering(r))
124126
125 # commands needed to switch to and from particular GPU,127 # commands needed to switch to and from particular GPU,
@@ -188,5 +190,6 @@ def main():
188 raise SystemExit(err)190 raise SystemExit(err)
189 return 0191 return 0
190192
193
191if __name__ == "__main__":194if __name__ == "__main__":
192 raise SystemExit(main())195 raise SystemExit(main())
diff --git a/bin/lsb_resource.py b/bin/lsb_resource.py
index d33db78..297661e 100755
--- a/bin/lsb_resource.py
+++ b/bin/lsb_resource.py
@@ -20,8 +20,6 @@
20import re20import re
21import sys21import sys
2222
23from subprocess import Popen, PIPE
24
2523
26def get_lsb_release():24def get_lsb_release():
27 lsb_release_map = {25 lsb_release_map = {
@@ -41,7 +39,7 @@ def get_lsb_release():
41 key = lsb_release_map[key]39 key = lsb_release_map[key]
42 # Strip out quotes and newlines40 # Strip out quotes and newlines
43 lsb_release[key] = re.sub('["\n]', '', value)41 lsb_release[key] = re.sub('["\n]', '', value)
44 except:42 except OSError:
45 # Missing file or permissions? Return the default lsb_release43 # Missing file or permissions? Return the default lsb_release
46 pass44 pass
4745
diff --git a/bin/mobilebroadband_resource.sh b/bin/mobilebroadband_resource.sh
index 10e9adc..2220c5a 100755
--- a/bin/mobilebroadband_resource.sh
+++ b/bin/mobilebroadband_resource.sh
@@ -18,19 +18,16 @@
18# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.18# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
19#19#
2020
21MMCLI_PATH=$(which mmcli)21MMCLI_PATH=$(command -v mmcli)
2222
23if [ -x "$MMCLI_PATH" ]; then23if [ -x "$MMCLI_PATH" ]; then
24 # Use mmcli to query for modem capabilities24 # Use mmcli to query for modem capabilities
25 for i in $(mmcli --simple-status -L 2>/dev/null || mmcli -L | \25 for i in $(mmcli --simple-status -L 2>/dev/null || mmcli -L | \
26 awk '/freedesktop\/ModemManager1\/Modem/ {print $1;}'); do26 awk '/freedesktop\/ModemManager1\/Modem/ {print $1;}'); do
27 mmcli -m $i |grep -q "supported: .*gsm-umts.*" && GSM=yes27 mmcli -m "$i" | grep -q "supported: .*gsm-umts.*" && GSM=yes
28 mmcli -m $i |grep -q "supported: .*cdma.*" && CDMA=yes28 mmcli -m "$i" | grep -q "supported: .*cdma.*" && CDMA=yes
29 done29 done
30 # force final exit status to true in case the test fails,30 [ "$GSM" = "yes" ] && echo "gsm: supported"
31 # as it's a resource and we don't want it to fail unless it31 [ "$CDMA" = "yes" ] && echo "cdma: supported"
32 # really failed :D
33 [ "$GSM" = "yes" ] && echo "gsm: supported" || true
34 [ "$CDMA" = "yes" ] && echo "cdma: supported" || true
35fi32fi
3633exit 0
diff --git a/bin/module_resource.py b/bin/module_resource.py
index 8f3f53d..43d15a0 100755
--- a/bin/module_resource.py
+++ b/bin/module_resource.py
@@ -69,5 +69,6 @@ def main():
6969
70 return 070 return 0
7171
72
72if __name__ == "__main__":73if __name__ == "__main__":
73 sys.exit(main())74 sys.exit(main())
diff --git a/bin/optical_resource.py b/bin/optical_resource.py
index 2e52780..92f9daf 100755
--- a/bin/optical_resource.py
+++ b/bin/optical_resource.py
@@ -76,5 +76,6 @@ def main():
76 if cap in cdrom_id:76 if cap in cdrom_id:
77 print(CAP_MAP[cap] + ": supported")77 print(CAP_MAP[cap] + ": supported")
7878
79
79if __name__ == "__main__":80if __name__ == "__main__":
80 sys.exit(main())81 sys.exit(main())
diff --git a/bin/udev_resource.py b/bin/udev_resource.py
index 23ec94a..b18e085 100755
--- a/bin/udev_resource.py
+++ b/bin/udev_resource.py
@@ -62,7 +62,8 @@ class UdevResultLister:
62 for c, devices in self._data.items():62 for c, devices in self._data.items():
63 if short:63 if short:
64 for d in devices:64 for d in devices:
65 print("{}".format(d.replace('None ', '').replace(' None', '')))65 print("{}".format(
66 d.replace('None ', '').replace(' None', '')))
66 else:67 else:
67 print("{} ({}):".format(c, len(devices)))68 print("{} ({}):".format(c, len(devices)))
68 for d in devices:69 for d in devices:
@@ -107,13 +108,13 @@ def main():
107 metavar=("CATEGORY"), default=(),108 metavar=("CATEGORY"), default=(),
108 help="""List devices found under the requested109 help="""List devices found under the requested
109 categories.110 categories.
110 Acceptable categories to list are: 111 Acceptable categories to list are:
111 {}""".format(', '.join(categories)))112 {}""".format(', '.join(categories)))
112 parser.add_argument('-f', '--filter', nargs='+', choices=categories,113 parser.add_argument('-f', '--filter', nargs='+', choices=categories,
113 metavar=("CATEGORY"), default=(),114 metavar=("CATEGORY"), default=(),
114 help="""Filter devices found under the requested115 help="""Filter devices found under the requested
115 categories.116 categories.
116 Acceptable categories to list are: 117 Acceptable categories to list are:
117 {}""".format(', '.join(categories)))118 {}""".format(', '.join(categories)))
118 parser.add_argument('-s', '--short', action='store_true')119 parser.add_argument('-s', '--short', action='store_true')
119 args = parser.parse_args()120 args = parser.parse_args()
diff --git a/jobs/resource.pxu b/jobs/resource.pxu
index bcf4d70..7766b92 100644
--- a/jobs/resource.pxu
+++ b/jobs/resource.pxu
@@ -112,6 +112,7 @@ id: package
112estimated_duration: 1.16112estimated_duration: 1.16
113plugin: resource113plugin: resource
114command:114command:
115 # shellcheck disable=SC2016
115 dpkg-query -W -f='name: ${Package}\nversion: ${Version}\nmodalias: ${Modaliases}\n\n' || \116 dpkg-query -W -f='name: ${Package}\nversion: ${Version}\nmodalias: ${Modaliases}\n\n' || \
116 echo -e 'name: plainbox\nversion: 0.1\nmodalias: \n\n' |\117 echo -e 'name: plainbox\nversion: 0.1\nmodalias: \n\n' |\
117 awk 'BEGIN {RS = ""; FS = "\n"}{print $1; print $2; if ($3 ~ /^modalias: .+$/) {print $3}; print "" }'118 awk 'BEGIN {RS = ""; FS = "\n"}{print $1; print $2; if ($3 ~ /^modalias: .+$/) {print $3}; print "" }'
@@ -124,7 +125,7 @@ plugin: resource
124_summary: Enumerate available system executables125_summary: Enumerate available system executables
125_description: Generates a resource for all available executables126_description: Generates a resource for all available executables
126command:127command:
127 find -H $(echo "$PATH" | sed -e 's/:/ /g') -maxdepth 1 -xtype f -executable -printf "name: %f\nlocation: %h\n\n"128 xargs -n1 -d: <<< "$PATH" | xargs -I{} find -H {} -maxdepth 1 -xtype f -executable -printf "name: %f\nlocation: %h\n\n"
128 true129 true
129130
130id: device131id: device
@@ -191,7 +192,8 @@ _summary: Collect information about the running kernel
191id: sleep192id: sleep
192estimated_duration: 0.03193estimated_duration: 0.03
193plugin: resource194plugin: resource
194command: for state in `cat /sys/power/state`; do echo "$state: supported"; done195command:
196 tr ' ' '\n' < /sys/power/state | while IFS= read -r state; do echo "$state: supported"; done
195_summary: Create resource info for supported sleep states197_summary: Create resource info for supported sleep states
196198
197unit: template199unit: template
@@ -246,8 +248,8 @@ plugin: resource
246_summary: Create resource info for environment variables248_summary: Create resource info for environment variables
247command:249command:
248 IFS=$'\n'250 IFS=$'\n'
249 for e in `env | sed 's/=/:/g'`; do251 for e in $(env | sed 's/=/:/g'); do
250 echo $e | awk -F':' '{print $1 ": " $2}'252 echo "$e" | awk -F':' '{print $1 ": " $2}'
251 done253 done
252254
253id: mobilebroadband255id: mobilebroadband
@@ -282,9 +284,11 @@ _summary: Resource job to identify Wi-Fi STA supported protocols
282_description:284_description:
283 Job listing STA supported 802.11 protocols per interfaces.285 Job listing STA supported 802.11 protocols per interfaces.
284command:286command:
285 for i in `iw dev | grep -oP 'Interface\s+\K\w+'`; do iw phy phy$(iw dev $i info | grep -oP 'wiphy\s+\K\d+') info | grep -q 'VHT' && echo $i"_ac: supported" || echo $i"_ac: unsupported"; done287 # shellcheck disable=SC2046
288 for i in $(iw dev | grep -oP 'Interface\s+\K\w+'); do iw phy phy$(iw dev "$i" info | grep -oP 'wiphy\s+\K\d+') info | grep -q 'VHT' && echo "$i""_ac: supported" || echo "$i""_ac: unsupported"; done
286 # MCS 10 and 11 if present support the ax only 1024-QAM 289 # MCS 10 and 11 if present support the ax only 1024-QAM
287 for i in `iw dev | grep -oP 'Interface\s+\K\w+'`; do iw phy phy$(iw dev $i info | grep -oP 'wiphy\s+\K\d+') info | grep -q 'MCS 0-11' && echo $i"_ax: supported" || echo $i"_ax: unsupported"; done290 # shellcheck disable=SC2046
291 for i in $(iw dev | grep -oP 'Interface\s+\K\w+'); do iw phy phy$(iw dev "$i" info | grep -oP 'wiphy\s+\K\d+') info | grep -q 'MCS 0-11' && echo "$i""_ax: supported" || echo "$i""_ax: unsupported"; done
288estimated_duration: 0.5292estimated_duration: 0.5
289flags: preserve-locale293flags: preserve-locale
290294
@@ -304,8 +308,8 @@ id: requirements
304estimated_duration: 0.01308estimated_duration: 0.01
305plugin: resource309plugin: resource
306command:310command:
307 if [ -f $PLAINBOX_SESSION_SHARE/requirements_docs.txt ];then311 if [ -f "$PLAINBOX_SESSION_SHARE"/requirements_docs.txt ];then
308 cat $PLAINBOX_SESSION_SHARE/requirements_docs.txt312 cat "$PLAINBOX_SESSION_SHARE"/requirements_docs.txt
309 else313 else
310 true314 true
311 fi315 fi
@@ -347,7 +351,7 @@ plugin: resource
347requires: executable.name == "fwts"351requires: executable.name == "fwts"
348_summary: Generate an entry for each FWTS test available352_summary: Generate an entry for each FWTS test available
349command:353command:
350 for test in `checkbox-support-fwts_test --list`; do echo "name: $test"; echo ""; done354 for test in $(checkbox-support-fwts_test --list); do echo "name: $test"; echo ""; done
351355
352id: mir356id: mir
353estimated_duration: 0.5357estimated_duration: 0.5
@@ -355,17 +359,18 @@ plugin: resource
355requires: package.name == "mir-test-tools"359requires: package.name == "mir-test-tools"
356_summary: Generate an entry for each MIR integration tests360_summary: Generate an entry for each MIR integration tests
357command:361command:
358 for test in `mir_integration_tests --gtest_list_tests | sed -n '/\.$/s/\.$//p'`; do echo "category: integration"; echo "name: $test"; echo ""; done362 for test in $(mir_integration_tests --gtest_list_tests | sed -n '/\.$/s/\.$//p'); do echo "category: integration"; echo "name: $test"; echo ""; done
359 for test in `mir_acceptance_tests --gtest_list_tests | sed -n '/\.$/s/\.$//p'`; do echo "category: acceptance"; echo "name: $test"; echo ""; done363 for test in $(mir_acceptance_tests --gtest_list_tests | sed -n '/\.$/s/\.$//p'); do echo "category: acceptance"; echo "name: $test"; echo ""; done
360364
361id: wifi_interface_mode365id: wifi_interface_mode
362estimated_duration: 0.1366estimated_duration: 0.1
363plugin: resource367plugin: resource
364command:368command:
365 for i in `iw dev | grep -oP 'Interface\s+\K\w+'`;369 # shellcheck disable=SC2046
366 do iw phy phy$(iw dev $i info | grep -oP 'wiphy\s+\K\d+') info |370 for i in $(iw dev | grep -oP 'Interface\s+\K\w+');
371 do iw phy phy$(iw dev "$i" info | grep -oP 'wiphy\s+\K\d+') info |
367 grep -Pzo '(?s)Supported interface modes:\n\K(\s+\*\s.*?\n)+' |372 grep -Pzo '(?s)Supported interface modes:\n\K(\s+\*\s.*?\n)+' |
368 sed "s/.*\* \(.*\)/"$i"_\1: supported/" | tr -d '\000';373 sed "s/.*\* \(.*\)/""$i""_\1: supported/" | tr -d '\000';
369 done374 done
370_summary: Create resource info for supported wifi interface modes375_summary: Create resource info for supported wifi interface modes
371376
diff --git a/requirements/container-tests-provider-resource-generic b/requirements/container-tests-provider-resource-generic
index 8bdb200..678a35c 100755
--- a/requirements/container-tests-provider-resource-generic
+++ b/requirements/container-tests-provider-resource-generic
@@ -14,4 +14,4 @@ echo "I: running 'develop' on checkbox-support"
14( cd $TMPDIR/checkbox-support/ && python3 setup.py develop --quiet | sed -e 's/^/I (develop output) /' )14( cd $TMPDIR/checkbox-support/ && python3 setup.py develop --quiet | sed -e 's/^/I (develop output) /' )
1515
16./manage.py validate16./manage.py validate
17./manage.py test -u17./manage.py test
diff --git a/requirements/deb-base.txt b/requirements/deb-base.txt
index 4d44ad8..ee93fed 100644
--- a/requirements/deb-base.txt
+++ b/requirements/deb-base.txt
@@ -4,3 +4,4 @@ libnl-genl-3-200
4libnl-genl-3-dev4libnl-genl-3-dev
5pkg-config5pkg-config
6shellcheck6shellcheck
7flake8

Subscribers

People subscribed via source and target branches