Colin Walters [Sun, 17 May 2020 18:17:37 +0000 (18:17 +0000)]
Add "transient" unlock
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.
OpenShift Merge Robot [Fri, 7 Aug 2020 17:24:58 +0000 (13:24 -0400)]
Merge pull request #2166 from pwithnall/summary-sig-downloads
pull: Add summary-{,sig-}bytes options to ostree_repo_pull()
Philip Withnall [Thu, 16 Jul 2020 15:16:37 +0000 (16:16 +0100)]
pull: Add summary-{,sig-}bytes options to ostree_repo_pull()
These allow the `summary` and `summary.sig` files to be cached at a
higher layer (for example, flatpak) between related pull operations (for
example, within a single flatpak transaction). This avoids
re-downloading `summary.sig` multiple times throughout a transaction,
which increases the transaction’s latency and introduces the possibility
for inconsistency between parts of the transaction if the server changes
its `summary` file part-way through.
In particular, this should speed up flatpak transactions on machines
with high latency network connections, where network round trips have a
high impact on the latency of an overall operation.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Philip Withnall [Wed, 15 Jul 2020 15:24:32 +0000 (16:24 +0100)]
pull: Improve formatting of pull options in documentation
Backticks improve all things.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
OpenShift Merge Robot [Wed, 5 Aug 2020 19:20:27 +0000 (21:20 +0200)]
Merge pull request #2163 from cgwalters/fix-ci
ci: Barf on unset umask
Colin Walters [Wed, 5 Aug 2020 14:17:53 +0000 (14:17 +0000)]
ci: Barf on unset umask
Since it's just not a sane thing to do and will cause various
failures in our test suite.
OpenShift Merge Robot [Tue, 4 Aug 2020 19:54:28 +0000 (21:54 +0200)]
Merge pull request #2159 from agners/show-parent
Show commit checksum of parent, if present
OpenShift Merge Robot [Mon, 3 Aug 2020 00:53:41 +0000 (20:53 -0400)]
Merge pull request #2160 from cgwalters/sysroot-ro
remount: Still remount /sysroot writable if not configured ro
OpenShift Merge Robot [Sun, 2 Aug 2020 14:29:45 +0000 (10:29 -0400)]
Merge pull request #2162 from cgwalters/fix-repo-finder
tests/repo-finder: Explicitly commit empty dir
OpenShift Merge Robot [Sun, 2 Aug 2020 13:02:06 +0000 (09:02 -0400)]
Merge pull request #2161 from cgwalters/fix-ci
ci: Fix ISO testing
Colin Walters [Sat, 1 Aug 2020 18:14:30 +0000 (18:14 +0000)]
ci: Fix ISO testing
Regression from
https://github.com/ostreedev/ostree/pull/2158/commits/
5d7f897908dbf7f471ddfdbd6c29a84ac6bc0bda
I'm not sure how (or if) this passed before, the job logs have
been GC'd.
This is a bit confusing but basically right now ostree/rpm-ostree's
CI jobs don't use `/srv/fcos` - it might make sense to port
these to `fcosBuild` but that needs investigation.
Colin Walters [Sat, 1 Aug 2020 18:47:36 +0000 (18:47 +0000)]
tests/repo-finder: Explicitly commit empty dir
We were committing the whole tempdir, which seems to fail
in Travis because the GPG agent Unix domain socket ends up there too,
and ostree refuses to commit sockets.
OpenShift Merge Robot [Sat, 1 Aug 2020 19:02:23 +0000 (15:02 -0400)]
Merge pull request #2156 from jlebon/pr/clarify-ref-rev
app: Fix various CLI metavariable names
Colin Walters [Sat, 1 Aug 2020 17:24:28 +0000 (17:24 +0000)]
remount: Still remount /sysroot writable if not configured ro
Regression from https://github.com/ostreedev/ostree/pull/2113/commits/
35642259175973617da937f3cab6ce5f13c95077
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=
1862568
We still need to remount writable if it's not configured on;
because it may need OS adjustments it needs to be opt-in.
Stefan Agner [Fri, 31 Jul 2020 19:43:09 +0000 (21:43 +0200)]
Show commit checksum of parent, if present
This is useful for ostree log on client side where often not the
full history of a branch is available. It is also helpful for
ostree show to show if a particular commit has a parent.
Jonathan Lebon [Thu, 30 Jul 2020 21:35:20 +0000 (17:35 -0400)]
app: Fix various CLI metavariable names
- Use `REV` instead of `REF` in places where we meant it.
- Fix `commit --parent` actually taking a commit checksum and not a ref.
- Fix `ostree admin switch` using `REF` instead of `REFSPEC`.
OpenShift Merge Robot [Fri, 31 Jul 2020 18:12:42 +0000 (14:12 -0400)]
Merge pull request #2157 from agners/improve-man-pages
Improve man pages
OpenShift Merge Robot [Fri, 31 Jul 2020 17:52:59 +0000 (13:52 -0400)]
Merge pull request #2158 from bgilbert/testiso
ci: test FCOS PXE and ISO install
Benjamin Gilbert [Fri, 31 Jul 2020 10:57:58 +0000 (06:57 -0400)]
ci: test FCOS PXE and ISO install
Make sure we don't break the FCOS live image. PXE is probably sufficient,
but also test the ISO image for good measure.
Stefan Agner [Fri, 31 Jul 2020 09:52:39 +0000 (11:52 +0200)]
man: add missing options to the ostree-commit man page
Add missing parameter to the ostree-commit man page.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Stefan Agner [Fri, 31 Jul 2020 09:49:38 +0000 (11:49 +0200)]
man: add glossary to main man page
Add glossary to define some commonly used literals throughout the ostree
man pages.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
OpenShift Merge Robot [Wed, 22 Jul 2020 14:48:44 +0000 (16:48 +0200)]
Merge pull request #2153 from cgwalters/release-2020-4
Release 2020.4
Colin Walters [Tue, 21 Jul 2020 21:46:43 +0000 (21:46 +0000)]
Post-release version bump
Colin Walters [Tue, 21 Jul 2020 21:46:00 +0000 (21:46 +0000)]
Release 2020.4
A lot of stuff here, new signing API is the biggest. Let's
get a release out.
OpenShift Merge Robot [Mon, 20 Jul 2020 17:55:26 +0000 (13:55 -0400)]
Merge pull request #2152 from cgwalters/pull-fdatasync
pull: Add --per-object-fsync
OpenShift Merge Robot [Sat, 18 Jul 2020 15:00:49 +0000 (11:00 -0400)]
Merge pull request #2150 from cgwalters/pull-append-written
pull: Also append bytes written
Colin Walters [Thu, 16 Jul 2020 21:13:36 +0000 (21:13 +0000)]
pull: Add --per-object-fsync
This is the opposite of
https://github.com/ostreedev/ostree/issues/1184
Motivated by OpenShift seeing etcd performance issues during
OS updates: https://github.com/openshift/machine-config-operator/issues/1897
Basically, if we switch to invoking `fsync()` as we go, it makes
ostree performance worse (in my tests, 31s to write 2G versus 7s if we
delay sync) but it avoids *huge* outliers in `fsync()` time for etcd.
Colin Walters [Thu, 16 Jul 2020 14:20:07 +0000 (14:20 +0000)]
pull: Also append bytes written
This is very useful information that we get from the transaction
stats. Append it to the final display if we're not inheriting
the transaction.
OpenShift Merge Robot [Fri, 17 Jul 2020 16:00:24 +0000 (12:00 -0400)]
Merge pull request #2151 from jlebon/pr/too-parallel
ci: Constrain parallel build jobs
Colin Walters [Fri, 17 Jul 2020 01:36:51 +0000 (01:36 +0000)]
tests: Add needs-internet tag for webserver bits
Fixes the tests, see https://github.com/coreos/coreos-assembler/pull/1600
TODO: provide a webserver binary via virtio or so
Jonathan Lebon [Thu, 16 Jul 2020 15:42:57 +0000 (11:42 -0400)]
ci: Constrain parallel build jobs
The default `_NPROCESSORS_ONLN` heuristic we have isn't cgroups aware.
So it thinks it has e.g. 40 CPUs when running in a k8s pod. This can
then blow through our allocated resource limits.
Declare some modest amount of RAM and CPU resources and override `make`
parallelism.
This matches what rpm-ostree now does in
https://github.com/coreos/rpm-ostree/pull/2155.
OpenShift Merge Robot [Fri, 10 Jul 2020 17:20:27 +0000 (19:20 +0200)]
Merge pull request #2146 from stb-tester/owners-uncomment-wmanley
OWNERS: Uncomment @wmanley
William Manley [Wed, 8 Jul 2020 14:54:22 +0000 (15:54 +0100)]
OWNERS: Uncomment @wmanley
I've made my affiliation public now thanks to @cgwalters:
https://github.com/ostreedev/ostree/pull/1678#issuecomment-
653148139
OpenShift Merge Robot [Fri, 3 Jul 2020 15:31:45 +0000 (11:31 -0400)]
Merge pull request #2144 from cgwalters/deltas-new-style
lib/deltas: convert ostree_repo_static_delta_generate to new style
Frédéric Danis [Thu, 16 Apr 2020 15:17:12 +0000 (17:17 +0200)]
lib/deltas: convert ostree_repo_static_delta_generate to new style
The "new style" code generally avoids `goto err` because it conflicts
with `__attribute__((cleanup))`. This fixes a compiler warning.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
OpenShift Merge Robot [Wed, 1 Jul 2020 21:05:40 +0000 (17:05 -0400)]
Merge pull request #2143 from jlebon/pr/eacces-lock
lib/repo: Handle EACCES for POSIX locking
Jonathan Lebon [Tue, 30 Jun 2020 19:05:19 +0000 (15:05 -0400)]
lib/repo: Handle EACCES for POSIX locking
If `glnx_make_lock_file` falls back to `flock`, on NFS this uses POSIX
locks (`F_SETLK`). As such, we need to be able to handle `EACCES` as
well as `EAGAIN` (see `fnctl(2)`).
I think this is what coreos-ostree-importer has been hitting, which runs
on RHEL7 in the Fedora infra and does locking over an NFS share where
multiple apps could concurrently pull things into the repo.
OpenShift Merge Robot [Wed, 24 Jun 2020 22:24:41 +0000 (18:24 -0400)]
Merge pull request #2131 from cgwalters/sign-success
signapi: Change API to also return a success message
OpenShift Merge Robot [Wed, 24 Jun 2020 07:02:18 +0000 (03:02 -0400)]
Merge pull request #2001 from agners/multi-device-tree
deploy: support devicetree directory
OpenShift Merge Robot [Fri, 19 Jun 2020 18:37:19 +0000 (14:37 -0400)]
Merge pull request #2138 from cgwalters/use-autopkgtest-reboot
tests: Port to Debian autopkgtest reboot API
OpenShift Merge Robot [Fri, 19 Jun 2020 17:57:33 +0000 (13:57 -0400)]
Merge pull request #2136 from cgwalters/doc-timestamp
core: Add documentation for ostree_commit_get_timestamp()
OpenShift Merge Robot [Fri, 19 Jun 2020 17:12:07 +0000 (13:12 -0400)]
Merge pull request #2137 from cgwalters/fix-unexported-symbol
sysroot: Remove unimplemented ostree_sysroot_lock_with_mount_namespace
Colin Walters [Fri, 19 Jun 2020 12:55:33 +0000 (12:55 +0000)]
tests: Port to Debian autopkgtest reboot API
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.
Colin Walters [Thu, 18 Jun 2020 21:19:43 +0000 (21:19 +0000)]
sysroot: Remove unimplemented ostree_sysroot_lock_with_mount_namespace
This came in with
5af403be0cc64df50ad21cef05f3268ead256d6d but
was never implemented.
I noticed this now because the Rust ostree bindings generate a
wrapper for it which the linker tries to use.
Colin Walters [Thu, 18 Jun 2020 20:57:53 +0000 (20:57 +0000)]
core: Add documentation for ostree_commit_get_timestamp()
Working on some rpm-ostree bits and was going to pass
this to the `chrono` crate and I forgot the format, went
to look at the docs. Oops.
OpenShift Merge Robot [Thu, 18 Jun 2020 14:00:32 +0000 (10:00 -0400)]
Merge pull request #2133 from jlebon/pr/ci-commitmessage
ci: Import latest ci-commitmessage-submodules from rpm-ostree
OpenShift Merge Robot [Thu, 18 Jun 2020 13:49:43 +0000 (09:49 -0400)]
Merge pull request #2135 from mwleeds/test-symbols-check-for-example
tests: Check that example symbol isn't released
Matthew Leeds [Wed, 17 Jun 2020 21:35:18 +0000 (14:35 -0700)]
tests: Check that example symbol isn't released
For the motivation for this see #2132.
OpenShift Merge Robot [Wed, 17 Jun 2020 20:18:26 +0000 (16:18 -0400)]
Merge pull request #2132 from cgwalters/remove-unused-symbol
libostree-devel.sym: Remove nonexistent stub symbol
Jonathan Lebon [Wed, 17 Jun 2020 19:48:31 +0000 (15:48 -0400)]
ci: Remove libpaprci/ directory
And move everything that was in it directly in `ci/`. There's a bunch
more cleanups here that we need to do (and more changes to upstream from
the rpm-ostree copies of this).
OpenShift Merge Robot [Wed, 17 Jun 2020 19:44:27 +0000 (15:44 -0400)]
Merge pull request #2134 from d4s/wip/d4s/fix_abort_on_verify
Fix abort on verify
Colin Walters [Tue, 16 Jun 2020 13:02:53 +0000 (13:02 +0000)]
libostree-devel.sym: Remove nonexistent stub symbol
This should have been removed when we added symbols to this list.
Denis Pynkin [Wed, 17 Jun 2020 16:21:35 +0000 (16:21 +0000)]
sign/
ed25519: fix return value if no correct keys in file
Fix the return value if file doesn't contains correct public key(s).
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Denis Pynkin [Wed, 17 Jun 2020 13:28:32 +0000 (16:28 +0300)]
sign/
ed25519: fix the abort in case of incorrect public key
We need to check the size of public key before trying to use it.
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Jonathan Lebon [Wed, 17 Jun 2020 14:38:06 +0000 (10:38 -0400)]
ci: Import latest ci-commitmessage-submodules from rpm-ostree
Especially for https://github.com/coreos/rpm-ostree/pull/2079.
Colin Walters [Wed, 17 Jun 2020 00:22:49 +0000 (00:22 +0000)]
signapi: Change API to also return a success message
This is the dual of https://github.com/ostreedev/ostree/pull/2129/commits/
1f3c8c5b3de978f6e069c24938967f823cce7ee8
where we output more detail when signapi fails to validate.
Extend the API to return a string for success, which we output
to stdout.
This will help the test suite *and* end users validate that the expected
thing is happening.
In order to make this cleaner, split the "verified commit" set
in the pull code into GPG and signapi verified sets, and have
the signapi verified set contain the verification string.
We're not doing anything with the verification string in the
pull code *yet* but I plan to add something like
`ostree pull --verbose` which would finally print this.
OpenShift Merge Robot [Tue, 16 Jun 2020 20:59:55 +0000 (22:59 +0200)]
Merge pull request #2130 from jlebon/pr/bump-libglnx
libglnx: Bump to latest
Jonathan Lebon [Tue, 16 Jun 2020 20:30:23 +0000 (16:30 -0400)]
libglnx: Bump to latest
For `copy_file_range` fix:
https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/18
Update submodule: libglnx
OpenShift Merge Robot [Tue, 16 Jun 2020 16:15:21 +0000 (18:15 +0200)]
Merge pull request #2129 from cgwalters/
ed25519-errors
sign/
ed25519: Output failed signatures in error message
Colin Walters [Tue, 16 Jun 2020 13:18:07 +0000 (13:18 +0000)]
sign/
ed25519: Output failed signatures in error message
To aid debuggability, when we find a commit that isn't signed
by our expected key, output a specific error message with the
key.
(And then add code to switch to just printing the count beyond 3
because the test suite injects 100 keys and hopefully no one
ever actually does that)
OpenShift Merge Robot [Mon, 15 Jun 2020 19:29:23 +0000 (15:29 -0400)]
Merge pull request #2128 from cgwalters/verify-pre-signed
tests: Add a pre-signed-pull.sh test
Colin Walters [Thu, 11 Jun 2020 18:31:33 +0000 (18:31 +0000)]
tests: Add a pre-signed-pull.sh test
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.
OpenShift Merge Robot [Wed, 10 Jun 2020 18:57:14 +0000 (14:57 -0400)]
Merge pull request #2094 from zpiotr/patch-1
Changing link to file about contributing, in readme.
NEPO [Sat, 9 May 2020 10:23:50 +0000 (12:23 +0200)]
README.md: Fix link to CONTRIBUTING.md
We should link to the target and not the symlink.
OpenShift Merge Robot [Tue, 9 Jun 2020 00:58:59 +0000 (02:58 +0200)]
Merge pull request #2121 from cgwalters/arch-key
core: Add OSTREE_COMMIT_META_KEY_ARCH
OpenShift Merge Robot [Mon, 8 Jun 2020 16:50:43 +0000 (12:50 -0400)]
Merge pull request #2126 from agners/improve-ostree-checkout-man
Improve checkout man page
Stefan Agner [Mon, 8 Jun 2020 13:42:38 +0000 (15:42 +0200)]
man/checkout: document missing options
Document missing options in the ostree checkout man page.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Stefan Agner [Mon, 8 Jun 2020 13:40:52 +0000 (15:40 +0200)]
checkout: use FILE as option argument string for --skip-list
Align with --from-file and use 'FILE' instead of 'PATH' as option
argument string. No functional change, this is only cosmetics.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Stefan Agner [Mon, 8 Jun 2020 13:17:58 +0000 (15:17 +0200)]
man/checkout: fix short name option of --user-mode
The short name option of --user-mode is -U.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Colin Walters [Wed, 3 Jun 2020 18:52:34 +0000 (18:52 +0000)]
core: Add OSTREE_COMMIT_META_KEY_ARCHITECTURE
Add a standard key for this. We actually had a case in OpenShift
builds recently where a `ppc64le` image was pushed over an `x86_64`
one and this started failing at runtime with a not immediately
obvious error.
I'll probably end up changing rpm-ostree at least to use
the RPM architecture for this key and fail if it doesn't match
the booted value.
Possibly that should live in ostree but it would involve adding
architecture schema here, which gets into a big mess. Let's
just standardize the key.
xref https://github.com/coreos/coreos-assembler/commit/
e02ef2683d688607e7b5ad9ea6a0c00c50a682a5
OpenShift Merge Robot [Thu, 4 Jun 2020 21:34:52 +0000 (17:34 -0400)]
Merge pull request #2123 from cgwalters/all-your-base-have-arguments
commit: Note in help that --base takes an argument
Colin Walters [Thu, 4 Jun 2020 21:06:52 +0000 (21:06 +0000)]
commit: Note in help that --base takes an argument
I was trying to use this in some testing work and was confused for a minute.
OpenShift Merge Robot [Thu, 4 Jun 2020 14:18:16 +0000 (16:18 +0200)]
Merge pull request #2122 from cgwalters/testrs-webserver
tests/rust: Extract a with_webserver_in helper wrapper
Colin Walters [Thu, 4 Jun 2020 12:24:16 +0000 (12:24 +0000)]
tests/rust: Extract a with_webserver_in helper wrapper
It's much cleaner if the Tokio stuff stays in `test.rs`, and
easier to write tests if the function is synchronous.
Prep for further tests.
OpenShift Merge Robot [Tue, 2 Jun 2020 18:31:30 +0000 (20:31 +0200)]
Merge pull request #2048 from cgwalters/rust-cmdspec-tests
Add new Rust-based tests
OpenShift Merge Robot [Tue, 2 Jun 2020 16:22:48 +0000 (18:22 +0200)]
Merge pull request #2119 from cgwalters/bumpsplit-rustfmt
bupsplit: rustfmt(*)
Colin Walters [Sun, 31 May 2020 17:58:44 +0000 (17:58 +0000)]
bupsplit: rustfmt(*)
Let's use the standard rustfmt style.
Also remove unused parenthesis which rust-analyzer was complaining
about.
Also add a `.gitignore`.
OpenShift Merge Robot [Fri, 29 May 2020 22:52:23 +0000 (18:52 -0400)]
Merge pull request #2118 from cgwalters/error-prefix-parsing
lib: Add error prefixing with specific object when loading
Stefan Agner [Tue, 4 Feb 2020 12:39:27 +0000 (13:39 +0100)]
deploy: support devicetree directory
Add support for a devicetree directory at /usr/lib/modules/$kver/dtb/.
In ARM world a general purpose distribution often suppports multiple
boards with a single operating system. However, OSTree currently only
supports a single device tree, which does not allow to use the same
OSTree on different ARM machines. In this scenario typically the boot
loader selects the effective device tree.
This adds device tree directory support for the new boot artefact
location under /usr/lib/modules. If the file `devicetree` does not
exist, then the folder dtb will be checked. All devicetrees are hashed
into the deployment hash. This makes sure that even a single devicetree
change leads to a new deployment and hence can be rolled back.
The loader configuration has a new key "devicetreepath" which contains
the path where devicetrees are stored. This is also written to the
U-Boot variable "fdtdir". The boot loader is expected to use this path
to load a particular machines device tree from.
Closes: #1900
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Colin Walters [Fri, 29 May 2020 12:31:23 +0000 (12:31 +0000)]
pull: Add error prefixing with specific object when parsing
One OpenShift user saw this from rpm-ostree:
```
client(id:cli dbus:1.583 unit:machine-config-daemon-host.service uid:0) added; new total=1
Initiated txn UpdateDeployment for client(id:cli dbus:1.583 unit:machine-config-daemon-host.service uid:0): /org/projectatomic/rpmostree1/rhcos
Txn UpdateDeployment on /org/projectatomic/rpmostree1/rhcos failed: File header size
4294967295 exceeds size 0
```
which isn't very helpful. Let's add some error
prefixing here which would at least tell us which
object was corrupted.
OpenShift Merge Robot [Thu, 28 May 2020 17:52:48 +0000 (13:52 -0400)]
Merge pull request #2117 from cgwalters/pull-signapi-default-explicit
remote-add: Default to explicit sign-verify backends
Colin Walters [Thu, 28 May 2020 00:41:34 +0000 (00:41 +0000)]
remote-add: Default to explicit sign-verify backends
In https://github.com/ostreedev/ostree/pull/2092/commits/
588f42e8c64183dfa1fbaa08cc92c46b691b23c4
we added a way to add keys for sign types when doing
a `remote add`, and in https://github.com/ostreedev/ostree/pull/2105
we extended `sign-verify` to support *limiting* to an explicit
set.
This PR changes the *default* for `remote add` to combine
the two - when providing an explicit `--sign-verify=type`,
we now limit the accepted types to only those.
Colin Walters [Sat, 28 Mar 2020 14:04:31 +0000 (14:04 +0000)]
Add new Rust-based tests
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.
OpenShift Merge Robot [Wed, 27 May 2020 15:43:22 +0000 (11:43 -0400)]
Merge pull request #2116 from cgwalters/kolainst
tests/kola: Move to tests/kolainst
Colin Walters [Wed, 27 May 2020 12:52:07 +0000 (12:52 +0000)]
tests/kola: Move to tests/kolainst
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.
OpenShift Merge Robot [Tue, 26 May 2020 15:38:42 +0000 (11:38 -0400)]
Merge pull request #2113 from cgwalters/prepare-root-sysroot-ro
Move ro /sysroot bind mount of /etc into initramfs
OpenShift Merge Robot [Sun, 24 May 2020 18:53:46 +0000 (14:53 -0400)]
Merge pull request #2105 from cgwalters/pull-signapi-explicit
pull: Add support for sign-verify=<list>
Colin Walters [Sun, 24 May 2020 15:25:08 +0000 (15:25 +0000)]
Move ro /sysroot bind mount of /etc into initramfs
We recently disabled the read-only /sysroot handling:
https://github.com/ostreedev/ostree/pull/2108/commits/
e35b82fb891daee823fcce421ae8f1442b630ea2
The core problem was that a lot of services run early in the
real root and want write access to things like `/var` and `/etc`.
In trying to do remounts while the system is running we introduce
too many race conditions.
Instead, just make the `/etc` bind mount in the initramfs right
after we set up the main root. This is much more natural really,
and avoids all race conditions since nothing is running in the
sysroot yet.
The main awkward part is that since we're not linking
`ostree-prepare-root` to GLib (yet) we have a hacky parser
for the config file. But, this is going to be fine I think.
In order to avoid parsing the config twice, pass state from
`ostree-prepare-root` to `ostree-remount` via a file in `/run`.
Colin Walters [Fri, 15 May 2020 20:43:23 +0000 (20:43 +0000)]
pull: Add support for sign-verify=<list>
The goal here is to move the code towards a model
where the *client* can explicitly specify which signature types
are acceptable.
We retain support for `sign-verify=true` for backwards compatibility.
But in that configuration, a missing public key is just "no signatures found".
With `sign-verify=
ed25519` and no key configured, we can
explicitly say `No keys found for required signapi type
ed25519`
which is much, much clearer.
Implementation side, rather than maintaining `gboolean sign_verify` *and*
`GPtrArray sign_verifiers`, just have the array. If it's `NULL` that means
not to verify.
Note that currently, an explicit list is an OR of signatures, not AND.
In practice...I think most people are going to be using a single entry
anyways.
OpenShift Merge Robot [Fri, 22 May 2020 18:27:43 +0000 (20:27 +0200)]
Merge pull request #2110 from jlebon/pr/fix-admin-tests2
tests/admin-test: Fix --allow-downgrade check
Jonathan Lebon [Wed, 20 May 2020 16:37:44 +0000 (12:37 -0400)]
tests/admin-test: Fix --allow-downgrade check
We were doing a check to verify that `ostree admin upgrade` wouldn't
accept a downgrade without `--allow-downgrade`. However, there's no
guarantee that the commit it's upgrading from is older than HEAD^ (what
we're upgrading to). Specifically, if the test runs fast enough, the
timestamps could be equal, since the lowest resolution is seconds.
Rework the test so that we first upgrade to HEAD, which we're sure is at
least 1 second apart from HEAD^, and *then* check that downgrade
protection is enforced.
We also can't use `rev-parse testos/buildmaster/x86_64-runtime` as a way
to know what commit the host is sitting on since the ref might've gone
ahead. Instead, just use `ostree admin status | head -n1`. (I played
with using the `ostree/I/J/K` refs, but those depend on what the
boot/subbootversion is and can easily change if we change previous
tests).
OpenShift Merge Robot [Fri, 22 May 2020 14:36:21 +0000 (16:36 +0200)]
Merge pull request #2111 from strugee/patch-1
Fix typo
AJ Jordan [Fri, 22 May 2020 06:22:44 +0000 (23:22 -0700)]
Fix typo
OpenShift Merge Robot [Thu, 21 May 2020 15:58:04 +0000 (17:58 +0200)]
Merge pull request #2108 from jlebon/pr/back-out-ro-sysroot
switchroot/remount: Neuter sysroot.readonly for now
Jonathan Lebon [Wed, 20 May 2020 20:18:45 +0000 (16:18 -0400)]
switchroot/remount: Neuter sysroot.readonly for now
We're hitting issues with the read-only remounts racing with various
services coming up. Let's neuter it for now until we rework how it
works.
See: https://github.com/coreos/fedora-coreos-tracker/issues/488
OpenShift Merge Robot [Wed, 20 May 2020 17:05:35 +0000 (19:05 +0200)]
Merge pull request #2106 from jlebon/pr/fix-admin-test
tests/admin-test: Ensure that commits are 1s apart
OpenShift Merge Robot [Wed, 20 May 2020 16:33:51 +0000 (18:33 +0200)]
Merge pull request #2107 from cgwalters/more-commit-clocking
admin-test: Show err.txt on unexpected failure
Colin Walters [Wed, 20 May 2020 15:57:10 +0000 (15:57 +0000)]
admin-test: Show err.txt on unexpected failure
In a CI run I think one of these `ostree show` commands is failing.
While that output would be useful, the actual `err.txt` usually
has what we want too.
Jonathan Lebon [Wed, 20 May 2020 14:45:45 +0000 (10:45 -0400)]
tests/admin-test: Ensure that commits are 1s apart
Otherwise the new check we added there to verify that upgrading without
`--allow-downgrade` fails itself fails.
See: https://github.com/ostreedev/ostree/pull/2099#issuecomment-
629805840
OpenShift Merge Robot [Mon, 18 May 2020 19:39:30 +0000 (21:39 +0200)]
Merge pull request #2102 from cgwalters/test-clockskew-check
ci: Test for clock skew