summaryrefslogtreecommitdiff
diff options
authorMichael Vogt <mvo@ubuntu.com>2022-06-20 11:23:44 +0200
committerGitHub <noreply@github.com>2022-06-20 11:23:44 +0200
commit579463494ab1ff05fc60e6e23c43607c663b42dc (patch)
tree7d3280d03a09cb24f17200c49ac66f0265ebe0ee
parent36c99954c5a420937e69212744cb4e6a396334bf (diff)
parent37bed2a6d61ddee0de4c8dc9ed219c97201d9a99 (diff)
Merge pull request #11877 from sergiocazzolato/tests-fix-mount-order-regression-arm
tests: enable mount-order-regression test for arm devices
-rw-r--r--tests/regression/mount-order-regression/task.yaml54
-rwxr-xr-xtests/regression/mount-order-regression/test-content-layout-consumer-amd64/bin/cmd (renamed from tests/regression/mount-order-regression/test-content-layout-consumer/bin/cmd)0
-rw-r--r--tests/regression/mount-order-regression/test-content-layout-consumer-amd64/meta/snap.yaml (renamed from tests/regression/mount-order-regression/test-content-layout-consumer/meta/snap.yaml)2
-rwxr-xr-xtests/regression/mount-order-regression/test-content-layout-consumer-arm64/bin/cmd2
-rw-r--r--tests/regression/mount-order-regression/test-content-layout-consumer-arm64/meta/snap.yaml37
-rwxr-xr-xtests/regression/mount-order-regression/test-content-layout-consumer-armhf/bin/cmd2
-rw-r--r--tests/regression/mount-order-regression/test-content-layout-consumer-armhf/meta/snap.yaml37
7 files changed, 119 insertions, 15 deletions
diff --git a/tests/regression/mount-order-regression/task.yaml b/tests/regression/mount-order-regression/task.yaml
index 8e4594d46f..c4080eb38c 100644
--- a/tests/regression/mount-order-regression/task.yaml
+++ b/tests/regression/mount-order-regression/task.yaml
@@ -11,25 +11,42 @@ systems:
- -ubuntu-core-16-32
- -ubuntu-core-18-32
-environment:
- SNAP_NAME: test-content-layout-consumer
-
prepare: |
+ if os.query is-arm64; then
+ SNAP_NAME=test-content-layout-consumer-arm64
+ elif os.query is-armhf; then
+ SNAP_NAME=test-content-layout-consumer-armhf
+ else
+ SNAP_NAME=test-content-layout-consumer-amd64
+ fi
+
# Create mount points for the content interface (we would like to have them
# in the repository, but git does not allow storing empty directories)
mkdir -p "$SNAP_NAME/gnome-platform"
mkdir -p "$SNAP_NAME/data-dir/themes"
mkdir -p "$SNAP_NAME/data-dir/icons"
mkdir -p "$SNAP_NAME/data-dir/sounds"
- "$TESTSTOOLS"/snaps-state install-local $SNAP_NAME
+
+ "$TESTSTOOLS"/snaps-state install-local "$SNAP_NAME"
execute: |
check_non_empty() {
local DIR="$1"
echo "Checking $DIR"
- test "$($SNAP_NAME.cmd ls -1 "$DIR" 2> /dev/null | wc -l)" -gt 0
+ test "$("$SNAP_NAME.cmd" ls -1 "$DIR" 2> /dev/null | wc -l)" -gt 0
}
+ if os.query is-arm64; then
+ SNAP_NAME=test-content-layout-consumer-arm64
+ LINUX_GNU_NAME=aarch64-linux-gnu
+ elif os.query is-armhf; then
+ SNAP_NAME=test-content-layout-consumer-armhf
+ LINUX_GNU_NAME=arm-linux-gnueabihf
+ else
+ SNAP_NAME=test-content-layout-consumer-amd64
+ LINUX_GNU_NAME=x86_64-linux-gnu
+ fi
+
# Check a handful of directories that should have been bind-mounted from
# the content snap (all those starting with "$SNAP/"), plus the directories
# that have been added via the layouts.
@@ -40,12 +57,12 @@ execute: |
done <<-EOF
$SNAP/gnome-platform/etc/X11/Xsession.d
$SNAP/gnome-platform/lib/udev/rules.d
- $SNAP/gnome-platform/lib/x86_64-linux-gnu
+ $SNAP/gnome-platform/lib/$LINUX_GNU_NAME
$SNAP/gnome-platform/usr/lib/python3/dist-packages/gi/overrides
$SNAP/gnome-platform/usr/lib/systemd/user
- $SNAP/gnome-platform/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules
- $SNAP/gnome-platform/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0
- $SNAP/gnome-platform/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/injected-bundle
+ $SNAP/gnome-platform/usr/lib/$LINUX_GNU_NAME/gtk-3.0/3.0.0/immodules
+ $SNAP/gnome-platform/usr/lib/$LINUX_GNU_NAME/webkit2gtk-4.0
+ $SNAP/gnome-platform/usr/lib/$LINUX_GNU_NAME/webkit2gtk-4.0/injected-bundle
$SNAP/gnome-platform/usr/share/X11/locale/C
$SNAP/gnome-platform/usr/share/glib-2.0/schemas
$SNAP/gnome-platform/usr/share/gnome-control-center
@@ -54,12 +71,21 @@ execute: |
$SNAP/data-dir/themes/Yaru/gtk-3.0
$SNAP/data-dir/icons
$SNAP/data-dir/sounds
- /usr/lib/x86_64-linux-gnu/webkit2gtk-4.0
- /usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/injected-bundle
- /usr/share/xml/iso-codes
EOF
- # We already know that /lib/x86_64-linux-gnu is not empty, since it comes
+ if os.query is-amd64; then
+ check_non_empty /usr/lib/$LINUX_GNU_NAME/webkit2gtk-4.0
+ check_non_empty/usr/lib/$LINUX_GNU_NAME/webkit2gtk-4.0/injected-bundle
+ check_non_empty /usr/share/xml/iso-codes
+ fi
+
+ # We already know that /lib/$LINUX_GNU_NAME is not empty, since it comes
# from the base snap; so, here we check the existence of a specific file we
# bind-mounted using the layout directive.
- $SNAP_NAME.cmd test -f /lib/x86_64-linux-gnu/bindtextdomain.so
+ if os.query is-arm64; then
+ $SNAP_NAME.cmd test -f /lib/$LINUX_GNU_NAME/libSegFault.so
+ elif os.query is-armhf; then
+ $SNAP_NAME.cmd test -f /lib/$LINUX_GNU_NAME/libSegFault.so
+ else
+ $SNAP_NAME.cmd test -f /lib/$LINUX_GNU_NAME/bindtextdomain.so
+ fi
diff --git a/tests/regression/mount-order-regression/test-content-layout-consumer/bin/cmd b/tests/regression/mount-order-regression/test-content-layout-consumer-amd64/bin/cmd
index ee708187ee..ee708187ee 100755
--- a/tests/regression/mount-order-regression/test-content-layout-consumer/bin/cmd
+++ b/tests/regression/mount-order-regression/test-content-layout-consumer-amd64/bin/cmd
diff --git a/tests/regression/mount-order-regression/test-content-layout-consumer/meta/snap.yaml b/tests/regression/mount-order-regression/test-content-layout-consumer-amd64/meta/snap.yaml
index 70b4b5d98e..44321ff7aa 100644
--- a/tests/regression/mount-order-regression/test-content-layout-consumer/meta/snap.yaml
+++ b/tests/regression/mount-order-regression/test-content-layout-consumer-amd64/meta/snap.yaml
@@ -1,4 +1,4 @@
-name: test-content-layout-consumer
+name: test-content-layout-consumer-amd64
version: 1.0
apps:
cmd:
diff --git a/tests/regression/mount-order-regression/test-content-layout-consumer-arm64/bin/cmd b/tests/regression/mount-order-regression/test-content-layout-consumer-arm64/bin/cmd
new file mode 100755
index 0000000000..ee708187ee
--- /dev/null
+++ b/tests/regression/mount-order-regression/test-content-layout-consumer-arm64/bin/cmd
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec "$@"
diff --git a/tests/regression/mount-order-regression/test-content-layout-consumer-arm64/meta/snap.yaml b/tests/regression/mount-order-regression/test-content-layout-consumer-arm64/meta/snap.yaml
new file mode 100644
index 0000000000..c85e5c7db2
--- /dev/null
+++ b/tests/regression/mount-order-regression/test-content-layout-consumer-arm64/meta/snap.yaml
@@ -0,0 +1,37 @@
+name: test-content-layout-consumer-arm64
+version: 1.0
+apps:
+ cmd:
+ command: bin/cmd
+ plugs:
+ - desktop
+ - desktop-legacy
+ - gsettings
+ - opengl
+ - wayland
+ - x11
+ - home
+base: core18
+
+layout:
+ /lib/aarch64-linux-gnu/libSegFault.so:
+ bind-file: $SNAP/gnome-platform/lib/aarch64-linux-gnu/libSegFault.so
+ /usr/lib/x86_64-linux-gnu/libSegFault.so:
+ bind: $SNAP/gnome-platform/usr/lib/aarch64-linux-gnu/libSegFault.so
+plugs:
+ gnome-3-38-2004:
+ interface: content
+ target: $SNAP/gnome-platform
+ default-provider: gnome-3-38-2004
+ gtk-3-themes:
+ interface: content
+ target: $SNAP/data-dir/themes
+ default-provider: gtk-common-themes
+ icon-themes:
+ interface: content
+ target: $SNAP/data-dir/icons
+ default-provider: gtk-common-themes
+ sound-themes:
+ interface: content
+ target: $SNAP/data-dir/sounds
+ default-provider: gtk-common-themes
diff --git a/tests/regression/mount-order-regression/test-content-layout-consumer-armhf/bin/cmd b/tests/regression/mount-order-regression/test-content-layout-consumer-armhf/bin/cmd
new file mode 100755
index 0000000000..ee708187ee
--- /dev/null
+++ b/tests/regression/mount-order-regression/test-content-layout-consumer-armhf/bin/cmd
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec "$@"
diff --git a/tests/regression/mount-order-regression/test-content-layout-consumer-armhf/meta/snap.yaml b/tests/regression/mount-order-regression/test-content-layout-consumer-armhf/meta/snap.yaml
new file mode 100644
index 0000000000..33aed83f68
--- /dev/null
+++ b/tests/regression/mount-order-regression/test-content-layout-consumer-armhf/meta/snap.yaml
@@ -0,0 +1,37 @@
+name: test-content-layout-consumer-armhf
+version: 1.0
+apps:
+ cmd:
+ command: bin/cmd
+ plugs:
+ - desktop
+ - desktop-legacy
+ - gsettings
+ - opengl
+ - wayland
+ - x11
+ - home
+base: core18
+
+layout:
+ /lib/arm-linux-gnueabihf/libSegFault.so:
+ bind-file: $SNAP/gnome-platform/lib/arm-linux-gnueabihf/libSegFault.so
+ /usr/lib/arm-linux-gnueabihf/libSegFault.so:
+ bind: $SNAP/gnome-platform/usr/lib/arm-linux-gnueabihf/libSegFault.so
+plugs:
+ gnome-3-38-2004:
+ interface: content
+ target: $SNAP/gnome-platform
+ default-provider: gnome-3-38-2004
+ gtk-3-themes:
+ interface: content
+ target: $SNAP/data-dir/themes
+ default-provider: gtk-common-themes
+ icon-themes:
+ interface: content
+ target: $SNAP/data-dir/icons
+ default-provider: gtk-common-themes
+ sound-themes:
+ interface: content
+ target: $SNAP/data-dir/sounds
+ default-provider: gtk-common-themes