Commit Graph

171 Commits

Author SHA1 Message Date
Philip Withnall
f47a696392 build: Add AM_* variables to all per-target special variables
For example, add $(AM_CFLAGS) to mumble_CFLAGS. Since $(WARN_CFLAGS) is
only added to $(AM_CFLAGS), this fixes the lack of inclusion of the
compiler warning flags in the compilation of half of flatpak.

Note that $(AM_*) variables are only used by automake if a more specific
(per-target) special variable is not defined instead. So if you define
mumble_CFLAGS, AM_CFLAGS will not be used for that target unless
explicitly included in mumble_CFLAGS.

See
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html.

Do the same for $(AM_LIBADD), $(AM_LDFLAGS), etc. These are not
currently defined, but it’s good practice to include them in
mumble_LIBADD (etc.) just in case they’re defined in future. Hopefully
their inclusions will be cargo-culted to any new targets which are
added, retaining full coverage of the code base.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 15:05:58 +01:00
Philip Withnall
95c3c942d3 tests: Move printf format string into printf() call to silence warning
Clang otherwise complains about the printf() format string not being a
string literal, which is a bit pants.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 15:05:58 +01:00
Simon McVittie
5de225e615 tests: Isolate tests from real home directory more thoroughly
The library test previously used the real ~/.cache, while the
library test and the shell-script tests would use the real ~/.config
to look up the XDG user-dirs.dirs. Other home-directory-related code
might have used the real $HOME.

As a general rule, build-time tests should not affect the real home
directory. Debian autobuilders run as a user whose home directory
does not exist, in order to catch packages whose build process could
affect or be affected by the contents of the home directory. This
caused testlibrary to fail when it tried to create that nonexistent
directory, which I think happened while trying to create ~/.cache.

Signed-off-by: Simon McVittie <smcv@debian.org>
2017-07-04 11:32:45 +01:00
Philip Chimento
86bc5f39be builder: Use build-args during cleanup
Any build-args specified in the manifest should be used during the
cleanup and platform-cleanup stages. This is because if you are using
QEMU to build for another architecture, for example, you need to pass
--bind-mount in the build-args, and the bind mount also needs to be
present while running cleanup commands.
2017-06-30 10:23:52 +02:00
Philip Withnall
5a0e10969f tests: Add base-64 GPG keys to libtest declarations
These will be useful in upcoming tests, as they are in the right format
to be substituted into a .flatpakref file.

Generated using `gpg2 --homedir test-keyring --armor --export
${FL_GPG_ID}`, then stripping the packet header and removing line
breaks.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 10:17:34 +02:00
Philip Withnall
0062cf69c0 tests: Add TEST_SKIP_CLEANUP env var for skipping test cleanup
This mirrors the same environment variable in OSTree’s unit tests, which
keeps the temporary directory around after tests have completed (or
failed) so the developer can examine it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 10:17:34 +02:00
Alexander Larsson
7ef78c8e2b tests: Increase timeouts waiting for file notification
For whatever reason .5 seconds was not enough time for me
to get a file notification message, so increase it to 1 sec.
2017-06-19 19:41:32 +02:00
Alexander Larsson
0bbb8354dc tests: Add tests for no world writable dirs & no setuid files 2017-06-19 19:41:00 +02:00
Alexander Larsson
bc7ebd20e2 builder: Allow .pyc files without .py
This is common for binary-only releases, for example as described
in:
https://lists.freedesktop.org/archives/flatpak/2017-June/000697.html
2017-06-13 11:17:06 +02:00
Matthias Clasen
27761c17d6 Merge pull request #835 from smcv/generated-dbus
Don't distribute gdbus-codegen-generated source in tarballs
2017-06-06 16:06:37 -04:00
Simon McVittie
37e52409aa Don't distribute gdbus-codegen-generated source in tarballs 2017-06-05 21:53:17 +01:00
Simon McVittie
7612232ab8 testlibrary: Call g_assert_no_error first
Failing tests produce much clearer diagnostics this way round.

Signed-off-by: Simon McVittie <smcv@debian.org>
2017-06-05 21:48:59 +01:00
Alexander Larsson
d2c51a8553 Fix installation of test-keyring2 2017-05-23 14:32:46 +02:00
Alexander Larsson
6fb15f4f76 Dist test-keyring2 dir 2017-05-23 12:08:23 +02:00
Alexander Larsson
dac242fb49 Remove unused variables 2017-05-22 13:40:11 +02:00
Alexander Larsson
6ce8521b64 document-portal: Add AddFull() operation
This allows you to add multiple paths at the same time, plus
grant an app access to it, plus it returns the fuse mount path.

This allows you to avoid a lot of roundtrip in common cases.
2017-05-19 17:01:46 +02:00
Alexander Larsson
c35bce077f remote-add: Use the new system-helper for initial metadata update
This removes some duplicated code, and also follows the new
redirect-url property on initial add.

This also means we're requiring gpg signatures to be correct
on remote-add, so fix up the tests
2017-05-11 11:20:39 +02:00
Alexander Larsson
2f533f3a68 tests: run test-repo.sh with system repo too 2017-05-10 11:54:27 +02:00
Alexander Larsson
755d4b6337 tests: Add tests for --redirect-url and new GPG key 2017-05-10 11:54:27 +02:00
Alexander Larsson
b09185c356 tests: Add new test-repo.sh with initial GPG tests
This just ensures we can install from GPG and non-GPG repos
and we can't install with missing on wrong GPG key.
2017-05-10 11:54:27 +02:00
Alexander Larsson
ec89340a26 tests: Add a second gpg keyring 2017-05-10 11:54:27 +02:00
Alexander Larsson
b33d6fd04f tests: Allow overriding GPG args 2017-05-10 11:54:27 +02:00
Alexander Larsson
99a6200cab tests: Make it possible to create multiple test repos 2017-05-10 11:54:27 +02:00
Alexander Larsson
0d4fa486b5 Fix tests by setting XDG_CACHE_HOME
We use this now, so need to have it set to the test homedir
2017-05-09 13:24:54 +02:00
Colin Walters
48b5dd5e7b tests: Fix race condition in tmp webserver
I was seeing this when trying to run flatpak's tests in ostree's CI:
https://github.com/ostreedev/ostree/pull/824

The race here is that the python process can still be writing to the output
while sed is reading it, and hence we'll find a difference on the next line.
Fix this by making a tmp copy of the file, which then both sed and cmp will
read consistently.

I'm not *entirely* sure this will fix the problem as I couldn't easily reproduce
the race locally, but I believe it at least fixes *a* race.
2017-05-08 11:27:09 +02:00
Alexander Larsson
c053c49ead Extend flatpak-builder test
We now test including modules, including doing
so recursively, and find patches and source files from
those.
2017-04-24 10:04:23 +02:00
Matthias Clasen
564490c07e Fix the testsuite
Some tests were using flatpak info --runtime, which no
longer exists. Removing the option doesn't do any harm,
and the test passes again.
2017-04-18 12:34:19 +02:00
Alexander Larsson
3ff6d312de update: Only allow downgrades if a commit is explicitly specified
If you run "flatpak update" then we will never update to
a commit that is older than the currently installed one. This
protects against a man-in-the-middle attack that would otherwise
let the attacker downgrade to a previously signed version that
may have some vulnerability.
2017-04-03 09:45:45 +02:00
Alexander Larsson
da4ea44e41 OCI: Use gpg signatures in tests-oci.sh 2017-03-29 18:04:54 +02:00
Alexander Larsson
37d4047af2 tests: Don't leak SimpleHTTPServers 2017-03-27 14:10:50 +02:00
Alexander Larsson
9281a0afc9 test-webserver.sh: Remove accidental debug spew 2017-03-27 13:46:58 +02:00
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