summaryrefslogtreecommitdiff
path: root/tests/test-run.sh
Commit message (Collapse)AuthorAgeFilesLines
* tests: Avoid printing arbitrary text to stdoutSimon McVittie2022-05-031-65/+65
| | | | | | | | Meson's TAP parser won't accept this, unlike Automake's. At the moment libtest.sh directs stderr to stdout anyway, so there is no practical effect for this change, but a subsequent commit will remove that merging. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Export to share/metainfo not share/appdataPhaedrus Leeds2022-01-101-1/+2
| | | | | | | | | Read metainfo files from both share/appdata and share/metainfo to support new and old versions of flatpak-builder (https://github.com/flatpak/flatpak-builder/pull/441) but only export to the new path. Fixes https://github.com/flatpak/flatpak/issues/4599
* tests: Use ${FLATPAK} not flatpakPhaedrus Leeds2021-11-161-6/+6
| | | | | This way the flatpak command is more consistently run under valgrind when that is enabled.
* tests: Test appdata installationGuido Günther2021-11-151-0/+1
| | | | Signed-off-by: Guido Günther <agx@sigxcpu.org>
* tests: Assert that XDG_foo_HOME directories are all createdSimon McVittie2021-11-151-0/+4
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Check that we handle XDG_foo_HOME as intendedSimon McVittie2021-11-151-1/+35
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Allow FLATPAK_BINARY=flatpak for exportsJan Tojnar2021-10-171-1/+1
| | | | | | | | | https://github.com/flatpak/flatpak/commit/a99b748931e6444dadb0d0c8c1565da23f755800 introduced an environment variable for changing the flatpak path for exports. On NixOS, we do not have a stable path we could use so we used to patch Flatpak to use `flatpak` program from `PATH`. With the recent change, we drop our downstream patch in favour of setting the environment variable to `flatpak` but the tests do not expect that. This is the test part of our former downstream patch so that tests can pass with exports using `flatpak` instead of an absolute path. It still expects the binary path to end with `flatpak` so arbitrary `$FLATPAK_BINARY` will not work but we do not pass the environment variable to tests so we cannot do much better.
* tests: Don't reset XDG_RUNTIME_DIR locallySimon McVittie2021-08-261-2/+5
| | | | | | | | | If we do, it interferes with xdg-dbus-proxy, causing test failure under some circumstances: the test passes on a development system, but fails when run on a qemu virtual machine in Debian's autopkgtest framework. Fixes: 6e5b02e2 "run: Don't let XDG_RUNTIME_DIR from user override the value we set" Signed-off-by: Simon McVittie <smcv@collabora.com>
* run: Don't let XDG_RUNTIME_DIR from user override the value we setSimon McVittie2021-08-201-1/+7
| | | | | | | | | | | | | | | | | | We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`, regardless of what it is on the host system, but the changes made to resolve CVE-2021-21261 unintentionally broke this by overwriting it with the user's XDG_RUNTIME_DIR. In practice this worked for most people, who either have XDG_RUNTIME_DIR set to the same value we use (which is the conventional setup from systemd-logind and elogind), or entirely unset (if they do not have systemd-logind or elogind). However, it broke Wayland and other XDG_RUNTIME_DIR-based protocols for people who intentionally set up an XDG_RUNTIME_DIR that is different. Fixes: 6d1773d2 "run: Convert all environment variables into bwrap arguments" Resolves: https://github.com/flatpak/flatpak/issues/4372 Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Avoid unnecessarily recreating the summary fileAlexander Larsson2020-11-171-13/+16
| | | | | | | | | | | We enforce --no-update-summary when we create test apps and runtimes, and then we ensure we always manually call update_repo after all modifications are done. This means we save work avoiding summary updates, but it also means we can do special handling in update_summary and guarantee that this is the only place this happens. For example, we want this to work around the mtime handling of summary updates.
* tests: Test container-manager interfaceSimon McVittie2020-08-271-1/+9
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* run: implement sandbox host os-release interfaceLuca Boccassi2020-07-241-1/+23
| | | | | | | | If available, always read-only bind-mount /etc/os-release as /run/host/os-release (or /usr/lib/os-release as fallback) as suggested by the os-release specification: https://www.freedesktop.org/software/systemd/man/os-release.html
* transaction: Ensure the metadata in the pulled commit matches what we resolvedAlexander Larsson2020-03-231-2/+4
| | | | | | | | | | | | | We're using the metadata from the summary, ostree-metadata or available commit when making security sensitive decisions, so lets verify this matches what we get in the actual commit we pulled. We already did check that this then actually also matches what gets deployed, so the new check shares code with that. Note, we don't do this for OCI installs, because it seems the current fedora flatpaks don't have this set, and we don't want to break existing remotes.
* tests: Add and use "ok" helperAlexander Larsson2020-03-201-16/+16
| | | | | | This allows us to print some separators for the logs also. tests: Convert more tests to ok helper
* tests: test search-provider DefaultDisabled logicWill Thompson2019-11-291-0/+2
| | | | | | 2ebf67286660f5111baac379fd44a401f57b40bb introduced special handling to mark exported GNOME Shell search provider .ini files as disabled by default. This functionality was not previously tested.
* Add flatpak install --or-update operationAlexander Larsson2019-09-271-1/+22
| | | | | | This allows you to ensure that a particular app/runtime is installed and with the latest version in a single operation, which is useful for instance in automatic use, like CI systems.
* Skip some tests if we can't use FUSESimon McVittie2019-04-151-0/+1
| | | | | | | | | | | | | | | | On some systems we can't make use of FUSE, especially on the same locked-down systems where distribution packages are typically built. For example, official Debian autobuilders (buildds) are configured to disallow module loading after boot has finished as a form of security hardening, some build chroots don't have a valid /etc/mtab, and Docker containers give us uid 0 but not CAP_SYS_ADMIN. These checks are taken from libostree. Signed-off-by: Simon McVittie <smcv@collabora.com> Closes: #2824 Approved by: matthiasclasen
* tests: Fix test of non-canonical permissionsAlexander Larsson2019-04-091-3/+6
| | | | | | | | | When installing via the child repo we now strip the permissions early so the import will fail instead of import and then canonicalize. Either is ok, as nothing should be non-canonical in real life. Closes: #2657 Approved by: alexlarsson
* tests: Escape periods when appropriateMatthew Leeds2019-04-051-7/+7
| | | | | | | | Don't match any character in a regular expression when we only want to match a period. Closes: #2803 Approved by: matthiasclasen
* run: Try to determine the branch if unspecifiedMatthew Leeds2019-03-301-13/+38
| | | | | | | | | | | | | | | | | | | | Currently when the user doesn't specify a branch to the run command, for apps it will use the current branch and for runtimes it just tries to use "master" and fails if that doesn't work. Since runtimes don't have current branches, it would be nice if we could determine the right one to use rather than just erroring out. So this commit changes the implementation so that it looks at each installed runtime and if only one matches it is used. If there's more than one match the user is prompted to choose. This is the first interactivity added to the run command but I don't think that's an issue; any time it's run in a non-interactive shell it will error out upon encountering ambiguity. Also, add a couple unit tests for the success path and error paths. Fixes https://github.com/flatpak/flatpak/issues/2780 Closes: #2788 Approved by: matthiasclasen
* tests: Add ability to test a branch other than masterMatthew Leeds2019-03-301-68/+68
| | | | | | | | | | This commit makes it so that a unit test can create the test app and runtime using a branch other than master, and changes test-run.sh to use the branch "stable". This will allow the run command to be tested better in the following commit. Closes: #2788 Approved by: matthiasclasen
* test scripts: Don't assume we are running on x86_64Simon McVittie2018-11-291-1/+1
| | | | | | | | | These tests failed on other architectures. Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #2353 Approved by: matthiasclasen
* Add a test for the build-finish --sdk optionMatthias Clasen2018-10-231-1/+16
| | | | | | | This runs a few otherwise unused functions. Closes: #2252 Approved by: matthiasclasen
* tests: Add a test for multi-updates and required versionAlexander Larsson2018-10-171-0/+23
| | | | | | I had a report of (and old version of) flatpak stopping an entire "flatpak update" because one app had a new required version. This adds a test of this (and it seems fixed now).
* tests: Don't skip if no user xattrsAlexander Larsson2018-06-291-1/+0
| | | | | | | We don't require these anymore Closes: #1839 Approved by: alexlarsson
* Cli transaction: Print the full uninstall/install/update lists in readyAlexander Larsson2018-06-191-13/+13
| | | | | | | | This lets you see what operations will happen and you can confirm it before starting the heavy operations. Closes: #1797 Approved by: alexlarsson
* Tests: Ensure that all ostree commits produce valid bare-user-only reposAlexander Larsson2018-05-221-2/+4
| | | | | | | | In particular the non-canonical checks were failing for me due to selinux attributes being picked up. Closes: #1698 Approved by: alexlarsson
* Bump version to 0.9.98.1Alexander Larsson2017-09-261-1/+1
|
* Skip system-mode tests (only) if /var/tmp doesn't support xattrsSimon McVittie2017-08-311-0/+1
| | | | | | This partially reverts commit a53a752a354a569b8cd4a1bb19e2cbfd837aac12. Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Don't require user xattrsSimon McVittie2017-08-311-1/+0
| | | | | | | Since Flatpak 0.9.6, we use libostree in bare-user-only mode, which does not rely on xattrs. Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Add tests for no world writable dirs & no setuid filesAlexander Larsson2017-06-191-1/+31
|
* update: Only allow downgrades if a commit is explicitly specifiedAlexander Larsson2017-04-031-1/+14
| | | | | | | | 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.
* tests: Move the test repo to a subdirectory (repos/test)Alexander Larsson2017-01-121-8/+8
| | | | | | | | | | | 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.
* build-finish: Add --require-version and handling of itAlexander Larsson2016-12-141-2/+38
| | | | | This means that clients will refuse to install or update to your new app if the flatpak version they are using is too old.
* build-finish: Support exporting more than hicolor iconsAlexander Larsson2016-10-181-0/+2
| | | | We really want apps to be able to export e.g. HighContrast icons too.
* tests: Test install/updates with static deltasAlexander Larsson2016-06-281-0/+3
|
* test-run: avoid testing cases of filesystem binding that won't workSimon McVittie2016-06-161-13/+88
| | | | | | | | | | | | | | | | | | | | | | | 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>
* tests: Test changing the subpaths on updateAlexander Larsson2016-06-071-1/+38
|
* Add tests for subpathsAlexander Larsson2016-06-031-1/+45
|
* Skip tests that make a repository if /var/tmp lacks user xattrsSimon McVittie2016-05-231-0/+1
| | | | Signed-off-by: Simon McVittie <smcv@debian.org>
* tests: skip running flatpak at build time if bwrap doesn't workSimon McVittie2016-05-171-0/+2
| | | | | | | 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>
* tests: package_version.txt is in the $builddirSimon McVittie2016-05-171-6/+6
| | | | Signed-off-by: Simon McVittie <smcv@debian.org>
* tests: Add test-run-system.shAlexander Larsson2016-05-171-20/+23
|
* test-run: Split null update to its own testAlexander Larsson2016-05-171-2/+3
|
* tests: Put --user in an env varAlexander Larsson2016-05-171-14/+14
| | | | This means we can optionally skip it
* tests: Add test for updateAlexander Larsson2016-05-171-1/+21
|
* Rename everything but the on-disk location to flatpakAlexander Larsson2016-05-091-13/+13
|
* tests: Fix installed testsAlexander Larsson2016-05-021-11/+11
|
* tests: Add tests for list/info commandsAlexander Larsson2016-05-021-0/+10
|
* tests: Add namespace and overrides testsAlexander Larsson2016-05-021-1/+33
|