summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | test-concurrency: Lower lock timeoutDan Nicholson2021-06-051-2/+6
| | | | | | | | | | | | | | If there's a locking issue in this test, then it's likely not going to resolve after a few seconds of serializing access. Lower the default 30 second lock timeout to 5 seconds to prevent the test from hanging unnecessarily.
* | repo: Require lock type in ostree_repo_lock_popDan Nicholson2021-06-051-3/+3
| | | | | | | | | | | | | | | | This simplifies the lock state management considerably since the previously pushed type doesn't need to be tracked. Instead, 2 counters are kept to track how many times each lock type has been pushed. When the number of exclusive locks drops to 0, the lock transitions back to shared.
* | repo: Make locking APIs publicColin Walters2021-06-052-0/+34
| | | | | | | | | | | | | | | | Doing anything even somewhat sophisticated requires this; turns out our own `ostree prune` CLI wants this, e.g. https://github.com/ostreedev/ostree/issues/2337 Closes: https://github.com/ostreedev/ostree/issues/2286
* | tests/gpg: Don't assert subkey expiration when only primary expiredDan Nicholson2021-05-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In gnupg 2.3.0[1], if a primary key is expired and a subkey does not have an expiration or its expiration is older than the primary key, the subkey's expiration will be reported as the primary's. Previously a subkey without an expiration would not report one regardless of the primary key's expiration. This caused a regression in a test setting an expiration on a primary key. The test was checking that the subkey was not expired by asserting that there was no `Key expired` line in the signature verification output. With gnupg 2.3.0+, it will show as expired, causing the test to fail. Remove the assertion since it's not consistent across gnupg versions. In practice we don't care whether the subkey is considered expired or not as long as the signature verification fails when the primary key is expired. 1. https://dev.gnupg.org/T3343 Fixes: #2359
* | ci: Fix staged-delay to work with newer systemdColin Walters2021-05-251-1/+1
| | | | | | | | | | Yeah, we should stop parsing the text; I need to dig at that at some point.
* | *: rename master branch to main (external repos)Timothée Ravier2021-05-071-1/+1
| |
* | *: rename master to main in tests & examplesTimothée Ravier2021-05-0729-180/+180
| |
* | pull: Cleanly error out on unknown schemesColin Walters2021-04-271-2/+10
|/ | | | | | | | Previous to this we'd trip an assertion `abort()` deep in the curl code if e.g. a user did `ostree remote add foo htttp://...` etc. Motivated by considering supporting "external remotes" where code outside ostree does a pull, but we want to reuse the signing verification infrastructure.
* tests: Test without a cache directory by defaultDan Nicholson2021-04-194-0/+14
| | | | | | | | | | | | | | | | | | | 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
* libtest: On failure, make it clearer what has happenedSimon McVittie2021-04-181-0/+8
| | | | | | | | If we fail as a result of `set -x`, It's often not completely obvious which command failed or how. Use a trap on ERR to show the command that failed, and its exit status. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge pull request #2343 from cgwalters/cargo-workspaceColin Walters2021-04-154-4/+15
|\ | | | | build-sys: Add toplevel workspace Cargo.toml
| * tests/inst: Make nondestructive tests runnable as unit testsColin Walters2021-04-152-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Ideally in the future we change more of our unit tests to support running installed; we've tried this in the past with https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests I'd like to pick that back up again. This takes a step towards that by having our Rust tests. To make this even easier, add a `tests/run-installed` which runs the installed tests (uninstalled, confusingly but conveniently for now).
| * build-sys: Add toplevel workspace Cargo.tomlColin Walters2021-04-152-3/+1
| | | | | | | | | | | | | | | | | | rust-analyzer is happier with this because it understands the project structure out of the box. We aren't actually again adding a dependency on Rust/cargo in the core, this is only used to make `cargo build` work out of the box to build the Rust test code.
* | Release 2021.2v2021.2Colin Walters2021-04-151-1/+1
|/
* tests: More tests for inline writingColin Walters2021-04-091-1/+21
| | | | I'm hitting a bug, add more tests.
* repo: Add ostree_repo_write_regfileColin Walters2021-04-092-8/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | This API is push rather than pull, which makes it much more suitable to use cases like parsing a tar file from external code. Now, we have a large mess in this area internally because the original file writing code was pull based, but static deltas hit the same problem of wanting a push API, so I added this special `OstreeRepoBareContent` just for writing regular files from a push API. Eventually...I'd like to deprecate the pull based API, and rework things so that for regular files the push API is the default, and then `write_content_object()` would be split up into archive/bare cases. In this world the `ostree_repo_write_content()` API would then need to hackily bridge pull to push and it'd be less efficient. Anyways for now due to this bifurcation, this API only works on non-archive repositories, but that's fine for now because that's what I want for the `ostree-ext-container` bits.
* repo: Add ostree_repo_write_symlinkColin Walters2021-04-082-0/+13
| | | | | | | Continuation of the addition of `ostree_repo_write_regfile_inline()`. This will be helpful for ostree-rs-ext and importing from tar, it's quite inefficient and awkward for small files to end up creating a whole `GInputStream` and `GFileInfo` and etc. for small files.
* Merge pull request #2327 from cgwalters/writing-apisColin Walters2021-04-082-1/+57
|\ | | | | repo: Add ostree_repo_write_regfile_inline
| * repo: Add ostree_repo_write_regfile_inlineColin Walters2021-04-082-1/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When working on ostree-ext and importing from tar, it's quite inefficient and awkward for small files to end up creating a whole `GInputStream` and `GFileInfo` and etc. for small files. Plus the gtk-rs binding API to map from `impl Read` to Gio https://docs.rs/gio/0.9.1/gio/struct.ReadInputStream.html requires that the input stream is `Send` but the Rust `tar` API isn't. This is only 1/3 of the problem; we also need similar APIs to directly create a symlink, and to stream large objects via a push-based API.
* | Merge pull request #2330 from cgwalters/silence-libarchive-warningLuca Bruno2021-04-081-1/+2
|\ \ | | | | | | tests: Silence a gcc warning
| * | tests: Silence a gcc warningColin Walters2021-04-081-1/+2
| |/ | | | | | | We can't mix `goto` and `__attribute__((cleanup))`.
* | Merge pull request #2324 from cgwalters/test-use-exLuca Bruno2021-04-083-20/+22
|\ \ | | | | | | Various patches for tests/inst
| * | tests/inst: Update tokio, hyper and nixColin Walters2021-04-073-7/+8
| | |
| * | tests/inst: Update rpm-ostree clientColin Walters2021-04-072-5/+9
| | |
| * | tests/inst: Update ostree crateColin Walters2021-04-072-4/+5
| | |
| * | tests: Drop openat overrideColin Walters2021-04-071-4/+0
| |/ | | | | | | No longer needed.
* | build-sys: Remove --enable-experimental-apiColin Walters2021-04-072-18/+2
|/ | | | | | | | | It was added for the collections bits, but we made that stable. It's now just cruft and we're very unlikely to reuse the infrastructure again. Motivated by a unit test failure when running from a tarball: https://github.com/ostreedev/ostree/issues/2313
* rofiles-fuse: Enable support for setting and getting xattrsStefan Berger2021-04-051-1/+21
| | | | | | | | Enable support for setting and getting xattrs. Allow modifications to xattrs only on user.ima xattr. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Co-authored-by: Colin Walters <walters@verbum.org>
* cci: Update for buildroot changesColin Walters2021-03-311-2/+2
| | | | See latest in https://github.com/coreos/fedora-coreos-tracker/blob/master/docs/ci-and-builds.md
* tests/pull-test: Use mv -f in a few casesColin Walters2021-03-311-3/+3
| | | | | For some reason I'm hitting this locally because some files are mode `0`. Which is clearly a different bug but anyways we don't want to prompt.
* Release 2021.1v2021.1Colin Walters2021-03-231-1/+1
|
* tests/inst: Patch to use my PR for openatColin Walters2021-03-191-0/+4
| | | | Fixes the build.
* Merge pull request #2301 from cgwalters/api-require-bootedColin Walters2021-03-181-1/+1
|\ | | | | sysroot: Add _require_booted_deployment() API
| * sysroot: Add _require_booted_deployment() APIColin Walters2021-03-171-1/+1
| | | | | | | | | | This is a common pattern that is replicated both in our code and in rpm-ostree a lot. Let's add a canonical API.
* | tests/inst: cargo fmtColin Walters2021-03-172-13/+12
| |
* | tests/inst: Fix lots of `cargo clippy` warningsColin Walters2021-03-173-37/+30
|/ | | | Prep for doing this in CI.
* Add an API+CLI to inject metadata for bootable OSTree commitsColin Walters2021-03-123-4/+20
| | | | | | | | | | | | | | | | | | | | | I was doing some rpm-ostree work and I wanted to compare two OSTree commits to see if the kernel has changed. I think this should be a lot more natural. Add `ostree commit --bootable` which calls into a new generic library API `ostree_commit_metadata_for_bootable()` that discovers the kernel version and injects it as an `ostree.linux` metadata key. And for extra clarity, add an `ostree.bootable` key. It's interesting because the "core" OSTree layer is all about generic files, but this is adding special APIs around bootable OSTree commits (as opposed to e.g. flatpak as well as things like rpm-ostree's pkgcache refs). Eventually, I'd like to ensure everyone is using this and hard require this metadata key for the `ostree admin deploy` flow - mainly to prevent accidents.
* Merge pull request #2285 from cgwalters/log-bootloader-stuffOpenShift Merge Robot2021-02-281-1/+1
|\ | | | | deploy: Add subbootversion to journal
| * deploy: Add subbootversion to journalColin Walters2021-02-281-1/+1
| | | | | | | | | | | | To help debug an issue we've seen where `/boot` isn't in sync with the `/ostree/boot` dir, let's log to the journal what we're doing.
* | Merge pull request #2284 from cgwalters/use-rpmostree-clientOpenShift Merge Robot2021-02-264-57/+6
|\ \ | |/ |/| tests/inst: Switch to rpmostree-client from git
| * tests/inst: Switch to rpmostree-client from gitColin Walters2021-02-234-57/+6
| | | | | | | | | | See discussion in https://github.com/coreos/rpm-ostree/pull/2569#issuecomment-780569188 Currently pinned to a hash, but after the next stable release let's switch to tags
* | Add --enable-sanitizers, fix `make check` with itColin Walters2021-02-031-0/+3
|/ | | | | | | | It's cleaner if this is an build option rather than being kludged into the CI layer. Notably we can't use `LD_PRELOAD` anymore with ASAN, so update our tests to check for `ASAN_OPTIONS`.
* tests/ext/destructive: enhance test logicLuca BRUNO2021-02-032-8/+29
| | | | | | This enhances external-tests logic, ensuring that destructive tests have retries and some context to pinpoint failures, and that failed-state services are reset between iterations.
* pull: Fix local pull with depth and truncated source historyDan Nicholson2021-01-121-1/+33
| | | | | | | | | The local pull path was erroring on any missing commit, but that prevents a depth pull where the source repo has truncated history. As in the remote case, this also tries to pull in a tombstone commit if the source repo supports it. Fixes: #2266
* pull: Error on depth pull with missing head commitDan Nicholson2021-01-121-1/+33
| | | | | | | | | | | | | | | | | When pulling with depth, missing parent commits are ignored. However, the check was applying to any commit, which means that it would succeed even if the requested commit was missing. This might happen on a corrupted remote repo or when using ref data from a stale summary. To achieve this, the semantics of the `commit_to_depth` hash table is changed slightly to only ever includes parent commits. This makes it easy to detect when a parent commit is being referenced (although there is a minor bug there when multiple refs are being pulled) while keeping references to commits that need their `commitpartial` files cleaned up. It also means that the table is only populated on depth pulls, which saves some memory and processing in the common depth=0 case. Fixes: #2265
* tests: Ensure no dangling commit partials on remote depth pullDan Nicholson2021-01-111-0/+10
| | | | | This was already being done on the local depth pull test, so this just adds the matching logic to the remote depth pull test.
* pull: Allow disabling commit binding verificationDan Nicholson2020-12-171-2/+10
| | | | | | | | | | | | | | | | In some cases such as backups or mirroring you may want to pull commits from one repo to another even if there commits that have incorrect bindings. Fixing the commits in the source repository to have correct bindings may not be feasible, so provide a pull option to disable verification. For Endless we have several repositories that predate collection IDs and ref bindings. Later these repositories gained collection IDs to support the features they provide and ref bindings as the ostree tooling was upgraded. These repositories contain released commits that were valid to the clients they were targeting at the time. Correcting the bindings is not really an option as it would mean invalidating the repository history.
* 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>
* Merge pull request #2242 from stb-tester/tarball-import-xattrsOpenShift Merge Robot2020-11-171-0/+89
|\ | | | | ostree commit --tree=tar: Import xattrs from tarballs
| * ostree commit --tree=tar: Import xattrs from tarballsWilliam Manley2020-11-171-0/+89
| | | | | | | | | | If you specify an `xattr_callback` the xattrs will still be taken from there for now.