From 6f0f7d1b40a8fa8d46a2d6f4317600001cdbbb18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:57:27 +0200 Subject: Adding upstream version 43.5. Signed-off-by: Daniel Baumann --- .../flatpak/tests/app-extension-update/.gitignore | 1 + .../org.test.Chiron.Extension/.gitignore | 1 + .../org.test.Chiron.Extension/files/.empty | 0 .../files/share/libtest/README | 1 + .../org.test.Chiron.Extension.metainfo.xml | 12 ++ .../org.test.Chiron.Extension/metadata | 6 + plugins/flatpak/tests/app-extension/.gitignore | 1 + .../org.test.Chiron.Extension/.gitignore | 1 + .../org.test.Chiron.Extension/files/.empty | 0 .../files/share/libtest/README | 0 .../org.test.Chiron.Extension.metainfo.xml | 12 ++ .../org.test.Chiron.Extension/metadata | 6 + .../tests/app-extension/org.test.Chiron/.gitignore | 2 + .../org.test.Chiron/files/bin/chiron.sh | 2 + .../share/appdata/org.test.Chiron.appdata.xml | 16 +++ .../share/applications/org.test.Chiron.desktop | 6 + .../icons/hicolor/128x128/apps/org.test.Chiron.png | Bin 0 -> 334 bytes .../tests/app-extension/org.test.Chiron/metadata | 10 ++ .../flatpak/tests/app-missing-runtime/.gitignore | 1 + .../tests/app-missing-runtime/org.test.Chiron | 1 + plugins/flatpak/tests/app-update/.gitignore | 1 + .../tests/app-update/org.test.Chiron/.gitignore | 2 + .../app-update/org.test.Chiron/files/bin/chiron.sh | 2 + .../share/appdata/org.test.Chiron.appdata.xml | 19 ++++ .../share/applications/org.test.Chiron.desktop | 1 + .../icons/hicolor/128x128/apps/org.test.Chiron.png | 1 + .../tests/app-update/org.test.Chiron/metadata | 4 + plugins/flatpak/tests/app-with-runtime/.gitignore | 1 + .../app-with-runtime/org.test.Chiron/.gitignore | 2 + .../org.test.Chiron/files/bin/chiron.sh | 2 + .../share/appdata/org.test.Chiron.appdata.xml | 16 +++ .../share/applications/org.test.Chiron.desktop | 7 ++ .../icons/hicolor/128x128/apps/org.test.Chiron.png | Bin 0 -> 334 bytes .../app-with-runtime/org.test.Chiron/metadata | 4 + .../app-with-runtime/org.test.Runtime/files/.empty | 0 .../app-with-runtime/org.test.Runtime/metadata | 3 + .../org.test.Runtime/usr/.gitignore | 1 + .../org.test.Runtime/usr/share/libtest/README | 0 .../share/metainfo/org.test.Runtime.metainfo.xml | 10 ++ plugins/flatpak/tests/build.py | 125 +++++++++++++++++++++ plugins/flatpak/tests/chiron.flatpak | Bin 0 -> 5452 bytes plugins/flatpak/tests/flatpakrepos.tar.gz | Bin 0 -> 72252 bytes plugins/flatpak/tests/meson.build | 34 ++++++ plugins/flatpak/tests/only-runtime/.gitignore | 1 + .../flatpak/tests/only-runtime/org.test.Runtime | 1 + 45 files changed, 316 insertions(+) create mode 100644 plugins/flatpak/tests/app-extension-update/.gitignore create mode 100644 plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/.gitignore create mode 100644 plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/.empty create mode 100644 plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/libtest/README create mode 100644 plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml create mode 100644 plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/metadata create mode 100644 plugins/flatpak/tests/app-extension/.gitignore create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/.gitignore create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/.empty create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/libtest/README create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/metadata create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron/.gitignore create mode 100755 plugins/flatpak/tests/app-extension/org.test.Chiron/files/bin/chiron.sh create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/applications/org.test.Chiron.desktop create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png create mode 100644 plugins/flatpak/tests/app-extension/org.test.Chiron/metadata create mode 100644 plugins/flatpak/tests/app-missing-runtime/.gitignore create mode 120000 plugins/flatpak/tests/app-missing-runtime/org.test.Chiron create mode 100644 plugins/flatpak/tests/app-update/.gitignore create mode 100644 plugins/flatpak/tests/app-update/org.test.Chiron/.gitignore create mode 100644 plugins/flatpak/tests/app-update/org.test.Chiron/files/bin/chiron.sh create mode 100644 plugins/flatpak/tests/app-update/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml create mode 120000 plugins/flatpak/tests/app-update/org.test.Chiron/files/share/applications/org.test.Chiron.desktop create mode 120000 plugins/flatpak/tests/app-update/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png create mode 100644 plugins/flatpak/tests/app-update/org.test.Chiron/metadata create mode 100644 plugins/flatpak/tests/app-with-runtime/.gitignore create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Chiron/.gitignore create mode 100755 plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/bin/chiron.sh create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/applications/org.test.Chiron.desktop create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Chiron/metadata create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Runtime/files/.empty create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Runtime/metadata create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/.gitignore create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/libtest/README create mode 100644 plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/metainfo/org.test.Runtime.metainfo.xml create mode 100755 plugins/flatpak/tests/build.py create mode 100644 plugins/flatpak/tests/chiron.flatpak create mode 100644 plugins/flatpak/tests/flatpakrepos.tar.gz create mode 100644 plugins/flatpak/tests/meson.build create mode 100644 plugins/flatpak/tests/only-runtime/.gitignore create mode 120000 plugins/flatpak/tests/only-runtime/org.test.Runtime (limited to 'plugins/flatpak/tests') diff --git a/plugins/flatpak/tests/app-extension-update/.gitignore b/plugins/flatpak/tests/app-extension-update/.gitignore new file mode 100644 index 0000000..f606d5e --- /dev/null +++ b/plugins/flatpak/tests/app-extension-update/.gitignore @@ -0,0 +1 @@ +repo diff --git a/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/.gitignore b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/.gitignore new file mode 100644 index 0000000..db00ec8 --- /dev/null +++ b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/.gitignore @@ -0,0 +1 @@ +files/share/app-info diff --git a/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/.empty b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/.empty new file mode 100644 index 0000000..e69de29 diff --git a/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/libtest/README b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/libtest/README new file mode 100644 index 0000000..a0b9703 --- /dev/null +++ b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/libtest/README @@ -0,0 +1 @@ +UPDATED! \ No newline at end of file diff --git a/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml new file mode 100644 index 0000000..d884539 --- /dev/null +++ b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml @@ -0,0 +1,12 @@ + + + + org.test.Chiron.Extension + CC0 + GPL-2.0+ + Chiron App Extension + Test extension for flatpak self tests + + diff --git a/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/metadata b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/metadata new file mode 100644 index 0000000..d81f8f9 --- /dev/null +++ b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/metadata @@ -0,0 +1,6 @@ +[Runtime] +name=org.test.Chiron.Extension +sdk=org.test.Runtime/x86_64/master + +[ExtensionOf] +ref=app/org.test.Chiron/x86_64/master diff --git a/plugins/flatpak/tests/app-extension/.gitignore b/plugins/flatpak/tests/app-extension/.gitignore new file mode 100644 index 0000000..f606d5e --- /dev/null +++ b/plugins/flatpak/tests/app-extension/.gitignore @@ -0,0 +1 @@ +repo diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/.gitignore b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/.gitignore new file mode 100644 index 0000000..db00ec8 --- /dev/null +++ b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/.gitignore @@ -0,0 +1 @@ +files/share/app-info diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/.empty b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/.empty new file mode 100644 index 0000000..e69de29 diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/libtest/README b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/libtest/README new file mode 100644 index 0000000..e69de29 diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml new file mode 100644 index 0000000..d884539 --- /dev/null +++ b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml @@ -0,0 +1,12 @@ + + + + org.test.Chiron.Extension + CC0 + GPL-2.0+ + Chiron App Extension + Test extension for flatpak self tests + + diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/metadata b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/metadata new file mode 100644 index 0000000..d81f8f9 --- /dev/null +++ b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/metadata @@ -0,0 +1,6 @@ +[Runtime] +name=org.test.Chiron.Extension +sdk=org.test.Runtime/x86_64/master + +[ExtensionOf] +ref=app/org.test.Chiron/x86_64/master diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron/.gitignore b/plugins/flatpak/tests/app-extension/org.test.Chiron/.gitignore new file mode 100644 index 0000000..fea15c0 --- /dev/null +++ b/plugins/flatpak/tests/app-extension/org.test.Chiron/.gitignore @@ -0,0 +1,2 @@ +export +files/share/app-info diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron/files/bin/chiron.sh b/plugins/flatpak/tests/app-extension/org.test.Chiron/files/bin/chiron.sh new file mode 100755 index 0000000..e61d501 --- /dev/null +++ b/plugins/flatpak/tests/app-extension/org.test.Chiron/files/bin/chiron.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Hello world" diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml b/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml new file mode 100644 index 0000000..0d912a8 --- /dev/null +++ b/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml @@ -0,0 +1,16 @@ + + + + org.test.Chiron.desktop + CC0-1.0 + GPL-2.0+ + Chiron + Single line synopsis +

Long description.

+ http://127.0.0.1/ + + +

This is better.

+
+
+
diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/applications/org.test.Chiron.desktop b/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/applications/org.test.Chiron.desktop new file mode 100644 index 0000000..2fbdf95 --- /dev/null +++ b/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/applications/org.test.Chiron.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Application +Name=Chiron +Exec=chiron.sh +Icon=org.test.Chiron +Keywords=Bingo; diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png b/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png new file mode 100644 index 0000000..0c38f2f Binary files /dev/null and b/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png differ diff --git a/plugins/flatpak/tests/app-extension/org.test.Chiron/metadata b/plugins/flatpak/tests/app-extension/org.test.Chiron/metadata new file mode 100644 index 0000000..45b76d6 --- /dev/null +++ b/plugins/flatpak/tests/app-extension/org.test.Chiron/metadata @@ -0,0 +1,10 @@ +[Application] +name=org.test.Chiron +runtime=org.test.Runtime/x86_64/master +command=chiron.sh + +[Extension org.test.Chiron.Extension] +directory=share/extension +subdirectories=true +version=master +autodelete=true diff --git a/plugins/flatpak/tests/app-missing-runtime/.gitignore b/plugins/flatpak/tests/app-missing-runtime/.gitignore new file mode 100644 index 0000000..f606d5e --- /dev/null +++ b/plugins/flatpak/tests/app-missing-runtime/.gitignore @@ -0,0 +1 @@ +repo diff --git a/plugins/flatpak/tests/app-missing-runtime/org.test.Chiron b/plugins/flatpak/tests/app-missing-runtime/org.test.Chiron new file mode 120000 index 0000000..d9384e4 --- /dev/null +++ b/plugins/flatpak/tests/app-missing-runtime/org.test.Chiron @@ -0,0 +1 @@ +../app-with-runtime/org.test.Chiron/ \ No newline at end of file diff --git a/plugins/flatpak/tests/app-update/.gitignore b/plugins/flatpak/tests/app-update/.gitignore new file mode 100644 index 0000000..f606d5e --- /dev/null +++ b/plugins/flatpak/tests/app-update/.gitignore @@ -0,0 +1 @@ +repo diff --git a/plugins/flatpak/tests/app-update/org.test.Chiron/.gitignore b/plugins/flatpak/tests/app-update/org.test.Chiron/.gitignore new file mode 100644 index 0000000..fea15c0 --- /dev/null +++ b/plugins/flatpak/tests/app-update/org.test.Chiron/.gitignore @@ -0,0 +1,2 @@ +export +files/share/app-info diff --git a/plugins/flatpak/tests/app-update/org.test.Chiron/files/bin/chiron.sh b/plugins/flatpak/tests/app-update/org.test.Chiron/files/bin/chiron.sh new file mode 100644 index 0000000..dfed21c --- /dev/null +++ b/plugins/flatpak/tests/app-update/org.test.Chiron/files/bin/chiron.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Hello world, with upgrades" diff --git a/plugins/flatpak/tests/app-update/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml b/plugins/flatpak/tests/app-update/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml new file mode 100644 index 0000000..74eb9db --- /dev/null +++ b/plugins/flatpak/tests/app-update/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml @@ -0,0 +1,19 @@ + + + + org.test.Chiron + CC0-1.0 + GPL-2.0+ + Chiron + Single line synopsis +

Long description.

+ http://127.0.0.1/ + + +

This is best.

+
+ +

This is better.

+
+
+
diff --git a/plugins/flatpak/tests/app-update/org.test.Chiron/files/share/applications/org.test.Chiron.desktop b/plugins/flatpak/tests/app-update/org.test.Chiron/files/share/applications/org.test.Chiron.desktop new file mode 120000 index 0000000..2b06818 --- /dev/null +++ b/plugins/flatpak/tests/app-update/org.test.Chiron/files/share/applications/org.test.Chiron.desktop @@ -0,0 +1 @@ +../../../../../app-missing-runtime/org.test.Chiron/files/share/applications/org.test.Chiron.desktop \ No newline at end of file diff --git a/plugins/flatpak/tests/app-update/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png b/plugins/flatpak/tests/app-update/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png new file mode 120000 index 0000000..9c37986 --- /dev/null +++ b/plugins/flatpak/tests/app-update/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png @@ -0,0 +1 @@ +../../../../../../../../app-missing-runtime/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png \ No newline at end of file diff --git a/plugins/flatpak/tests/app-update/org.test.Chiron/metadata b/plugins/flatpak/tests/app-update/org.test.Chiron/metadata new file mode 100644 index 0000000..1de0ab8 --- /dev/null +++ b/plugins/flatpak/tests/app-update/org.test.Chiron/metadata @@ -0,0 +1,4 @@ +[Application] +name=org.test.Chiron +runtime=org.test.Runtime/x86_64/new_master +command=chiron.sh diff --git a/plugins/flatpak/tests/app-with-runtime/.gitignore b/plugins/flatpak/tests/app-with-runtime/.gitignore new file mode 100644 index 0000000..f606d5e --- /dev/null +++ b/plugins/flatpak/tests/app-with-runtime/.gitignore @@ -0,0 +1 @@ +repo diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/.gitignore b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/.gitignore new file mode 100644 index 0000000..fea15c0 --- /dev/null +++ b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/.gitignore @@ -0,0 +1,2 @@ +export +files/share/app-info diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/bin/chiron.sh b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/bin/chiron.sh new file mode 100755 index 0000000..e61d501 --- /dev/null +++ b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/bin/chiron.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Hello world" diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml new file mode 100644 index 0000000..58af082 --- /dev/null +++ b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml @@ -0,0 +1,16 @@ + + + + org.test.Chiron + CC0-1.0 + GPL-2.0+ + Chiron + Single line synopsis +

Long description.

+ http://127.0.0.1/ + + +

This is better.

+
+
+
diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/applications/org.test.Chiron.desktop b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/applications/org.test.Chiron.desktop new file mode 100644 index 0000000..b744766 --- /dev/null +++ b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/applications/org.test.Chiron.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=Chiron +Exec=chiron.sh +Icon=org.test.Chiron +Keywords=Bingo; +X-Flatpak=org.test.Chiron diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png new file mode 100644 index 0000000..0c38f2f Binary files /dev/null and b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png differ diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/metadata b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/metadata new file mode 100644 index 0000000..ce57357 --- /dev/null +++ b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/metadata @@ -0,0 +1,4 @@ +[Application] +name=org.test.Chiron +runtime=org.test.Runtime/x86_64/master +command=chiron.sh diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/files/.empty b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/files/.empty new file mode 100644 index 0000000..e69de29 diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/metadata b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/metadata new file mode 100644 index 0000000..16f0fa1 --- /dev/null +++ b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/metadata @@ -0,0 +1,3 @@ +[Runtime] +name=org.test.Runtime +sdk=org.test.Runtime/x86_64/master diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/.gitignore b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/.gitignore new file mode 100644 index 0000000..3600b9c --- /dev/null +++ b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/.gitignore @@ -0,0 +1 @@ +app-info diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/libtest/README b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/libtest/README new file mode 100644 index 0000000..e69de29 diff --git a/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/metainfo/org.test.Runtime.metainfo.xml b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/metainfo/org.test.Runtime.metainfo.xml new file mode 100644 index 0000000..5d68c60 --- /dev/null +++ b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/metainfo/org.test.Runtime.metainfo.xml @@ -0,0 +1,10 @@ + + + + org.test.Runtime + CC0 + GPL-2.0+ + Test runtime + Test runtime for flatpak self tests + + diff --git a/plugins/flatpak/tests/build.py b/plugins/flatpak/tests/build.py new file mode 100755 index 0000000..6c6a8dd --- /dev/null +++ b/plugins/flatpak/tests/build.py @@ -0,0 +1,125 @@ +#!/usr/bin/python3 + +import subprocess +import os +import shutil +import configparser + +def build_flatpak(appid, srcdir, repodir, branch='master', cleanrepodir=True): + print('Building %s from %s into %s' % (appid, srcdir, repodir)) + + # delete repodir + if cleanrepodir and os.path.exists(repodir): + print("Deleting %s" % repodir) + shutil.rmtree(repodir) + + # delete exportdir + exportdir = os.path.join(srcdir, appid, 'export') + if os.path.exists(exportdir): + print("Deleting %s" % exportdir) + shutil.rmtree(exportdir) + + metadata_path = os.path.join(srcdir, appid, 'metadata') + metadata = configparser.ConfigParser() + metadata.read(metadata_path) + is_runtime = True if 'Runtime' in metadata.sections() else False + is_extension = True if 'ExtensionOf' in metadata.sections() else False + + # runtimes have different defaults + if is_runtime and not is_extension: + prefix = 'usr' + else: + prefix = 'files' + + # finish the build + argv = ['flatpak', 'build-finish'] + argv.append(os.path.join(srcdir, appid)) + subprocess.call(argv) + + # compose AppStream data + argv = ['appstream-compose'] + argv.append('--origin=flatpak') + argv.append('--basename=%s' % appid) + argv.append('--prefix=%s' % os.path.join(srcdir, appid, prefix)) + argv.append('--output-dir=%s' % os.path.join(srcdir, appid, prefix, 'share/app-info/xmls')) + argv.append(appid) + subprocess.call(argv) + + # export into repo + argv = ['flatpak', 'build-export'] + argv.append(repodir) + argv.append(os.path.join(srcdir, appid)) + argv.append(branch) + argv.append('--update-appstream') + argv.append('--timestamp=2016-09-15T01:02:03') + if is_runtime: + argv.append('--runtime') + subprocess.call(argv) + +def build_flatpak_bundle(appid, srcdir, repodir, filename, branch='master'): + argv = ['flatpak', 'build-bundle'] + argv.append(repodir) + argv.append(filename) + argv.append(appid) + argv.append(branch) + subprocess.call(argv) + +def copy_repo(srcdir, destdir): + srcdir_repo = os.path.join(srcdir, 'repo') + destdir_repo = os.path.join(destdir, 'repo') + print("Copying %s to %s" % (srcdir_repo, destdir_repo)) + if os.path.exists(destdir_repo): + shutil.rmtree(destdir_repo) + shutil.copytree(srcdir_repo, destdir_repo) + +# normal app with runtime in same remote +build_flatpak('org.test.Chiron', + 'app-with-runtime', + 'app-with-runtime/repo') +build_flatpak('org.test.Runtime', + 'app-with-runtime', + 'app-with-runtime/repo', + cleanrepodir=False) + +# build a flatpak bundle for the app +build_flatpak_bundle('org.test.Chiron', + 'app-with-runtime', + 'app-with-runtime/repo', + 'chiron.flatpak') + +# app referencing runtime that cannot be found +build_flatpak('org.test.Chiron', + 'app-with-runtime', + 'app-missing-runtime/repo') + +# app with an update +build_flatpak('org.test.Runtime', + 'app-with-runtime', + 'app-update/repo', + branch='new_master', + cleanrepodir=True) +build_flatpak('org.test.Chiron', + 'app-update', + 'app-update/repo', + cleanrepodir=False) + +# just a runtime present +build_flatpak('org.test.Runtime', + 'only-runtime', + 'only-runtime/repo') + +# app with an extension +copy_repo('only-runtime', 'app-extension') +build_flatpak('org.test.Chiron', + 'app-extension', + 'app-extension/repo', + cleanrepodir=False) +build_flatpak('org.test.Chiron.Extension', + 'app-extension', + 'app-extension/repo', + cleanrepodir=False) +copy_repo('app-extension', 'app-extension-update') +build_flatpak('org.test.Chiron.Extension', + 'app-extension-update', + 'app-extension-update/repo', + cleanrepodir=False) diff --git a/plugins/flatpak/tests/chiron.flatpak b/plugins/flatpak/tests/chiron.flatpak new file mode 100644 index 0000000..ce038e9 Binary files /dev/null and b/plugins/flatpak/tests/chiron.flatpak differ diff --git a/plugins/flatpak/tests/flatpakrepos.tar.gz b/plugins/flatpak/tests/flatpakrepos.tar.gz new file mode 100644 index 0000000..f8bcfde Binary files /dev/null and b/plugins/flatpak/tests/flatpakrepos.tar.gz differ diff --git a/plugins/flatpak/tests/meson.build b/plugins/flatpak/tests/meson.build new file mode 100644 index 0000000..9e48b00 --- /dev/null +++ b/plugins/flatpak/tests/meson.build @@ -0,0 +1,34 @@ +tar = find_program('tar') +custom_target( + 'flatpak-self-test-data', + input : 'flatpakrepos.tar.gz', + output : 'done', + command : [ + tar, + '--no-same-owner', + '--directory=' + meson.current_build_dir(), + '-xf', '@INPUT@', + ], + build_by_default : true, +) + +custom_target( + 'flatpak-self-test-bundle', + output : 'flatpakrepos.tar.gz', + command : [ + tar, + '-czf', '@OUTPUT@', + 'app-missing-runtime/repo/', + 'app-update/repo/', + 'app-with-runtime/repo/', + 'only-runtime/repo/', + 'app-extension/repo', + 'app-extension-update/repo', + ], +) + +configure_file( + input : 'chiron.flatpak', + output : 'chiron.flatpak', + copy : true, +) diff --git a/plugins/flatpak/tests/only-runtime/.gitignore b/plugins/flatpak/tests/only-runtime/.gitignore new file mode 100644 index 0000000..f606d5e --- /dev/null +++ b/plugins/flatpak/tests/only-runtime/.gitignore @@ -0,0 +1 @@ +repo diff --git a/plugins/flatpak/tests/only-runtime/org.test.Runtime b/plugins/flatpak/tests/only-runtime/org.test.Runtime new file mode 120000 index 0000000..eb7054c --- /dev/null +++ b/plugins/flatpak/tests/only-runtime/org.test.Runtime @@ -0,0 +1 @@ +../app-with-runtime/org.test.Runtime/ \ No newline at end of file -- cgit v1.2.3