summaryrefslogtreecommitdiff
path: root/Makefile-tests.am
Commit message (Collapse)AuthorAgeFilesLines
* main: add support for CLI extensions via external binariesLuca BRUNO2021-12-201-0/+1
| | | | | | | | | | This adds some logic to detect and dispatch unknown subcommands to extensions available in `$PATH`. Additional commands can be implemented by adding relevant `ostree-$verb` binaries to the system. As an example, if a `/usr/bin/ostree-extcommand` extension is provided, the execution of `ostree extcommand --help` will be dispatched to that as `ostree-extcommand extcommand --help`.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* Add an API to verify a commit signature explicitlyColin Walters2021-08-301-0/+4
| | | | | | | | | | | | | We have a bunch of APIs to do GPG verification of a commit, but that doesn't generalize to signapi. Further, they require the caller to check the signature status explicitly which seems like a trap. This much higher level API works with both GPG and signapi. The intention is to use this in things that are doing "external pulls" like the ostree-ext tar import support. There we will get the commitmeta from the tarball and we want to verify it at the same time we import the commit.
* bin/remote: Rename list-gpg-keys to gpg-list-keysDan Nicholson2021-08-231-1/+1
| | | | | | | | | | | | | | | As pointed out in the original review, `gpg-list-keys` fits better alongside the existing `gpg-import`. Changes were done with: ``` git grep -l list-gpg-keys | xargs sed -i 's/list-gpg-keys/gpg-list-keys/' for src in $(git ls-files '*list-gpg-keys*'); do dst=${src/list-gpg-keys/gpg-list-keys} git mv "$src" "$dst" done ```
* bin/remote: Add list-gpg-keys subcommandDan Nicholson2021-07-151-0/+1
| | | | | | | | This provides a wrapper for the `ostree_repo_remote_get_gpg_keys` function to show the GPG keys associated with a remote. This is particularly useful for validating that GPG key updates have been applied. Tests are added, which checks the `ostree_repo_remote_get_gpg_keys` API by extension.
* lib/commit: respect SOURCE_DATE_EPOCH for commit timestampLuca BRUNO2021-06-221-0/+1
| | | | | | | | | This tweaks `ostree_repo_write_commit` so that it checks for the envinroment variable `SOURCE_DATE_EPOCH` as a way to override the current time, which is used as the commit timestamp. Ref: https://reproducible-builds.org/docs/source-date-epoch/ Ref: https://reproducible-builds.org/specs/source-date-epoch/
* tests/inst: Make nondestructive tests runnable as unit testsColin Walters2021-04-151-0/+3
| | | | | | | | | | | | | 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: Remove --enable-experimental-apiColin Walters2021-04-071-8/+0
| | | | | | | | | 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
* tests: Split RFC 2616 date parsing code out and add testsPhilip Withnall2020-10-221-1/+8
| | | | | | | This makes it testable, and increases its test coverage too 100% of lines, as measured by `make coverage`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* tests: Add simple test for summary file cachingPhilip Withnall2020-10-221-0/+1
| | | | | | | | | | | | | | This test would have actually passed before the summary file caching changes (in the previous few commits) were added, as the `summary.sig` essentially acted as the ETag for the summary file, and itself wasn’t updated on disk if it didn’t change when querying the server. Actually testing that the HTTP caching headers are working to reduce HTTP traffic would require test hooks into the pull code or the trivial-httpd server, neither of which I have the time to add at the moment. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge pull request #2202 from cgwalters/bootcsum-dtbOpenShift Merge Robot2020-09-241-0/+1
|\ | | | | deploy: Remove deployment bootcsum assertion
| * deploy: Remove deployment bootcsum assertionColin Walters2020-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When support for devicetree was added, it created a problem because old and new ostree versions would compute different checksums for the "boot data". The scenario here is: - Have system with ostree < 2020.4 - Reboot into system with ostree 2020.5 - Try to perform an operation that would retain that previous booted deployment (common) Currently ostree iterates over all the deployments that will be retained and calls `install_deployment_kernel()`, even for the booted one (which is a bit silly), but just to verify that all boot data for the targeted deployments are installed. This then re-computes the checksum and we'd trip this assertion. In practice though, we don't strictly require them to match; the only thing that will happen if they don't is that we'll end up with another copy of the kernel/initramfs - and that only temporarily until the previous deployment gets GC'd. Longer term, I think what we really want to do anyways is probably closer to like a little ostree repo for `/boot` so that we can e.g. still hardlink kernels there even if the initramfs changes, or hardlink both kernel/initramfs if just the devicetree changes, etc. Closes: https://github.com/ostreedev/ostree/issues/2154
* | tests/delta: new tests for 'ed25519' signed deltasFrédéric Danis2020-09-141-0/+1
| | | | | | | | | | | | | | Add tests to generate signed deltas and verify them using 'ed25519' signature engine. Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
* | tests/delta: new tests for signed deltasFrédéric Danis2020-09-141-0/+1
|/ | | | | | | Add tests to generate signed deltas and verify them using 'dummy' signature engine. Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
* tests: Add a pre-signed-pull.sh testColin Walters2020-06-111-0/+2
| | | | | | | | | | | | | | | | I'm thinking about adding an implementation of ed25519 signatures with OpenSSL (so we can ship the feature with Fedora CoreOS without requiring an additional library) and in preparation for that it's essential that we validate that libsodium-generated signatures and OpenSSL-generated signatures are compatible. I don't know if they are yet actually, but the goal of this new test is to add a pre-generated repository with a signed commit generated by libsodium. This will catch if e.g. there's ever a change in libsodium, or if existing libsodium implementation versions (e.g. the one in Debian) might differ from what we ship here.
* ci: Install kola testsColin Walters2020-05-151-0/+7
| | | | | | | | | | | This builds on https://github.com/coreos/coreos-assembler/pull/1441 to install our tests rather than running them from the source directory. This model will more cleanly allow us to ship our tests along with a test container or elsewhere, separate from the source directory. Also prep for https://github.com/ostreedev/ostree/pull/2048
* deploy: Add --no-mergeColin Walters2020-04-221-0/+1
| | | | | | | | | All of the underlying libostree APIs have supported passing `NULL` for a merge deployment for...a long time. But we never plumbed it up into the CLI. Add a `--no-merge` option to aid people who want to do a "factory reset": https://github.com/ostreedev/ostree/issues/1793
* tests/sign: new test for summary file verificationDenis Pynkin2020-03-251-5/+1
| | | | | | | Add test for signature verification of summary file during the pull. Adopted version of GPG tests from `test-pull-summary-sigs.sh`. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
* tests/sign: add initial test for pullingDenis Pynkin2020-03-251-0/+6
| | | | | | Test if we pull signed commits from remote. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
* tests: add test for commits sign/verificationDenis Pynkin2020-03-251-0/+1
| | | | | | | | | | | | Add tests checking: - sign mechanism is in working state - module 'dummy' is able to sign/verify commit - module 'ed25519' is able to sign/verify commit - both modules could be used for the same commit - 'ostree sign' builtin works with commits - 'ostree commit' builtin able to sign commits Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
* Merge pull request #1957 from dbnicholson/commit-sizesOpenShift Merge Robot2020-01-271-1/+5
|\ | | | | Upstream Endless sizes metadata changes
| * bin/show: Add --print-sizes option to show sizes metadataDan Nicholson2020-01-201-0/+1
| | | | | | | | | | Use the new `ostree_commit_get_object_sizes()` API to read the `ostree.sizes` commit metadata and print a summary.
| * core: Add ostree_commit_get_object_sizes APIDan Nicholson2020-01-201-1/+4
| | | | | | | | | | | | | | | | | | This function parses the object listing in the `ostree.sizes` metadata and returns an array of `OstreeCommitSizesEntry` structures. Unfortunately, for reasons I don't understand, the linker wants to resolve `_ostree_read_varuint64` from `ostree-core.c` even though it's not used by `test-checksum.c` at all.
* | tests/gpg-verify-data: Split out signature dataDan Nicholson2020-01-241-1/+2
| | | | | | | | | | | | | | The full block with all 5 signatures remains, but this allows passing individual signatures through the GPG verification APIs. The split was done with `gpgsplit`, and looking at the output of `gpg --list-packets` of the split and unsplit files appears correct.
* | tests/gpghome: Create revocation certificates for keysDan Nicholson2020-01-241-0/+6
|/ | | | | | | These can then be imported during a test to revoke a key without trying to go through the gpg --generate-revocation dialog. Note that these need to go in a subdirectory of the homedir since `gpgkeypath` will try to import every regular file in the homedir.
* pull: Add support for basic authColin Walters2019-12-021-0/+1
| | | | | This has been requested a few times for people delivering OSTree content and wanting to do access control.
* fsck: Add test for --delete corruption, fix repair, and partial commit checksJason Wessel2019-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ostree fsck test is aimed to check that it will still fail an fsck if the repository has been repaired by fsck. It also checks that a pull operation corrects the error and ostree fsck will exit with zero. The test was modeled after the following script: rm -rf ./f1 mkdir -p ./f1 ./ostree --repo=./f1 init --mode=archive-z2 mkdir -p ./trial echo test > ./trial/test ./ostree --repo=./f1 commit --tree=dir=./trial --skip-if-unchanged --branch=exp1 --subject="test Commit" rm -rf ./f2 mkdir -p ./f2 ./ostree --repo=./f2 init ./ostree --repo=./f2 pull-local ./f1 echo whoops > `find ./f2 |grep objects |grep \\.file ` ./ostree fsck --repo=./f2 ; echo Exit: $? ./ostree fsck --delete --repo=./f2 ; echo Exit: $? ./ostree fsck --repo=./f2 ; echo Exit: $? ./ostree --repo=./f2 pull-local ./f1 ./ostree fsck --repo=./f2 ; echo Exit: $? Signed-off-by: Jason Wessel <jason.wessel@windriver.com> fsck: Update test so that it will pass on fs without xattrs The fsck test does not require xattrs to prove that it works. It is simple enough to change it to use an archvie instead of a bare type repository. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Closes: #1910 Approved by: cgwalters
* build: Conditionally build the GPG-related testsDenis Pynkin2019-08-011-5/+23
| | | | | | | | | | Do not build GPG signing/verification tests if `--without-gpgme` option is used during configuration. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com> Closes: #1889 Approved by: cgwalters
* lib/kargs: Make API public and upstream new rpm-ostree APIsAllen Bai2019-06-181-1/+5
| | | | | | | | | | | | | | | | This change makes public the current kargs API in src/libostree/ostree-kernel-args.c and adds documentations. Upstreams the new kargs API from rpm-ostree/src/libpriv/rpmostree-kargs-process.c Merges libostree_kernel_args_la_SOURCES to libostree_1_la_SOURCES in Makefile-libostree.am Upstreams tests/check/test-kargs.c from rpm-ostree. Closes: #1833 Closes: #1869 Approved by: jlebon
* Add sysroot.bootloader repo config keyRobert Fairley2019-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The sysroot.bootloader key configures the bootloader that OSTree uses when deploying a sysroot. Having this key allows specifying behavior not to use the default bootloader backend code, which is preferable when creating a first deployment from the sysroot (#1774). As of now, the key can take the values "auto" or "none". If the key is not given, the value defaults to "auto". "auto" causes _ostree_sysroot_query_bootloader() to be used when writing a new deployment, which is the original behavior that dynamically detects which bootloader to use. "none" avoids querying the bootloader dynamically. The BLS config fragments are still written to sysroot/boot/loader/entries for use by higher-level software. More values can be supported in future to specify a single bootloader, different behavior for the bootloader code, or a list of bootloaders to try. Resolves: #1774 Closes: #1814 Approved by: jlebon
* admin/status: test GPG signature checkRafael Fonseca2019-01-081-0/+1
| | | | | | | Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com> Closes: #1797 Approved by: cgwalters
* src/ostree: Add --group option to ostree configSinny Kumari2018-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | Fetching value from a repo config using 'ostree config get SECTIONNAME.KEYNAME' didn't work in some cases like when having dots in Group Name entry. As per Desktop entry file specification, Group Name may contain all ASCII characters except for [ and ] and control characters. Link - https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html Having --group option will help user to clearly specify Group Name and get desired result. It also adds test for ostree config get|set and bash completion for --group option Fixes https://github.com/ostreedev/ostree/issues/1565 Closes: #1696 Approved by: cgwalters
* Avoid race condition in case tests directory does not existStefan Agner2018-08-141-1/+2
| | | | | | | | | | Make sure the tests directory exists before symlinking files into it. Closes: #1703 Closes: #1704 Approved by: cgwalters
* deploy: Delete .updated file from /etc and /var on new deploymentsDan Nicholson2018-06-181-0/+1
| | | | | | | | | | | | | | | | | | | Systemd units using ConditionNeedsUpdate run if the mtime of .updated in the specified directory is newer than /usr. Since /usr has an mtime of 0, there's no way to have an older .updated file. Systemd units typically specify ConditionNeedsUpdate=/etc or ConditionNeedsUpdate=/var to support stateless systems like ostree. Remove the file from the new deployment's /etc and the OS's /var regardless of where they came from to ensure that these systemd units run when booting new deployments. This will provide a method to run services only on upgrade. Closes: #1628 https://bugzilla.gnome.org/show_bug.cgi?id=752950 Closes: #1631 Approved by: cgwalters
* tests: Add test for including ostree.hMatthew Leeds2018-06-071-1/+8
| | | | | Closes: #1615 Approved by: jlebon
* Make P2P API public (no longer experimental)Matthew Leeds2018-06-041-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the API that allows P2P operations (e.g. pulling an ostree ref from a LAN or USB source) is hidden behind the configure flag --enable-experimental-api. This commit makes the API public and makes that flag essentially a no-op (leaving it in place in case we want to use it again in the future). The P2P API has been tested over the last several months and proven to work. This means that since we're no longer using the "experimental" feature flag, P2P builds of Flatpak will fail when using versions of OSTree from this commit onwards, until Flatpak is patched in the near future. If you want to build Flatpak < 0.11.8 with P2P enabled and link against OSTree 2018.6, you'll have to patch Flatpak. However, since Flatpak won't yet have a hard dependency on OSTree 2018.6, it needs a new way to determine if the P2P API in OSTree is available, so this commit adds a "p2p" feature flag. This way the feature set is more semantically correct than if we had continued to use the "experimental" feature flag. In addition to making the P2P API public, this commit makes the P2P unit tests run by default, removes the f27-experimental CI instance that's no longer needed, changes a few man pages to reflect the changes, and updates the bash completion script to accept the new commands and options. Closes: #1596 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
* tests: Add a test case for path traversal in a dirtreeColin Walters2018-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | I was reading about a recent security issue with both EMC and VMWare: https://arstechnica.com/information-technology/2018/01/emc-vmware-security-bugs-throw-gasoline-on-cloud-security-fire/ It's a classic path traversal problem, and that made me think more about our handling of this in libostree. Fortunately of course, not being new to this rodeo, long ago I *did* consider path traversal. Inside the pull code, we call `ot_util_filename_validate()`. Also, `fsck` does this too. I have further followups here, but let's add some test cases for this. I crafted a repository with a `../` in a dirtree object by patching libostree to inject it, and that's included as a tarball. This patch covers the two cases where we do already have checks; pulling via HTTP, and in `fsck`. Closes: #1412 Approved by: jlebon
* Support for booting without initramfsGatis Paeglis2018-01-101-0/+1
| | | | | | | | | | | | | | | Previously when initramfs-* was not found in a deployment's boot directory, it was assumed that rootfs is prepared for ostree booting by a kernel patch. With this patch, the behaviour changes to be - if initramfs-* is not found, assume that system is using a static ostree-prepare-root as init process. Booting without initramfs is a common use case on embedded systems. This approach is also more convenient, than having to patch the kernel. Closes: #1401 Approved by: cgwalters
* build-sys: Allow building with curl, but without libsoupAnton Gerasimov2018-01-081-0/+8
| | | | | | | | | | | | Some people (particularly embedded) may find it simpler to drop libsoup from the build dependency side, but still use libcurl. Note though this currently neuters almost all of the tests. Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org> Closes: #1397 Approved by: cgwalters
* tests: Assert that byte-order is swapped on LE but not BE CPUsSimon McVittie2018-01-041-1/+7
| | | | | | | | Closes: #1392 Signed-off-by: Simon McVittie <smcv@collabora.com> Closes: #1393 Approved by: cgwalters
* tests: Test concurrent operationsColin Walters2017-12-051-0/+1
| | | | | | | | | | Test that concurrent commits and prunes can succeed. Mostly this is a check that the new locking works correctly and the concurrent processes will properly wait until they've acquired the appropriate repository lock. Closes: #1343 Approved by: cgwalters
* tests: Run python tests with stdout unbufferedDan Nicholson2017-12-011-0/+1
| | | | | | | | | | | Set the PYTHONUNBUFFERED environment variable during tests so that python leaves stdout unbuffered. This is helpful when reading logs for failures since the interleaved stdout and stderr will generally come out in the right order. It's not perfect since tap-driver.sh does some special redirection to the log file, but it's an improvement. Closes: #1352 Approved by: dbnicholson
* tests: Don't symlink rofiles-fuse if it's disabledDan Nicholson2017-11-031-1/+2
| | | | | | | | | | | | Creating the symlink will cause make to try to build rofiles-fuse, which will fail if it's disabled. Normally I wouldn't disable rofiles-fuse, but it's triggering a hang in our ARM Xenial builder's kernel in splice. I'm sure that's fuse's fault, but for now I just need to disable rofiles-fuse there and found --disable-rofiles-fuse didn't actually work. Closes: #1325 Approved by: cgwalters
* tests: Add a "pull-test2" that uses slightly more realistic contentColin Walters2017-11-011-0/+4
| | | | | | | | | | | | | | This one actually exercises the delta paths more; I pulled the data from some local F26AH builds. One thing I noticed while doing that is that we try bsdiff on xz'd data, but that won't be useful. https://github.com/projectatomic/rpm-ostree/issues/470 https://bugzilla.redhat.com/show_bug.cgi?id=1367496 Anyways I verified this test fails without the fixup for `pread()` in https://github.com/ostreedev/ostree/pull/1312 Closes: #1314 Approved by: jlebon
* tests: Add test-pull-bareuseronlyColin Walters2017-10-171-0/+1
| | | | | | | | | | | | I was going to fix a bug in the static deltas code and I noticed we were missing `pull-test.sh` coverage for bareuseronly 🙈. Obviously fixing this requires duplicating some of the bits we have in `basic-test.sh`; need to hoist that into `libtest.sh`. For now though let's get the coverage. Closes: #1270 Approved by: jlebon
* tests: Add a manual integration test for OstreeRepoFinderMountPhilip Withnall2017-09-281-0/+1
| | | | | | | | | | | | | | | | | | | | Test an end-to-end flow of pulling refs from an online repository → local OS repository → create a USB stick of them → pull to a local OS repository on another machine. This is a manual test, as it requires a throwaway USB stick which the test can format as ext4 or vfat to test the flow works with both file systems. Run it as: MOUNT_INTEGRATION_DEV=/dev/sdb1 make check \ TESTS=tests/test-repo-finder-mount-integration.sh Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1203 Approved by: cgwalters
* create-usb: Add a create-usb command to complement OstreeRepoFinderMountPhilip Withnall2017-09-271-0/+7
| | | | | | | | | | This can be used to put OSTree repositories on USB sticks in a format recognised by OstreeRepoFinderMount. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1182 Approved by: cgwalters
* lib/repo: Add ostree_repo_hash() and testsPhilip Withnall2017-09-211-1/+4
| | | | | | | | | | | | | | | Add a hash function for OstreeRepo instances, which relies on the repo being open, and hence being able to hash the device and inode of its root directory. Add unit tests for this and ostree_repo_equal(). Signed-off-by: Philip Withnall <withnall@endlessm.com> https://github.com/ostreedev/ostree/issues/1191 Closes: #1205 Approved by: cgwalters
* repo: Fix non-system remotes-config-dir usageDan Nicholson2017-09-081-0/+1
| | | | | | | | | | | | | Before commit e0346c1, a non-system repo could specify remotes-config-dir and have remotes read from there. However, adding remotes would only be done in the config dir for a system repo. Restore that by respecting remotes-config-dir when no sysroot is found and adding back the ostree_repo_is_system() check when adding remotes. Closes: #1133 Closes: #1151 Approved by: cgwalters