summaryrefslogtreecommitdiff
diff options
authorUbuntu <ubuntu@cert-jenkins-slave-1-201406-15260.maas>2021-09-30 11:15:45 +0000
committerUbuntu <ubuntu@cert-jenkins-slave-1-201406-15260.maas>2021-09-30 11:15:45 +0000
commit966f0c29d2ed660dda7a2ca5eedfd61bf3d1c7e1 (patch)
tree842fc3ca2d38c4f32007371c7a20a348d768771f
parent792410e6aefcd3488d5e4796df340182498908e8 (diff)
parentf33feb02a56471e8ea605cabc2d698a40890af6f (diff)
Merge #408451 from ~medicalwei/plainbox-provider-checkbox:fixed-screen-orientation-on-laptops
-rwxr-xr-xbin/fixed_screen_orientation.sh22
-rw-r--r--units/input/jobs.pxu16
-rw-r--r--units/input/test-plan.pxu4
3 files changed, 41 insertions, 1 deletions
diff --git a/bin/fixed_screen_orientation.sh b/bin/fixed_screen_orientation.sh
new file mode 100755
index 0000000..5fbe162
--- /dev/null
+++ b/bin/fixed_screen_orientation.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+if ! (udevadm info --export-db | grep -q iio_device); then
+ echo "Screen orientation check PASSED:"
+ echo "no iio_device found in this device, therefore rotation should not happen."
+ exit 0
+fi
+
+if dbus-send --system --print-reply --dest=net.hadess.SensorProxy \
+ /net/hadess/SensorProxy \
+ org.freedesktop.DBus.Properties.Get string:net.hadess.SensorProxy string:HasAccelerometer |
+ grep -q "boolean true"; then
+ echo "Screen orientation check FAILED:"
+ echo "this device has an accelerometer that needs to be disabled."
+ echo "==="
+ # list IIO devices for reference
+ echo "udevadm info /sys/bus/iio/devices/iio*"
+ udevadm info /sys/bus/iio/devices/iio*
+ exit 1
+fi
+
+echo "Screen orientation check PASSED:"
+echo "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:
4. Double-click the left button with your {product}.
_verification:
Did these buttons work as expected?
+
+unit: template
+template-resource: dmi
+template-filter: dmi.category == 'CHASSIS' and dmi.product not in ('Tablet', 'Convertible', 'Detachable')
+plugin: shell
+category_id: com.canonical.plainbox::input
+estimated_duration: 2
+id: input/fixed_screen_orientation_on_{product}_{__index__}
+user: root
+requires:
+ executable.name == 'udevadm'
+ executable.name == 'dbus-send'
+command: fixed_screen_orientation.sh
+_summary: Check whether screen orientation is fixed on {product}
+_purpose:
+ 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)
_description:
Input tests (Automated)
include:
-
+ input/fixed_screen_orientation_on_.* certification-status=non-blocker
+bootstrap_include:
+ dmi
id: after-suspend-input-cert-full
unit: test plan