368 Commits

Author SHA1 Message Date
Matthias Clasen
ac14058d9a Update tests to match new output
Our tests notice the string changes in the previous commit.

Closes: #2624
Approved by: matthiasclasen
2019-01-23 12:45:00 +00:00
Matthias Clasen
1c831c131f Test appdata date parsing
Add a few dates to our appdata testdata,
and verify the results.

Closes: #2619
Approved by: alexlarsson
2019-01-21 08:46:57 +00:00
Matthias Clasen
e7172516a0 Add one more name matching test
This one is from #2615 and does not work.

Closes: #2616
Approved by: alexlarsson
2019-01-21 08:27:09 +00:00
Matthias Clasen
9fccb90f26 Add some tests for name matching
These examples are taken from commit 8f428fd768

Closes: #2616
Approved by: alexlarsson
2019-01-21 08:27:09 +00:00
Simon McVittie
b0615922ff Remove leftover files from flatpak-builder
These were part of the flatpak-builder tests, and are no longer
distributed in tarballs or used by Flatpak's tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>

Closes: #2607
Approved by: matthiasclasen
2019-01-17 16:58:41 +00:00
Matthias Clasen
f52d00f391 build-export: Use the icon validator
Validate all exported icons to be loadable png, svg or
jpeg files with a resolution of no more than 512x512.

Closes: #2523
Approved by: alexlarsson
2019-01-17 07:27:31 +00:00
Simon McVittie
7c3140bb7a testcommon: An i386 Flatpak doesn't support x86_64 apps
The compatible architectures are not symmetric: x86_64 and aarch64 can
run i386 and arm binaries, but i386 and arm cannot usually run x86_64
and aarch64 binaries.

This caused test failures on Debian i386 autobuilders.

Signed-off-by: Simon McVittie <smcv@collabora.com>

Closes: #2603
Approved by: matthiasclasen
2019-01-16 12:51:32 +00:00
Alexander Larsson
5880a6923f Update valgrind suppressions
This adds some new ones from new deps we picked up.
2019-01-15 16:02:34 +01:00
Alexander Larsson
a143161131 tests: Fix tests on intel gpus
We can't assume have-intel-gpu is not true!

Closes: #2589
Approved by: alexlarsson
2019-01-14 16:48:32 +00:00
Matthias Clasen
7a6e52eca8 Add tests for appdata parsing
Closes: #2580
Approved by: alexlarsson
2019-01-14 15:06:41 +00:00
Matthias Clasen
4b3087c356 Update tests
We have tests that catch changes in the default
installation display names. Amazing

Closes: #2583
Approved by: alexlarsson
2019-01-14 13:59:14 +00:00
Matthias Clasen
bd6f71a3c8 Update colum tests
We have tests for internal apis now, and they
catch when we change those apis. Yay.

Closes: #2460
Approved by: alexlarsson
2019-01-14 13:35:56 +00:00
Matthias Clasen
22a375fc8e tests: Fix a typo
Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
53cd86e291 Add tests for column completion
Closes: #2579
Approved by: matthiasclasen
2019-01-12 02:17:44 +00:00
Matthias Clasen
4f6f9dda1c Add tests for number parsing
Closes: #2578
Approved by: matthiasclasen
2019-01-12 02:05:05 +00:00
Matthias Clasen
b6e19db7be Update tests
Our test are now good enough to detect that install
is no longer a one-dir command. Yay. Update them.
2019-01-11 19:19:54 -05:00
Emmanuele Bassi
4d79e2239a Fix non-srcdir builds
The generated DBus permission header is included by an header in under
app/ that we include from testcommon.c. We already added the app/
directory under the source directory, but we need to include the same
directory under the build directory in order for the compiler to find
the generated header.

Fixes the build in GNOME Continuous, which is failing with:

```
In file included from ../tests/testcommon.c:10:0:
../app/flatpak-builtins-utils.h:28:47: fatal error: flatpak-permission-dbus-generated.h: No such file or directory
compilation terminated.
```
2019-01-11 19:28:30 +00:00
Matthias Clasen
ccd602dd19 Fix a compiler warning
The largest warning ever. Go clang!

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:45 +00:00
Matthias Clasen
0360fa84ef Adapt format_choices tests
The formatting has changed, and our tests catch that. Yay!
Also fix the build with glib master.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:45 +00:00
Matthias Clasen
9e27fc67fe testcommon: Add another table ellipsization test
This tests the situation when we can't accommodate
the requested width with the available shrinkage.

This used to cause an infinite loop in the table
printer.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:45 +00:00
Matthias Clasen
b095ca8ac6 datetime tests
Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:45 +00:00
Matthias Clasen
16cf081f97 tests: Add tests for app helpers
Link testcommon against libflatpak-app.la and
add tests for some utility functions.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
46e1f8f3b0 Add a test for some private utilities
Add another test that links against libflatpak-common.la
and tests functions that are not part of the public
library api.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
ed8fbbe6df testlibrary: Test a few new apis
Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
490924c5f0 tests: Add appstream version to test app
Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
b9a274c758 Update more tests
test-info.sh was needlessly relying on the exact output
of flatpak info --show-extensions. Update it to match the
new output.

Closes: #2502
Approved by: alexlarsson
2019-01-11 13:31:10 +00:00
Matthias Clasen
b8d0c2a0b6 Update tests
Some tests were depending on the exact flatpak info
output. Update them to match.

Closes: #2502
Approved by: alexlarsson
2019-01-11 13:31:10 +00:00
Matthias Clasen
6f77da3499 Add some tests for flatpak config
Closes: #2534
Approved by: alexlarsson
2019-01-11 12:40:36 +00:00
Matthias Clasen
d3b1b86f04 Add tests for ONE_DIR commands
Check that we consistenly reject specifying multiple
installations for commands that only accept one.

Closes: #2534
Approved by: alexlarsson
2019-01-11 12:40:36 +00:00
Matthias Clasen
4fc5f54075 Add some completion tests
Closes: #2534
Approved by: alexlarsson
2019-01-11 12:40:36 +00:00
Matthias Clasen
456e1d569a tests: Ignore custom repos
I was seeing some issues because make check was
picking up a custom installation that was defined
in /etc/flatpak/installations.d/ on my system.
Avoid that by pointing FLATPAK_CONFIG_DIR at
a non-existing place.

Closes: #2534
Approved by: alexlarsson
2019-01-11 12:40:35 +00:00
Alexander Larsson
2a94bb8eb2 Use shorter names for origin remotes
Use only the last section in the id for origin remotes, to avoid
the origin column being really wide when listing stuff.

Closes: #2448
Approved by: alexlarsson
2018-12-20 16:08:44 +00:00
Matthias Clasen
4c42bc46b7 Fix oci registry tests
These were relying on details of the remote-ls output.
We can avoid this by explicitly specifying what columns
we want.

Closes: #2409
Approved by: alexlarsson
2018-12-19 15:45:35 +00:00
Matthias Clasen
d5c1668ffb tests: Be less picky about remote-ls output
We don't need to insist that the ref is the first column.

Closes: #2409
Approved by: alexlarsson
2018-12-19 15:45:35 +00:00
Matthias Clasen
27cf46d8ea Fix test failures
test-repo.sh was needlessly assuming that the application ID
is the first column in flatpak list -d output. Other tests
don't do the same. This is why test-repo.sh was broken by
the addition of the description column in list output.

Change the test to remove that assumption.

Closes: #2409
Approved by: alexlarsson
2018-12-19 15:45:34 +00:00
Matthias Clasen
3895eacab2 Implement a new commandline UX
Revamp the FlatpakCliTransaction output to be closer to this:
https://github.com/flatpak/flatpak/wiki/CLI-experimental-design

We only do this style of formatting when fancy output is possible.
For plain output, we don't redraw the table and only use '\r'
to rewrite the progress line in-place.

Closes: #2371
Approved by: alexlarsson
2018-12-18 14:50:26 +00:00
Matthias Clasen
0261fb5d38 Silence compiler warnings
clang was complaining about a number of unused
variables in testlibrary.c. Drop them
2018-12-14 20:56:52 -05:00
Simon McVittie
4c92f5e3c1 testlibrary: Don't leak source IDs
This avoids a crash or deadlock if the timeout is reached during test
teardown, after the GMainLoop has already been freed. That appears to
be more likely to happen when run as an installed-test.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://github.com/flatpak/flatpak/issues/2422

Closes: #2425
Approved by: matthiasclasen
2018-12-12 18:39:12 +00:00
Alexander Larsson
c7c824bc5c tests: Add suppression for polkit-agent leak 2018-12-10 11:50:35 +01:00
Matthew Leeds
2f00156704 app: Fix support for "NAME BRANCH" syntax
The uninstall command supports the syntax "flatpak uninstall
org.gnome.Builder stable" as an alternative to "flatpak uninstall
org.gnome.Builder//stable", but this support was broken by the fuzzy
matching (partial ref) feature. Since that syntax only supported full
app IDs not partial ones, assume it's being used if the first argument
is a full app ID and the second argument looks like a branch. This means
we don't support the syntax "flatpak uninstall builder stable" (unless
you're trying to uninstall an app called stable).

Similarly, fix the install command's support for the syntax "flatpak
install flathub org.gnome.Builder stable".

Also, add a unit test for both of the above.

Fixes https://github.com/flatpak/flatpak/issues/2395

Closes: #2405
Approved by: matthiasclasen
2018-12-08 00:56:30 +00:00
Alexander Larsson
682a93646d tests: Use g_test_dbus in testlibrary
This means we pick up the built services. Also we set
FLATPAK_SYSTEM_HELPER_ON_SESSION so that the system-helper
runs on the session-bus just like in libtest.sh.

Closes: #2397
Approved by: matthiasclasen
2018-12-07 14:45:31 +00:00
Matthias Clasen
939b2c1429 Fix an oversight
These new checks were not meant to be commented out.

Closes: #2380
Approved by: mwleeds
2018-12-03 20:38:39 +00:00
Matthias Clasen
9f97b8d414 Fix a few tests
We were relying on the order of string lists obtained
from a keyfile. But the way the keyfile is constructed
involved iterating of hash tables, which doesn't guarantee
order.

This was causing test failures with GLib master.

Closes: #2375
Approved by: matthiasclasen
2018-12-03 20:01:49 +00:00
Matthias Clasen
754d68c74a Rename list commands
Rename permission-list and document-list to
permissions and documents, for consistency with
how we handle remotes. The old command names
are kept as hidden aliases.

Closes: #2131

Closes: #2366
Approved by: mwleeds
2018-12-03 19:46:09 +00:00
Simon McVittie
752eac6859 test-override: Skip tests that need bwrap if necessary
This requires some new mechanisms: now we're skipping individual tests,
not just whole test scripts.

There are two main reasons why autobuilder environments might not be
able to run these tests successfully, both of which apply in Debian.

Tests that rely on bwrap typically can't pass in builds that take place
in a chroot, because bwrap's use of pivot_root() assumes that the root
directory is a mount point, but a chroot will typically have an unpacked
directory somewhere below the mount point as its root.

Some autobuilder environments are also sufficiently restricted that they
can't create new user namespaces at all, as a way to harden the
autobuilder host.

As a result, Debian autobuilders can't run the majority of the Flatpak
tests. We would like to be able to continue to run the subset that don't
need bwrap, to have the best test coverage we can. For the rest we have
to rely on installed-tests (which I've wired up to Debian's autopkgtest)
rather than using build-time tests.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #2339
Approved by: matthiasclasen
2018-11-29 23:26:14 +00:00
Simon McVittie
cd63da0cf0 testlibrary: Don't assume native architecture is x86_64
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #2353
Approved by: matthiasclasen
2018-11-29 23:01:25 +00:00
Simon McVittie
871f103153 test scripts: Don't assume we are running on x86_64
These tests failed on other architectures.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #2353
Approved by: matthiasclasen
2018-11-29 23:01:25 +00:00
Simon McVittie
b8bb44ef40 testlibrary: Use an unusual architecture to test ref syntax parsing
This makes it clearer that we are not assuming that the test is running
on an x86_64.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #2353
Approved by: matthiasclasen
2018-11-29 23:01:25 +00:00
Simon McVittie
8a2a32363f Fix a typo that broke installed-tests
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #2338
Approved by: matthiasclasen
2018-11-23 13:48:10 +00:00
Matthew Leeds
5fe2a0aabe uninstall: Add support for fuzzy matching
This adds support for fuzzy matching ref names (AKA "typo helper") to
the uninstall command to mirror what the install command has. In short,
this means you can do "flatpak uninstall gedit" instead of "flatpak
uninstall org.gnome.gedit". Flatpak will prompt you to choose between
similarly named installed refs, and will only make the choice for you if
--assumeyes was used and there's only one match.

Note that this commit does have the side effect that if there are
multiple matching refs with the same ID (e.g. with different branches or
in different installations) you are prompted to choose between them.
Previously you were shown an error message.

Closes: #2330
Approved by: matthiasclasen
2018-11-17 13:00:33 +00:00