Merge ~medicalwei/plainbox-provider-checkbox:fixed-screen-orientation-on-laptops into plainbox-provider-checkbox:master

Proposed by Yao Wei
Status: Merged
Approved by: Kai-Chuan Hsieh
Approved revision: f33feb02a56471e8ea605cabc2d698a40890af6f
Merged at revision: 966f0c29d2ed660dda7a2ca5eedfd61bf3d1c7e1
Proposed branch: ~medicalwei/plainbox-provider-checkbox:fixed-screen-orientation-on-laptops
Merge into: plainbox-provider-checkbox:master
Diff against target: 67 lines (+41/-1)
3 files modified
bin/fixed_screen_orientation.sh (+22/-0)
units/input/jobs.pxu (+16/-0)
units/input/test-plan.pxu (+3/-1)
Reviewer Review Type Date Requested Status
Maciej Kisielewski (community) Approve
Kai-Chuan Hsieh Approve
Review via email: mp+408451@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote :

I think it is better to use template-filter to perform it on device with accel_3d sensor only.

review: Needs Fixing
Revision history for this message
Yao Wei (medicalwei) wrote :

The script "fixed_screen_orientation.sh" runs as follows:

ubuntu@machine:~$ ./fixed_screen_orientation.sh
E: DEVTYPE=iio_device
E: DEVTYPE=iio_device
E: DEVTYPE=iio_device
E: DEVTYPE=iio_device
Screen orientation check PASSED: Accelerometer is not enabled

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

Please also paste the failed output to here or paste bin. The rest looks good to me.

review: Approve
Revision history for this message
Yao Wei (medicalwei) wrote (last edit ):

This is the failed result from the machine with known issue. I cannot run the test job since the machine I have reports itself as a convertible while it is actually not, and this issue is reported to the manufacturer.

ubuntu@machine:~$ ./fixed_screen_orientation.sh

Screen orientation check FAILED:
this device has an accelerometer that needs to be disabled.
===
udevadm info /sys/bus/iio/devices/iio*
P: /devices/pci0000:00/0000:00:12.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8087:0AC2.0004/HID-SENSOR-INT-020b/iio:device0
N: iio:device0
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8087:0AC2.0004/HID-SENSOR-INT-020b/iio:device0
E: DEVNAME=/dev/iio:device0
E: DEVTYPE=iio_device
E: MAJOR=509
E: MINOR=0
E: SUBSYSTEM=iio

P: /devices/pci0000:00/0000:00:12.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8087:0AC2.0002/HID-SENSOR-200041.7.auto/iio:device1
N: iio:device1
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8087:0AC2.0002/HID-SENSOR-200041.7.auto/iio:device1
E: DEVNAME=/dev/iio:device1
E: DEVTYPE=iio_device
E: MAJOR=509
E: MINOR=1
E: SUBSYSTEM=iio
E: USEC_INITIALIZED=9216800
E: IIO_SENSOR_PROXY_TYPE=iio-poll-als iio-buffer-als
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:

P: /devices/pci0000:00/0000:00:12.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8087:0AC2.0005/HID-SENSOR-200076.28.auto/iio:device2
N: iio:device2
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8087:0AC2.0005/HID-SENSOR-200076.28.auto/iio:device2
E: DEVNAME=/dev/iio:device2
E: DEVTYPE=iio_device
E: MAJOR=509
E: MINOR=2
E: SUBSYSTEM=iio

P: /devices/pci0000:00/0000:00:12.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8087:0AC2.0004/HID-SENSOR-200073.26.auto/iio:device3
N: iio:device3
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8087:0AC2.0004/HID-SENSOR-200073.26.auto/iio:device3
E: DEVNAME=/dev/iio:device3
E: DEVTYPE=iio_device
E: MAJOR=509
E: MINOR=3
E: SUBSYSTEM=iio
E: USEC_INITIALIZED=9236113
E: IIO_SENSOR_PROXY_TYPE=iio-poll-accel iio-buffer-accel
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:

Revision history for this message
Maciej Kisielewski (kissiel) wrote :

LGTM, +1.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/fixed_screen_orientation.sh b/bin/fixed_screen_orientation.sh
0new file mode 1007550new file mode 100755
index 0000000..5fbe162
--- /dev/null
+++ b/bin/fixed_screen_orientation.sh
@@ -0,0 +1,22 @@
1#!/bin/sh
2if ! (udevadm info --export-db | grep -q iio_device); then
3 echo "Screen orientation check PASSED:"
4 echo "no iio_device found in this device, therefore rotation should not happen."
5 exit 0
6fi
7
8if dbus-send --system --print-reply --dest=net.hadess.SensorProxy \
9 /net/hadess/SensorProxy \
10 org.freedesktop.DBus.Properties.Get string:net.hadess.SensorProxy string:HasAccelerometer |
11 grep -q "boolean true"; then
12 echo "Screen orientation check FAILED:"
13 echo "this device has an accelerometer that needs to be disabled."
14 echo "==="
15 # list IIO devices for reference
16 echo "udevadm info /sys/bus/iio/devices/iio*"
17 udevadm info /sys/bus/iio/devices/iio*
18 exit 1
19fi
20
21echo "Screen orientation check PASSED:"
22echo "Accelerometer is not enabled."
diff --git a/units/input/jobs.pxu b/units/input/jobs.pxu
index 5f5cde0..7ae0667 100644
--- a/units/input/jobs.pxu
+++ b/units/input/jobs.pxu
@@ -75,3 +75,19 @@ _steps:
75 4. Double-click the left button with your {product}.75 4. Double-click the left button with your {product}.
76_verification:76_verification:
77 Did these buttons work as expected?77 Did these buttons work as expected?
78
79unit: template
80template-resource: dmi
81template-filter: dmi.category == 'CHASSIS' and dmi.product not in ('Tablet', 'Convertible', 'Detachable')
82plugin: shell
83category_id: com.canonical.plainbox::input
84estimated_duration: 2
85id: input/fixed_screen_orientation_on_{product}_{__index__}
86user: root
87requires:
88 executable.name == 'udevadm'
89 executable.name == 'dbus-send'
90command: fixed_screen_orientation.sh
91_summary: Check whether screen orientation is fixed on {product}
92_purpose:
93 This tests whether the display orientation of {product} is fixed, and cannot be altered by tilting {product}.
diff --git a/units/input/test-plan.pxu b/units/input/test-plan.pxu
index ef9cf75..1c87d1f 100644
--- a/units/input/test-plan.pxu
+++ b/units/input/test-plan.pxu
@@ -23,7 +23,9 @@ _name: Input tests (Automated)
23_description:23_description:
24 Input tests (Automated)24 Input tests (Automated)
25include:25include:
2626 input/fixed_screen_orientation_on_.* certification-status=non-blocker
27bootstrap_include:
28 dmi
2729
28id: after-suspend-input-cert-full30id: after-suspend-input-cert-full
29unit: test plan31unit: test plan

Subscribers

People subscribed via source and target branches