Commit Graph

108 Commits

Author SHA1 Message Date
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