summaryrefslogtreecommitdiffstats
path: root/plugins/flatpak/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugins/flatpak/tests/app-extension-update/.gitignore1
-rw-r--r--plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/.gitignore1
-rw-r--r--plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/.empty0
-rw-r--r--plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/libtest/README1
-rw-r--r--plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml12
-rw-r--r--plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/metadata6
-rw-r--r--plugins/flatpak/tests/app-extension/.gitignore1
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/.gitignore1
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/.empty0
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/libtest/README0
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/metainfo/org.test.Chiron.Extension.metainfo.xml12
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/metadata6
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron/.gitignore2
-rwxr-xr-xplugins/flatpak/tests/app-extension/org.test.Chiron/files/bin/chiron.sh2
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml16
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/applications/org.test.Chiron.desktop6
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.pngbin0 -> 334 bytes
-rw-r--r--plugins/flatpak/tests/app-extension/org.test.Chiron/metadata10
-rw-r--r--plugins/flatpak/tests/app-missing-runtime/.gitignore1
l---------plugins/flatpak/tests/app-missing-runtime/org.test.Chiron1
-rw-r--r--plugins/flatpak/tests/app-update/.gitignore1
-rw-r--r--plugins/flatpak/tests/app-update/org.test.Chiron/.gitignore2
-rw-r--r--plugins/flatpak/tests/app-update/org.test.Chiron/files/bin/chiron.sh2
-rw-r--r--plugins/flatpak/tests/app-update/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml19
l---------plugins/flatpak/tests/app-update/org.test.Chiron/files/share/applications/org.test.Chiron.desktop1
l---------plugins/flatpak/tests/app-update/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png1
-rw-r--r--plugins/flatpak/tests/app-update/org.test.Chiron/metadata4
-rw-r--r--plugins/flatpak/tests/app-with-runtime/.gitignore1
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Chiron/.gitignore2
-rwxr-xr-xplugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/bin/chiron.sh2
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/appdata/org.test.Chiron.appdata.xml16
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/applications/org.test.Chiron.desktop7
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.pngbin0 -> 334 bytes
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Chiron/metadata4
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Runtime/files/.empty0
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Runtime/metadata3
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/.gitignore1
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/libtest/README0
-rw-r--r--plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/metainfo/org.test.Runtime.metainfo.xml10
-rwxr-xr-xplugins/flatpak/tests/build.py125
-rw-r--r--plugins/flatpak/tests/chiron.flatpakbin0 -> 5452 bytes
-rw-r--r--plugins/flatpak/tests/flatpakrepos.tar.gzbin0 -> 72252 bytes
-rw-r--r--plugins/flatpak/tests/meson.build34
-rw-r--r--plugins/flatpak/tests/only-runtime/.gitignore1
l---------plugins/flatpak/tests/only-runtime/org.test.Runtime1
45 files changed, 316 insertions, 0 deletions
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
--- /dev/null
+++ b/plugins/flatpak/tests/app-extension-update/org.test.Chiron.Extension/files/.empty
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2017 Endless Mobile, Inc.
+ Author: Joaquim Rocha <jrocha@endlessm.com>
+-->
+<component type="runtime">
+ <id>org.test.Chiron.Extension</id>
+ <metadata_license>CC0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <name>Chiron App Extension</name>
+ <summary>Test extension for flatpak self tests</summary>
+</component>
+
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
--- /dev/null
+++ b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/.empty
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
--- /dev/null
+++ b/plugins/flatpak/tests/app-extension/org.test.Chiron.Extension/files/share/libtest/README
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2017 Endless Mobile, Inc.
+ Author: Joaquim Rocha <jrocha@endlessm.com>
+-->
+<component type="runtime">
+ <id>org.test.Chiron.Extension</id>
+ <metadata_license>CC0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <name>Chiron App Extension</name>
+ <summary>Test extension for flatpak self tests</summary>
+</component>
+
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2016 Richard Hughes <richard@hughsie.com> -->
+<component type="desktop">
+ <id>org.test.Chiron.desktop</id>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <name>Chiron</name>
+ <summary>Single line synopsis</summary>
+ <description><p>Long description.</p></description>
+ <url type="homepage">http://127.0.0.1/</url>
+ <releases>
+ <release date="2014-12-15" version="1.2.3">
+ <description><p>This is better.</p></description>
+ </release>
+ </releases>
+</component>
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
--- /dev/null
+++ b/plugins/flatpak/tests/app-extension/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png
Binary files 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2016 Richard Hughes <richard@hughsie.com> -->
+<component type="desktop">
+ <id>org.test.Chiron</id>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <name>Chiron</name>
+ <summary>Single line synopsis</summary>
+ <description><p>Long description.</p></description>
+ <url type="homepage">http://127.0.0.1/</url>
+ <releases>
+ <release date="2015-02-13" version="1.2.4">
+ <description><p>This is best.</p></description>
+ </release>
+ <release date="2014-12-15" version="1.2.3">
+ <description><p>This is better.</p></description>
+ </release>
+ </releases>
+</component>
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2016 Richard Hughes <richard@hughsie.com> -->
+<component type="desktop">
+ <id>org.test.Chiron</id>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <name>Chiron</name>
+ <summary>Single line synopsis</summary>
+ <description><p>Long description.</p></description>
+ <url type="homepage">http://127.0.0.1/</url>
+ <releases>
+ <release date="2014-12-15" version="1.2.3">
+ <description><p>This is better.</p></description>
+ </release>
+ </releases>
+</component>
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
--- /dev/null
+++ b/plugins/flatpak/tests/app-with-runtime/org.test.Chiron/files/share/icons/hicolor/128x128/apps/org.test.Chiron.png
Binary files 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
--- /dev/null
+++ b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/files/.empty
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
--- /dev/null
+++ b/plugins/flatpak/tests/app-with-runtime/org.test.Runtime/usr/share/libtest/README
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2017 Richard Hughes <richard@hughsie.com> -->
+<component type="runtime">
+ <id>org.test.Runtime</id>
+ <metadata_license>CC0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <name>Test runtime</name>
+ <summary>Test runtime for flatpak self tests</summary>
+</component>
+
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
--- /dev/null
+++ b/plugins/flatpak/tests/chiron.flatpak
Binary files differ
diff --git a/plugins/flatpak/tests/flatpakrepos.tar.gz b/plugins/flatpak/tests/flatpakrepos.tar.gz
new file mode 100644
index 0000000..f8bcfde
--- /dev/null
+++ b/plugins/flatpak/tests/flatpakrepos.tar.gz
Binary files 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