summaryrefslogtreecommitdiff
path: root/tests/kolainst
Commit message (Collapse)AuthorAgeFilesLines
* main: Also support CLI extensions in `/usr/libexec/libostree/ext`Colin Walters2022-01-111-0/+23
| | | | | | | | | | | | | In fixing https://github.com/coreos/rpm-ostree/pull/3323 I felt that it was a bit ugly we're installing `/usr/bin/ostree-container`. It's kind of an implementation detail. We want users to use `ostree container`. Let's support values outside of $PATH too. For example, this also ensures that TAB completion for `ost` expands to `ostree ` with a space.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-073-9/+3
|
* tests/var-mount: tweak test setupLuca BRUNO2021-10-191-6/+3
| | | | | | | | This reworks the var-mount destructive test in order to properly use the datadir for the current stateroot instead of a duplicated one. In turn, it ensures that the resulting `var.mount` after reboot is correctly pointing to the same location which hosted `/var` on the previous boot.
* deploy: Ignore sockets, fifos in /etc during mergeColin Walters2021-10-011-0/+20
| | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1945274 is an issue where a privileged kubernetes daemonset is writing a socket into `/etc`. This makes ostree upgrades barf. Now, they should clearly move it to `/run`. However, one option is for us to just ignore it instead of erroring out. Some brief investigation shows that e.g. `git add somesocket` is a silent no-op, which is an argument in favor of ignoring it. Closes: https://github.com/ostreedev/ostree/issues/2446
* bin/commit: Fix --tree=tar with --selinux-policyColin Walters2021-09-301-0/+13
| | | | | | | | | | | | The logic for `--selinux-policy` ended up in the `--tree=dir` path, but there's no reason for that. Fix the imported labeling with `--tree=tar`. Prep for use with containers. We had this bug because the previous logic was trying to avoid duplicating the code for generic `--selinux-policy` and the case of `--selinux-policy-from-base --tree=dir`. It's a bit more code, but it's cleaner if we dis-entangle them.
* tests: Add new TAP APIsColin Walters2021-09-101-0/+11
| | | | | | | | | | | Having to touch a global test counter when adding tests is a recipe for conflicts between PRs. The TAP protocol allows *ending* with the expected number of tests, so the best way to do this is to have an explicit API like our `tap_ok` which bumps a counter, then end with `tap_end`. I ported one test as a demo.
* upgrade: Stabilize deployment stagingColin Walters2021-09-071-4/+1
| | | | | | | | | | We're waaay overdue for this, it's been the default in rpm-ostree for years, and solves several important bugs around not capturing `/etc` while things are running. Also, `ostree admin upgrade --stage` (should) become idempotent. Closes: https://github.com/ostreedev/ostree/issues/2389
* Merge pull request #2377 from smcv/libtest-coreColin Walters2021-06-211-1/+28
|\ | | | | libtest-core: Add some improvements from bubblewrap
| * libtest-core: Mention bubblewrap as a user of this fileSimon McVittie2021-06-181-0/+1
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
| * libtest-core: Update URL of rpm-ostreeSimon McVittie2021-06-181-1/+1
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
| * libtest-core: On failure, make it clearer what has happenedSimon McVittie2021-06-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>
| * libtest-core: Add assert_files_equalAlexander Larsson2021-06-181-0/+18
| | | | | | | | | | | | [Originally from bubblewrap commits c5c999a7 "tests: test --userns" and 3e5fe1bf "tests: Better error message if assert_files_equal fails"; separated into this commit by Simon McVittie.]
* | Use generator to enable ostree-remount.service and ostree-finalize-staged.pathColin Walters2021-06-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We struggled for a long time with enablement of our "internal units", trying to follow the philosophy that units should only be enabled by explicit preset. See https://bugzilla.redhat.com/show_bug.cgi?id=1451458 and https://github.com/coreos/rpm-ostree/pull/1482 etc. And I just saw chat (RH internal on a proprietary system sadly) where someone hit `ostree-remount.service` not being enabled in CentOS8. Thinking about this more, I realized we've shipped a systemd generator for a long time and while its only role until now was to generate `var.mount`, but by using it to force on our internal units, we don't require people to deal with presets anymore. Basically we're inverting things so that "if ostree= is on the kernel cmdline, then enable our units" and not "enable our units, but have them use ConditionKernelCmdline=ostree to skip". Drop the weird gyrations we were doing around `ostree-finalize-staged.path` too; forking `systemctl start` is just asking for bugs. So after this, hopefully we won't ever again have to think about distribution presets and our units.
* | deploy: Warn if we find content in the deployment's /varColin Walters2021-06-101-0/+13
| | | | | | | | | | | | | | | | | | | | | | This will be ignored, so let's make it very clear people are doing something wrong. Motivated by a bug in a build pipeline that injected `/var/lib/rpm` into an ostree commit which ended up crashing rpm-ostree because it was an empty db which it wasn't expecting. It *also* turns out rpm-ostree is incorrectly dumping content in the deployment `/var` today, which is another bug.
* | 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.
* build-sys: Add toplevel workspace Cargo.tomlColin Walters2021-04-151-1/+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.
* 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
* 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.
* lib/deploy: Add support for overlay initrdsJonathan Lebon2020-09-301-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | In FCOS and RHCOS, the need to configure software in the initramfs has come up multiple times. Sometimes, using kernel arguments suffices. Other times, it really must be a configuration file. Rebuilding the initramfs on the client-side however is a costly operation. Not only does it add complexity to the update workflow, it also erodes a lot of the value obtained from using the baked "blessed" initramfs from the tree itself. One elegant way to address this is to allow specifying multiple initramfses. This is supported by most bootloaders (notably GRUB) and results in each initrd being overlayed on top of each other. This patch allows libostree clients to leverage this so that they can avoid regenerating the initramfs entirely. libostree itself is agnostic as to what kind and how much data overlay initrds contain. It's up to the clients to enforce such boundaries. To implement this, we add a new ostree_sysroot_stage_overlay_initrd which takes a file descriptor and returns a checksum. Then users can pass these checksums when calling the deploy APIs via the new array option `overlay_initrds`. We copy these files into `/boot` and add them to the BLS as another `initrd` entry.
* tests/inst: Add destructive test frameworkColin Walters2020-08-174-2/+39
| | | | | | | | | | | | | | | | This adds infrastructure to the Rust test suite for destructive tests, and adds a new `transactionality` test which runs rpm-ostree in a loop (along with `ostree-finalize-staged`) and repeatedly uses either `kill -9`, `reboot` and `reboot -ff`. The main goal here is to flush out any "logic errors". So far I've validated that this passes a lot of cycles using ``` $ kola run --qemu-image=fastbuild-fedora-coreos-ostree-qemu.qcow2 ext.ostree.destructive-rs.transactionality --debug --multiply 8 --parallel 4 ``` a number of times.
* Add "transient" unlockColin Walters2020-08-071-0/+34
| | | | | | | | | | | | | | | | | | | | | | I was thinking a bit more recently about the "live" changes stuff https://github.com/coreos/rpm-ostree/issues/639 (particularly since https://github.com/coreos/rpm-ostree/pull/2060 ) and I realized reading the last debates in that issue that there's really a much simpler solution; do exactly the same thing we do for `ostree admin unlock`, except mount it read-only by default. Then, anything that wants to modify it does the same thing libostree does for `/sysroot` and `/boot` as of recently; create a new mount namespace and do the modifications there. The advantages of this are numerous. First, we already have all of the code, it's basically just plumbing through a new entry in the state enumeration and passing `MS_RDONLY` into the `mount()` system call. "live" changes here also naturally don't persist, unlike what we are currently doing in rpm-ostree.
* tests: Add needs-internet tag for webserver bitsColin Walters2020-07-172-1/+4
| | | | | Fixes the tests, see https://github.com/coreos/coreos-assembler/pull/1600 TODO: provide a webserver binary via virtio or so
* tests: Port to Debian autopkgtest reboot APIColin Walters2020-06-194-24/+15
| | | | | | | | See https://github.com/coreos/coreos-assembler/pull/1528 I think we can drop the old cosa reboot APIs after this, though I've already forgotten where else I might have written tests using it.
* tests: Check that example symbol isn't releasedMatthew Leeds2020-06-171-0/+10
| | | | For the motivation for this see #2132.
* Add new Rust-based testsColin Walters2020-05-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a lot going on here. First, this is intended to run nicely as part of the new [cosa/kola ext-tests](https://github.com/coreos/coreos-assembler/pull/1252). With Rust we can get one big static binary that we can upload, and include a webserver as part of the binary. This way we don't need to do the hack of running a container with Python or whatever. Now, what's even better about Rust for this is that it has macros, and specifically we are using [commandspec](https://github.com/tcr/commandspec/) which allows us to "inline" shell script. I think the macros could be even better, but this shows how we can intermix pure Rust code along with using shell safely enough. We're using my fork of commandspec because the upstream hasn't merged [a few PRs](https://github.com/tcr/commandspec/pulls?q=is%3Apr+author%3Acgwalters+). This model is intended to replace *both* some of our `make check` tests as well. Oh, and this takes the obvious step of using the Rust OSTree bindings as part of our tests. Currently the "commandspec tests" and "API tests" are separate, but nothing stops us from intermixing them if we wanted. I haven't yet tried to write destructive tests with this but I think it will go well.
* tests/kola: Move to tests/kolainstColin Walters2020-05-2720-0/+1117
Follow the precedent set in https://github.com/coreos/rpm-ostree/pull/2106 and rename the directory, to more clearly move away from the "uninstalled" test model. Prep for Rust-based tests.