Commit Graph

31 Commits

Author SHA1 Message Date
Simon McVittie
3ba6e122e1 test-run: Allow org.test.Setuid to install, as long as it's not setuid
libostree attempts to strip the setuid and setgid bits from file
permissions in user-mode checkouts, which, if successful, would make
Flatpak's check for setuid ineffective and unnecessary. In versions
older than 2017.7 this was not consistently applied, making commits
2c8e241 and 02a299f necessary to defeat CVE-2017-9780 (see #845).

libostree 2017.7 removes setuid and setgid bits more thoroughly
as a result of fixing https://github.com/ostreedev/ostree/issues/633
in PR https://github.com/ostreedev/ostree/pull/903, which means that
this test fails when linking flatpak 0.8.x to libostree 2017.7.

Signed-off-by: Simon McVittie <smcv@debian.org>
2017-06-28 12:17:43 +02:00
Alexander Larsson
1018d05cda 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-04-03 13:43:56 +02: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
25483378a9 tests: Run flatpak-builder under valgrind too 2016-10-26 21:43:32 +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
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
Alexander Larsson
78dae42509 Set MALLOC_CHECK_ and MALLOC_PERTURB_ during tests 2016-08-26 12:32:17 +02:00
Alexander Larsson
42fae1c5d1 tests: Fix python2 use 2016-08-22 14:43:16 +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
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
ab64f70c59 tests: Test install/updates with static deltas 2016-06-28 17:36:54 +02: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
Alexander Larsson
528b150162 Update valgrind test support 2016-06-10 12:59:11 +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
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
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
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
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
Alexander Larsson
aa11387031 tests: Add test-run-system.sh 2016-05-17 17:49:55 +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
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
d680da8d59 Added xdg-app-builder test 2016-05-02 15:49:18 +02:00
Alexander Larsson
dcfb950c31 make-test-runtime.sh: Make this a bit more generic
We pass the id and contents on the commandline
2016-05-02 14:15:32 +02:00
Alexander Larsson
a68e3bba50 tests: Add tests for list/info commands 2016-05-02 12:38:12 +02:00
Alexander Larsson
e5fad0714e tests: Add namespace and overrides tests 2016-05-02 11:41:32 +02:00
Alexander Larsson
123f32015d tests/test-run.sh: Add tests for proper installation 2016-05-02 10:47:59 +02:00
Alexander Larsson
b330368761 Make installed tests work better
This involves e.g. having our own session bus with only our services in.
2016-04-28 13:04:14 +02:00
Alexander Larsson
327f432219 tests: Add a basic test that just runs an app 2016-04-27 21:23:42 +02:00