Commit Graph

190 Commits (master)

Author SHA1 Message Date
Alexander Larsson b3ddba3ab0 Add forgotten file 2017-03-27 12:46:24 +02:00
Alexander Larsson 32eb260d24 Stop using ostree trivial-httpd
This isn't always available in recent ostree.
This work is based on https://github.com/flatpak/flatpak/pull/658 and
fixes https://github.com/ostreedev/ostree/pull/723
2017-03-27 12:30:38 +02:00
Alexander Larsson 54b8eef03c tests: Fix oci test 2017-03-14 11:53:43 +01:00
Alexander Larsson 576854fc7b tests: Make python mtime test modified file same size
This doesn't really affect the current test, but it makes
a difference for using python3 which also stores the size
in the cache.
2017-02-24 14:16:12 +01:00
Mathieu Bridon b996a636ff builder: Add a "simple" buildsystem
This just runs the specified "build-commands" one after the other,
ignoring makefiles, configure scripts, and all the rest.

Relates to #134
2017-02-20 16:08:35 +01:00
Alexander Larsson 55e5ab272b tests: Fix python test regression from rofiles-fuse
We need to delete the old file when copying over it.
2017-02-16 09:52:14 +01:00
Alexander Larsson 7975dc489e tests: Remove some leftover debug spew 2017-01-30 14:33:43 +01:00
Alexander Larsson b8c3b5aa44 Fix tests now that build-init requires the runtime to be installed 2017-01-27 13:56:04 +01:00
Simon McVittie dd96ac54f1 tests: Install testpython.py executable
The test that uses this file executes it. Install it as an extra
script rather than data to ensure that it can work.
2017-01-18 08:41:03 +01:00
Simon McVittie 63daf2bb95 testlibrary: ensure that contents_array is NULL-terminated
Otherwise g_strjoinv() wanders off the end into uninitialized memory.

Signed-off-by: Simon McVittie <smcv@debian.org>
2017-01-18 08:41:03 +01:00
Alexander Larsson c4f0f3245d Fix update of standalone bundle
We regressed on being able to install a bundle twice to update it.

This fixes https://github.com/flatpak/flatpak/issues/462
2017-01-16 11:51:14 +01:00
Alexander Larsson d09f5ea072 tests: Add oci-over-http tests. 2017-01-12 00:08:00 +01:00
Alexander Larsson 0fb2f362a8 tests: Move the test repo to a subdirectory (repos/test)
This makes the ostree trivial-httpd --autoexit feature work better,
because it seems to exit whenever the root directory changes (i.e. not
only when its deleted).

This means the root dir can't be the repo (because then we can't
update the repo), or the base testdir (because we create files there
too), so instead we make the repo $testdir/repos/test and
$testdir/repos as the httpd root.
2017-01-12 00:04:36 +01:00
Alexander Larsson f20e5f7823 bundles: Support dependencies and runtime-repo
If the bundle contains an origin link we can now install related
things from it, such as locale data.

You can also build the bundle with --runtime-repo=URL, where the url
points to a flatpakrepo file for a repo with runtimes. This works
similar to the RuntimeRepo= feature in flatpakref files.
2016-12-20 16:27:57 +01:00
Mario Sanchez Prada 54d65aabc5 Fix CI build with clang: remove unused variable 2016-12-20 16:26:20 +01:00
Mario Sanchez Prada 29510ff4e0 Add unit tests to check the new feature to support multiple installations
Test all the new public APIs, making sure that the list of system-wide
installations is returned in the right order according to their priorities.
2016-12-20 09:54:39 +01:00
Alexander Larsson 5ef7e9d582 flatpak.supp: Suppress weird libsoup leak 2016-12-19 14:19:41 +01:00
Alexander Larsson cc85b93584 build-finish: Add --require-version and handling of it
This means that clients will refuse to install or update to your
new app if the flatpak version they are using is too old.
2016-12-14 13:48:51 +01:00
Alexander Larsson 9ddc4aca48 Support flatpak install --oci to install apps from OCI 2016-12-12 16:22:16 +01:00
Alexander Larsson 439d5fb554 leak tests: Add various suppressions to make most non-flatpak things go away 2016-11-28 17:24:02 +01:00
Matt Watson 36e844af56 tests: don't stomp on LD_LIBRARY_PATH
We should append to it, but not totally replace it, or things like
running test under jhbuild will not work properly.
2016-11-17 16:34:30 +01:00
Alexander Larsson 25483378a9 tests: Run flatpak-builder under valgrind too 2016-10-26 21:43:32 +02:00
Alexander Larsson eb92727f65 tests: Add some more verification to the bundle tests 2016-10-21 10:30:20 +02:00
Alexander Larsson 944c1d58c7 tests: Add suppression for ostree static delta valgrind issue
I filed this upstream as:
 https://github.com/ostreedev/ostree/issues/533

Lets ignore it for now so we can use valgrind tests for the flatpak
parts.
2016-10-19 13:21:29 +02:00
Alexander Larsson 5e4f46f9c2 tests: Make the valgrind based checks default to not checking for leaks
Use FLATPAK_TESTS_VALGRIND_LEAKS to check for leaks.
We're not currently passing the leak checks, so this helps letting
us make valgrind checks useful.
2016-10-19 13:13:30 +02:00
Alexander Larsson 6345f0bae7 build-finish: Support exporting more than hicolor icons
We really want apps to be able to export e.g. HighContrast icons too.
2016-10-18 10:14:10 +02:00
Simon McVittie 57bfce9a55 Terminate gpg-agent after using it for tests
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-09-07 22:08:03 +01:00
Simon McVittie c9a6da7fe5 Use dist_installed_test_data instead of installed_test_data
This means we don't have to add it to EXTRA_DIST, and also means
we can have generated (non-distributed) test data in future if we
want to.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-09-07 17:03:32 +01:00
Simon McVittie 1cdc43c8fa Make empty-configure executable when it is installed
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-09-07 17:03:19 +01:00
Simon McVittie 9f52d50448 make-test-runtime: cope with Debian's Python 2.7 configuration
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-09-07 17:02:53 +01:00
Simon McVittie 1769f8e8dc Tell build-time tests which bwrap we are going to use
In autobuilder environments that deprive the build of capabilities,
it is entirely possible that we have a system bwrap(1) but cannot
run it, for example because CAP_SYS_ADMIN has been excluded from
the capability bounding set. Tell the tests which bwrap we are
going to run, so we can run it in a simpler way and see whether
it works.

Debian's sbuild autobuilder currently suffers from a different
issue in which pivot_root(2) returns EINVAL, possibly caused by
sbuild being chroot-based and so not having the mount point
structure that is required for pivot_root. This avoids the
problematic build-time tests there too; they work on ci.debian.net,
which uses lxc instead of chroots, and in virtual machines.

Because $(BWRAP) might be non-absolute, we need to search PATH for it.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-09-07 17:02:04 +01:00
Simon McVittie a5d70667b2 test_install_launch_uninstall: consistently check for GError first
An assertion failure that says res is FALSE is a lot less useful
than an assertion failure that says we got a specific GError.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-09-07 17:01:35 +01:00
Alexander Larsson 6e37155a3e testlibrary: Skip launch test is bwrap is not supported 2016-08-29 12:32:31 +02:00
Alexander Larsson b1fcf792e1 testlibrary: Include libglnx before flatpak.h
This makes the code use the backport of g_auot* so that we can build
against older versions of glib.
2016-08-29 11:01:05 +02:00
Alexander Larsson 78dae42509 Set MALLOC_CHECK_ and MALLOC_PERTURB_ during tests 2016-08-26 12:32:17 +02:00
Alexander Larsson fcd91ad6db Fix python tests in make distcheck 2016-08-25 14:21:22 +02:00
Alexander Larsson 42fae1c5d1 tests: Fix python2 use 2016-08-22 14:43:16 +02:00
Alexander Larsson 84c7328af8 Remove double-listing of testpython.py in Makefile 2016-08-11 07:39:38 +02:00
Alexander Larsson 9c57a5751e Add test for python .pyc/.pyo rewriting
This catches regressions in the fix in the previous commit, where old
stale .py[oc] files can wrongly become "unstale" when we change the
.py file mtime to 1.
2016-08-10 16:24:18 +02:00
Matthias Clasen 66507c9bf1 Stop mentioning test-library.sh
It is not needed.
2016-08-03 18:05:59 -04:00
Matthias Clasen e50ea6f66a More library tests
Test launching of apps and uninstallation
2016-08-02 10:56:33 -04:00
Matthias Clasen 149cff9c5d More library tests
More tests, for FlatpakRef.
2016-08-01 23:05:19 -04:00
Matthias Clasen 109e6984e8 tests: Add library tests
Add a test binary that sets up a remote and exercises some of
the library apis against it.
2016-08-01 23:05:05 -04:00
Simon McVittie 6cc8062cfb libtest: replace dbus-launch with dbus-daemon
dbus-launch is X11-specific and contains a lot of legacy code to
support X11 autolaunching. It should not be part of the Wayland
(and/or Mir) future.

Start a dbus-daemon directly instead.
2016-08-01 11:29:50 +01:00
Alexander Larsson c809ee4fa0 Fix test failures due to desktop validation 2016-07-30 23:52:56 +02:00
Alexander Larsson 0be93ed1dc extensions: Always create a tmpfs for subdirectory extensions.
This makes sure we can actually create a directory as needed, and not
having to have every subdirectory pre-created in the runtime.
2016-06-29 15:56:28 +02:00
Alexander Larsson f1a2f30e41 Add tests for extensions 2016-06-29 12:54:08 +02:00
Alexander Larsson ab64f70c59 tests: Test install/updates with static deltas 2016-06-28 17:36:54 +02:00
Alexander Larsson c6aa8376b1 tests/test-builder.sh: Re-silence flatpak-builder
The > /dev/null was accidentally dropped
2016-06-28 15:26:16 +02:00
Bastien Nocera b9da048096 tests: Add test for "use-git" patch application 2016-06-28 15:23:44 +02:00
Alexander Larsson 9f047ff58e Merge pull request #154 from smcv/test-locale
test-basic: do not fail in non-English locales
2016-06-27 12:55:39 +02:00
Simon McVittie a41ecc5254 test-basic: do not fail in non-English locales
One of the variations tested on Debian's reproducible build
infrastructure is that the second build is done in a French locale.
This test fails there, because it doesn't see "Usage:" in the help.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-26 16:56:42 +01:00
Simon McVittie ee99e8afff Add BWRAP and --with-system-bubblewrap configure arguments
This lets distributors share a system copy of bubblewrap (>= 0.1.0)
between Flatpak and any other projects that benefit from it, if they are
careful to keep new versions in sync. The default is still to use the
bundled submodule, ensuring compatibility and simplifying dependencies.

Enable $PATH search everywhere that runs bwrap, so that $BWRAP doesn't
necessarily need to be a fully-qualified path.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-26 11:09:03 +01:00
Simon McVittie 6f9915eade Run tests with a private XDG_RUNTIME_DIR
Otherwise, service activation will start a new xdg-document-portal
(because we're using a private DBUS_SESSION_BUS_ADDRESS), but because
XDG_RUNTIME_DIR is shared with the real system, it won't be able to
mount its filesystem.

We need to unmount the document portal before removing the private
XDG_RUNTIME_DIR.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-25 00:45:10 +01:00
Simon McVittie c59fba9be3 tests: don't treat helper scripts as though they were tests
We shouldn't install .test metadata for these, and run them as TAP
test scripts. In glib-tap.mk jargon that makes them "extra scripts".

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-25 00:45:09 +01:00
Alexander Larsson 8740a9ded3 Add flatpak --supported-arches 2016-06-23 11:12:28 +02:00
Simon McVittie ec81d5c61b test-run: avoid testing cases of filesystem binding that won't work
This test effectively assumed that ${test_builddir} is in /home, /opt,
a non-FHS top level directory, or some other directory that isn't
in dont_mount_in_root[] in flatpak-run.c. In a distro build where
${libexecdir} is below /usr, when running the installed-tests
so ${test_builddir} is ${libexecdir}, this assumption doesn't hold.

We can't just copy the file we're dealing with into a subdirectory
of /tmp or /var/tmp either, because those directories aren't
part of --filesystem=host. Meanwhile, we also don't want to pollute
$HOME with test detritus.

For the best possible coverage given all those constraints, we try
three directories: ${test_builddir}; ${TEST_DATA_DIR}, which is
in /var/tmp; and ~/.flatpak-tests, but only if it already exists.

When testing --[no]filesystem=host overrides, we don't even try
${TEST_DATA_DIR}, because we know it's in /var/tmp which can only
be shared explicitly, but we do try the others.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-16 00:10:42 -04:00
Simon McVittie ee77be10b5 tests: clean up what is distributed
Listing variables whose values are conditional in EXTRA_DIST is
problematic: if Flatpak was configured without installed-tests,
we would not distribute those files. This is a problem during
distcheck, where installed-tests are disabled.

For files not placed in a special subdirectory, glib-tap.mk handles
this for us. For the keyring and the databases, we have to do it
ourselves, by arranging for them to be in a dist_ variable that is
special to Automake - when determining what to distribute, Automake
includes anything that is selected for distribution under any
combination of conditionals.

While I'm here, include test keyring's README in tarballs: its advice
is equally applicable in a tarball release.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-12 10:35:13 +01:00
Alexander Larsson 528b150162 Update valgrind test support 2016-06-10 12:59:11 +02:00
Alexander Larsson c800c59c54 test-builder: Test an empty module 2016-06-09 12:43:31 +02:00
Alexander Larsson c81e43fa09 tests/test-builder: Test recursive modules 2016-06-09 12:10:52 +02:00
Alexander Larsson e3e9c6559e tests: Test changing the subpaths on update 2016-06-07 22:12:51 +02:00
Alexander Larsson 20a737dc90 tests: Pull things via http instead of local pulls
This causes us to use the same codepaths as in real use.
Also, there seems to be an issue with partial pulls for local remotes.
2016-06-07 22:12:51 +02:00
Alexander Larsson 1bf2998352 Add tests for subpaths 2016-06-03 18:03:43 +02:00
Alexander Larsson 1667f988de Add test-bundle-system
This tests installing a bundle via the system-helper.
2016-06-03 16:04:10 +02:00
Alexander Larsson 95dfd2f459 Add test for bundles 2016-06-03 14:30:25 +02:00
Alexander Larsson f4c2eeb057 Fix version test
The --version output changes slightly (was capitalized)
2016-05-31 15:16:24 +02:00
Alexander Larsson 759bfaa0f4 tests: Only skip tests if no xattrs in /var/tmp
We explicitly put the checkouts in /var/tmp to avoid the common
case of /tmp being tmpfs and not supporting xattrs.
2016-05-31 09:18:08 +02:00
David King fc6282e865 bwrap: Move to under libexecdir
According to the FHS, applications which place internal libraries in
/usr/libexec should not also use /usr/lib for this purpose:

http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html

As several flatpak helpers are already installed in libexecdir, move
the bwrap helper to /usr/libexec/flatpak-bwrap.
2016-05-30 18:40:12 +02:00
Simon McVittie a461eb50fa Skip tests that make a repository if /var/tmp lacks user xattrs
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-23 23:00:37 +01:00
Alexander Larsson c6486d01a2 tests: Fix distcheck
Don't clean out the test files on a regular clean.
2016-05-18 10:45:16 +02:00
Alexander Larsson 4af71aae7b Fix distcheck: clean up some more generated files 2016-05-18 10:30:47 +02:00
Alexander Larsson 1216e0ea68 tests: Fix distcheck breaking on gpg dir not writable
We make a copy of the gpg homedir so that gpg can write (e.g. a lock file)
to the directory.
2016-05-18 10:26:11 +02:00
Alexander Larsson d961290d40 tests: EXTRA_DIST the test keyrings 2016-05-18 10:16:59 +02:00
Simon McVittie aa91b28a74 test-configure: use correct quoting
CFLAGS, FOO, BAR may contain spaces.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 18:05:41 +02:00
Simon McVittie d4738cca16 tests: skip running flatpak at build time if bwrap doesn't work
Distribution autobuilders are often more locked-down than the
environment in which the distribution binaries actually run.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 18:05:12 +02:00
Simon McVittie d6b1c9ff3c tests: package_version.txt is in the $builddir
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 18:01:46 +02:00
Simon McVittie 70e70d2f6a test-doc-portal: rely on service activation to start D-Bus service
This is a more realistic integration test anyway.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 17:59:23 +02:00
Simon McVittie 4828632456 test-doc-portal: rely on G_TEST_BUILDDIR to find services
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 17:59:04 +02:00
Simon McVittie 513f795c65 testdb: rely on G_TEST_SRCDIR to find databases
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 17:57:24 +02:00
Simon McVittie a7a49065a7 Don't install non-executable test files executable
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 17:55:42 +02:00
Alexander Larsson aa11387031 tests: Add test-run-system.sh 2016-05-17 17:49:55 +02:00
Alexander Larsson 294639ba2a test-run: Split null update to its own test 2016-05-17 13:05:43 +02:00
Alexander Larsson f36a57b3b1 tests: Use gpg signatures during test 2016-05-17 13:04:44 +02:00
Alexander Larsson 6b4e5dd903 tests: Put --user in an env var
This means we can optionally skip it
2016-05-17 10:50:02 +02:00
Alexander Larsson c432c417c2 tests: Add test for update 2016-05-17 10:32:29 +02:00
Alexander Larsson 90c909a932 Fix clang warnings 2016-05-13 16:26:47 +02:00
Alexander Larsson f68b21754a tests: Fix make-test-bundles.sh
This had bitrotted
2016-05-10 11:18:32 +02:00
Alexander Larsson 9957cc3a14 tests: Name bundles .flatpak 2016-05-10 11:10:51 +02:00
Alexander Larsson 28b549156a Split out permission store from session helper
This is now available as org.freedesktop.impl.portal.PermissionStore
2016-05-09 14:07:22 +02:00
Alexander Larsson 605b3f4e09 tests: Add an en_US locale to the test runtime 2016-05-09 13:10:13 +02:00
Alexander Larsson 5e9b247d26 Migrate ~/.local/share/xdg-app to ~/.local/share/flatpak 2016-05-09 12:21:28 +02:00
Alexander Larsson 8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson ba37b22d78 Rename library to libflatpak 2016-05-09 09:46:26 +02:00
Alexander Larsson c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 6a613d1fab Rename all non-autogenerated symbols to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 23dbfd5301 fix build test due to recent change
We're now looking for sources in the same dir as the json, so fix
the test
2016-05-06 16:36:59 +02:00
Alexander Larsson 1ffdf27d92 uncruftify: Initial run, all non-problematic changes 2016-05-06 16:03:27 +02:00
Alexander Larsson 663cfcf3a8 Fix make check if uninstalled
This uses various environment variables set during make check
to find the trigger, bwrap and xdg-app-dbusproxy from the build/source dir
rather than the installed location.
2016-05-03 10:27:36 +02:00
Alexander Larsson 1df3e4845b Fix various distcheck issues 2016-05-03 09:36:33 +02:00