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 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
1diff --git a/bin/fixed_screen_orientation.sh b/bin/fixed_screen_orientation.sh
2new file mode 100755
3index 0000000..5fbe162
4--- /dev/null
5+++ b/bin/fixed_screen_orientation.sh
6@@ -0,0 +1,22 @@
7+#!/bin/sh
8+if ! (udevadm info --export-db | grep -q iio_device); then
9+ echo "Screen orientation check PASSED:"
10+ echo "no iio_device found in this device, therefore rotation should not happen."
11+ exit 0
12+fi
13+
14+if dbus-send --system --print-reply --dest=net.hadess.SensorProxy \
15+ /net/hadess/SensorProxy \
16+ org.freedesktop.DBus.Properties.Get string:net.hadess.SensorProxy string:HasAccelerometer |
17+ grep -q "boolean true"; then
18+ echo "Screen orientation check FAILED:"
19+ echo "this device has an accelerometer that needs to be disabled."
20+ echo "==="
21+ # list IIO devices for reference
22+ echo "udevadm info /sys/bus/iio/devices/iio*"
23+ udevadm info /sys/bus/iio/devices/iio*
24+ exit 1
25+fi
26+
27+echo "Screen orientation check PASSED:"
28+echo "Accelerometer is not enabled."
29diff --git a/units/input/jobs.pxu b/units/input/jobs.pxu
30index 5f5cde0..7ae0667 100644
31--- a/units/input/jobs.pxu
32+++ b/units/input/jobs.pxu
33@@ -75,3 +75,19 @@ _steps:
34 4. Double-click the left button with your {product}.
35 _verification:
36 Did these buttons work as expected?
37+
38+unit: template
39+template-resource: dmi
40+template-filter: dmi.category == 'CHASSIS' and dmi.product not in ('Tablet', 'Convertible', 'Detachable')
41+plugin: shell
42+category_id: com.canonical.plainbox::input
43+estimated_duration: 2
44+id: input/fixed_screen_orientation_on_{product}_{__index__}
45+user: root
46+requires:
47+ executable.name == 'udevadm'
48+ executable.name == 'dbus-send'
49+command: fixed_screen_orientation.sh
50+_summary: Check whether screen orientation is fixed on {product}
51+_purpose:
52+ This tests whether the display orientation of {product} is fixed, and cannot be altered by tilting {product}.
53diff --git a/units/input/test-plan.pxu b/units/input/test-plan.pxu
54index ef9cf75..1c87d1f 100644
55--- a/units/input/test-plan.pxu
56+++ b/units/input/test-plan.pxu
57@@ -23,7 +23,9 @@ _name: Input tests (Automated)
58 _description:
59 Input tests (Automated)
60 include:
61-
62+ input/fixed_screen_orientation_on_.* certification-status=non-blocker
63+bootstrap_include:
64+ dmi
65
66 id: after-suspend-input-cert-full
67 unit: test plan

Subscribers

People subscribed via source and target branches