summaryrefslogtreecommitdiff
path: root/tests/test-pull-summary-sigs.sh
Commit message (Collapse)AuthorAgeFilesLines
* bin/remote-summary: Add options to show metadataDan Nicholson2023-02-071-0/+10
|
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* tests: Test without a cache directory by defaultDan Nicholson2021-04-191-0/+3
| | | | | | | | | | | | | | | | | | | Several tests generate summaries and then expect to use the generated summary immediately. However, this can cause intermittent test failures when they inadvertantly get a cached summary file. This typically happens when the test is run on a filesystem that doesn't support user extended attributes. In that case, the caching code can only use the last modified time, which only has 1 second granularity. If tests don't carefully manage the summary modification times or the repo cache then they are likely subject to races in some test environments. This introduces an environment variable `OSTREE_SKIP_CACHE` that prevents the repo from using a cache directory. This is enabled by default in tests and disabled for tests that are a explicitly trying to test the caching behavior. Fixes: #2313 Fixes: #2351
* test-pull-summary-sigs: Set timestamps to serve expected filesSimon McVittie2020-11-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | If this is not done, the test can fail when the temporary directory is a tmpfs: for example this happens during build-time testing with /var/tmp on tmpfs or TEST_TMPDIR pointing to a tmpfs, or installed-tests with gnome-desktop-testing-runner allocating the test directory on a tmpfs. In particular, many of Debian's official autobuilders now do the entire build and test procedure in a chroot hosted on a tmpfs, to improve build performance and prevent fsync overhead. In this situation, it appears that overwriting summary.sig with a copy of summary.sig.2 is not sufficient for the web server to tell the libostree client that it needs to be re-downloaded. I'm not completely sure why, because tmpfs does appear to have sub-second-resolution timestamps, but forcing a distinct mtime is certainly enough to resolve it. Resolves: https://github.com/ostreedev/ostree/issues/2245 Bug-Debian: https://bugs.debian.org/975418 Signed-off-by: Simon McVittie <smcv@collabora.com>
* lib/gpg: Add more specific OstreeGpgError codesDan Nicholson2020-01-241-1/+1
| | | | | | | | | | | | | | | | | Currently `ostree_gpg_verify_result_require_valid_signature` always returns an error that the key used for the signature is missing from the keyring. However, all that's been determined is that there are no valid signatures. The error could also be from an expired signature, an expired key, a revoked key or an invalid signature. Provide values for these missing errors and return them from `ostree_gpg_verify_result_require_valid_signature`. The description of each result is appended to the error message, but since the result can contain more than one signature but only a single error can be returned, the status of the last signature is used for the error code. See the comment for rationale. Related: flatpak/flatpak#1450
* tests/gpg: fix GPG-dependent shell tests if no GPG supportDenis Pynkin2019-08-011-2/+8
| | | | | | | | | | Skip tests or run them without GPG-related functionality if GPGME wasn't enabled in a build time. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com> Closes: #1889 Approved by: cgwalters
* tests: Always cleanup gpg-agent when exitingDan Nicholson2019-06-191-2/+0
| | | | | | | | | | | | | | | | Add `libtest_cleanup_gpg()` to the array of commands to run when exiting. This provides 2 improvements: 1. You don't need to worry about whether the test will spawn a gpg-agent and therefore require adding a call to `libtest_cleanup_gpg()`. 2. All the existing users were calling `libtest_cleanup_gpg()` at the end of the script. If there was a failure and the script exited early, then it wouldn't cleanup and there may be a stray gpg-agent hanging around. Closes: #1799 Approved by: cgwalters
* tests: Escape periods when appropriateMatthew Leeds2019-04-111-1/+1
| | | | | | | | Don't match any character in a regular expression when we only want to match a period. Closes: #1834 Approved by: rfairley
* repo: Add OSTREE_REPO_TEST_ERROR=invalid-cache env varDan Nicholson2018-08-141-0/+12
| | | | | | | | | | Add an invalid-cache test error flag to ensure that the code that checks for and recovers from a corrupted summary cache is hit. This helps make sure that the recovery path is actually used without resorting to G_MESSAGES_DEBUG. Closes: #1698 Approved by: cgwalters
* tests: Test for recovery from corrupted summary cacheDan Nicholson2018-08-141-1/+34
| | | | | | | | Check that recovery from a corrupted summary cache (cached summary doesn't match cached signature) works. Closes: #1698 Approved by: cgwalters
* tests: Add tests for remote summary update racesDan Nicholson2018-08-141-1/+80
| | | | | | | | | | There have been subtle bugs in the past when a client pulls while the remote server is updating the summary. The client may get the old summary and new signature or vice versa. Add tests to simulate this behavior to make sure there aren't regressions in the future. Closes: #1698 Approved by: cgwalters
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* tree-wide: Replace archive-z2 with archiveColin Walters2017-09-011-3/+3
| | | | | | | | | | | | In almost all places. There are just a few exceptions; one tricky bit for example is that the repo config must still have `mode=archive-z2`, since `archive` used to mean something else. (We could very likely just get rid of that check, but eh, later). I also added a test that one can still do `ostree repo init --mode=archive-z2`. Closes: #1125 Approved by: jlebon
* repo+tests: Add [core]disable-xattrs=true, use it on overlayfsColin Walters2017-03-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | There are a lot of things suboptimal about this approach, but on the other hand we need to get our CI back up and running. The basic approach is to - in the test suite, detect if we're on overlayfs. If so, set a flag in the repo, which gets picked up by a few strategic places in the core to turn on "ignore xattrs". I also had to add a variant of this for the sysroot work. The core problem here is while overlayfs will let us read and see the SELinux labels, it won't let us write them. Down the line, we should improve this so that we can selectively ignore e.g. `security.*` attributes but not `user.*` say. Closes: https://github.com/ostreedev/ostree/issues/758 Closes: #759 Approved by: jlebon
* libtest: add has_gpgme() helper functionJonathan Lebon2016-08-311-1/+1
| | | | | Closes: #469 Approved by: cgwalters
* Add OstreeRepo option for an out-of-band cache dirAlexander Larsson2016-04-141-1/+16
| | | | | | | | This allows you to have a writable cache dir even for a system-owned repository. Closes: #250 Approved by: cgwalters
* tests: Make failing to kill the GPG agent non-fatalColin Walters2016-03-311-1/+1
| | | | | | | | | | | | | It's not working for me in `make check` on a RHEL 7 Workstation, apparently because no GPG agent is spawned. I'm guessing this has something to do with the GPG version? The downside of this is we will be less likely to notice if GPG changes again and we start leaking agents like we're in The Matrix Reloaded. But the real solution to that is containers anyways. Closes: #233 Approved by: smcv
* In tests that use gpg, terminate the gpg-agent after testingSimon McVittie2016-03-311-0/+2
| | | | | | | | | Otherwise we leak those processes. Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #232 Approved by: cgwalters
* tests: add test for summary file cachingGiuseppe Scrivano2016-03-151-1/+18
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* tests: Port to glib-tap.mk, make `make check` run all of the testsColin Walters2016-03-031-0/+2
| | | | | | | | | | | | | | | | | | OSTree's code for testing predates the `glib-tap.mk` making its way into GLib. Let's switch to it, as it provides a number of advantages. By far the biggest advantage is that `make check` can start to run most of the tests *in addition* to having them work installed. This commit keeps the installed tests working, but `make check` turns out to be really broken because...our TAP usage has bitrotted to say the least. Fix that all up. Do some hacks so that the tests work uninstalled as well - in particular, `glib-tap.mk` and the bits encoded into `g_test_build_filename()` assume *recursive* Automake (blah). Work around that by creating a symlink when installed to loop back.
* tests: Use "bash strict mode"Colin Walters2016-01-271-1/+1
| | | | | | | | | | I noticed in the static deltas tests, there were some tests that should have been under `-o pipefail` to ensure we properly propagate errors. There were a few places where we were referencing undefined variables. Overall, this is clearly a good idea IMO.
* remote: Add "ostree remote summary" commandMatthew Barnes2015-12-171-0/+11
| | | | | | | | Downloads and prints a remote summary file and any signatures in an easy-to-read format, or alternatively with the --raw option, prints the summary GVariant data directly. https://bugzilla.gnome.org/show_bug.cgi?id=759250
* tests: prefix invocation of ostree with where missingGiuseppe Scrivano2015-11-161-10/+10
| | | | | | | | | | And add a syntax rule to avoid this in future. Fixed by: sed -i -e 's|^ostree |${CMD_PREFIX} ostree |g' tests/*.sh Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* pull: Error if gpg=true and summary is 404, add more testsColin Walters2015-06-271-8/+32
| | | | | | | | | | | | | | I did a quick audit pass through the pull code. What I focused on the most is the case where `gpg-verify-summary=true`, and in particular where `gpg-verify=false` too. This should be a valid and secure configuration. The primary change here is to error out very quickly if either `summary` or `summary.sig` are 404. Previously, we'd only error out if we were processing deltas. Expand the existing test case to cover this, plus invalid summary and invalid sig. (The test case was failing with current git master too).
* tests: Add a test-pull-summary-sigsColin Walters2015-06-021-0/+81
This is intended to cover non-mirroring usage of GPG + summary + deltas.