ostree/tests
Colin Walters e0346c1494 Add a notion of "physical" sysroot, use for remote writing
(Note this PR was reverted in <https://github.com/ostreedev/ostree/pull/902>;
 this version should be better)

Using `${sysroot}` to mean the physical storage root: We don't want to write to
`${sysroot}/etc/ostree/remotes.d`, since nothing will read it, and really
`${sysroot}` should just have `/ostree` (ideally). Today the Anaconda rpmostree
code ends up writing there. Fix this by adding a notion of "physical" sysroot.
We determine whether the path is physical by checking for `/sysroot`, which
exists in deployment roots (and there shouldn't be a `${sysroot}/sysroot`).

In order to unit test this, I added a `--sysroot` argument to `remote add`.
However, doing this better would require reworking the command line parsing for
the `remote` argument to support specifying `--repo` or `--sysroot`, and I
didn't quite want to do that yet in this patch.

This second iteration of this patch fixes the bug we hit the first time;
embarassingly enough I broke `ostree remote list` finding system remotes.
The fix is to have `ostree_repo_open()` figure out whether it's the same
as `/ostree/repo` for now.

Down the line...we might consider having the `ostree remote` command line itself
instatiate an `OstreeSysroot` by default, but this maximizes compatibility; we
just have to pay a small cost that `ostree` usage outside of that case like
`ostree static-delta` in a releng Jenkins job or whatever will do this `stat()`
too.

Closes: https://github.com/ostreedev/ostree/issues/892

Closes: #1008
Approved by: mbarnes
2017-07-18 18:58:06 +00:00
..
coccinelle Add Coccinelle usage: one for blacklisting, one for patch collection 2017-03-30 19:19:54 +00:00
gpg-verify-data gpg: Regenerate test data for test-gpg-verify-result 2015-03-19 12:43:04 -04:00
gpghome tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
installed Add a notion of "physical" sysroot, use for remote writing 2017-07-18 18:58:06 +00:00
.gitignore lib/repo-finder: Add Avahi based OstreeRepoFinder implementation 2017-06-26 15:56:07 +00:00
admin-test.sh Add a notion of "physical" sysroot, use for remote writing 2017-07-18 18:58:06 +00:00
archive-test.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
basic-test.sh ostree: Add collection and ref bindings to metadata on commit 2017-07-06 19:08:14 +00:00
bootloader-entries-crosscheck.py Introducing ostree-grub-generator 2016-04-04 14:19:35 +00:00
coccinelle.sh Add Coccinelle usage: one for blacklisting, one for patch collection 2017-03-30 19:19:54 +00:00
corrupt-repo-ref.js Make corrupt-repo-ref.js executable 2017-01-19 13:54:59 +00:00
glib.supp glib.supp: Suppress g_task -> thread leaks 2016-07-28 10:10:17 +00:00
grub2-entries-crosscheck.py tests: Add a test script to cross-check loader config vs GRUB2 2015-05-28 14:21:30 -04:00
libostreetest.c libglnx: bump and use new helper methods 2017-05-12 21:02:16 +00:00
libostreetest.h tests/test-pull-c: New test that runs through the pull API via C 2016-06-07 15:58:37 +00:00
libtest-core.sh checkout: also chmod in the user checkout case 2017-06-02 17:46:16 +00:00
libtest.sh tests: Fix assert_files_hardlinked 2017-06-29 15:34:57 +00:00
ostree-grub-generator Introducing ostree-grub-generator 2016-04-04 14:19:35 +00:00
ostree.supp tests: Modernize valgrind infrastructure 2016-06-09 21:10:35 +00:00
pre-endian-deltas-repo-big.tar.xz deltas: Heuristically detect endianness for older deltas 2016-02-26 08:19:01 -05:00
pre-endian-deltas-repo-little.tar.xz deltas: Heuristically detect endianness for older deltas 2016-02-26 08:19:01 -05:00
pull-test.sh tests: Run pull tests for bare/bare-user 2017-07-10 14:18:18 +00:00
readdir-rand.c tree-wide: Switch tabs ⭾ in various files over to spaces ␠ 2017-05-11 18:17:26 +00:00
test-admin-deploy-2.sh tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
test-admin-deploy-bootid-gc.sh ostree-repo: Make the lock with a long-lasting FD 2016-11-22 02:32:33 +00:00
test-admin-deploy-clean.sh tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
test-admin-deploy-etcmerge-cornercases.sh tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
test-admin-deploy-grub2.sh Add a notion of "physical" sysroot, use for remote writing 2017-07-18 18:58:06 +00:00
test-admin-deploy-karg.sh Filter bootloader supplied kernel cmdline options 2016-11-01 18:00:37 +00:00
test-admin-deploy-switch.sh tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
test-admin-deploy-syslinux.sh Add a notion of "physical" sysroot, use for remote writing 2017-07-18 18:58:06 +00:00
test-admin-deploy-uboot.sh Add a notion of "physical" sysroot, use for remote writing 2017-07-18 18:58:06 +00:00
test-admin-instutil-set-kargs.sh Filter bootloader supplied kernel cmdline options 2016-11-01 18:00:37 +00:00
test-admin-locking.sh Probe for GNU parallel more accurately 2016-03-31 14:22:06 +00:00
test-admin-pull-deploy-commit.sh tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
test-admin-pull-deploy-split.sh upgrade: Add support for --pull-only and --deploy-only 2017-02-27 20:57:23 +00:00
test-admin-upgrade-endoflife.sh Allow commits to mark refs as EOL, replaced by others 2017-05-22 20:18:07 +00:00
test-admin-upgrade-not-backwards.sh tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
test-admin-upgrade-unconfigured.sh tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
test-archivez.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-auto-summary.sh tests: Remove extra $CMD_PREFIX from test-auto-summary.sh 2016-06-27 20:20:21 +00:00
test-basic-c.c lib/core: Add ostree_validate_remote_name() for remote names 2017-06-20 21:52:22 +00:00
test-basic-root.sh checkout: Merge union/add logic for copies during checkout 2017-04-25 13:52:35 +00:00
test-basic-user-only.sh lib/repo: Support hardlink conversions from bare-user to bu-only 2017-06-13 12:02:12 +00:00
test-basic-user.sh lib/commit: Ensure bare-user objects are always user-readable 2017-06-30 21:23:48 +00:00
test-basic.sh tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
test-bloom.c lib/bloom: Add an internal bloom filter implementation 2017-06-26 15:56:07 +00:00
test-bsdiff.c [ASAN] tests: Cleanup all current remaining leaks 2016-12-05 15:20:56 +00:00
test-checksum.c static-delta: add some error handling 2016-09-09 19:06:11 +00:00
test-commit-sign.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-core.js commit: Mark ostree_repo_transaction_set_ref* checksums nullable 2017-05-08 16:35:09 +00:00
test-corruption.sh fsck: Check for refs missing corresponding commit 2017-05-09 14:05:46 +00:00
test-delta.sh pull: Support deltas for explicit commits 2017-04-12 21:30:33 +00:00
test-demo-buildsystem.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-export.sh ostree export: Add --prefix option 2016-04-19 12:28:06 +00:00
test-find-remotes.sh tests: Add integration tests for collections 2017-06-26 15:56:07 +00:00
test-fsck-collections.sh tests: Add integration tests for collections 2017-06-26 15:56:07 +00:00
test-gpg-signed-commit.sh libtest: add has_gpgme() helper function 2016-08-31 16:52:12 +00:00
test-gpg-verify-result.c tree-wide: Convert to using autoptr(GString) vs g_string_free(...,TRUE) 2017-05-05 15:10:51 +00:00
test-help.sh tests: Use "bash strict mode" 2016-01-27 11:44:10 -05:00
test-init-collections.sh tests: Add integration tests for collections 2017-06-26 15:56:07 +00:00
test-keyfile-utils.c tests/keyfile-utils: Drop tests covering preconditions 2016-12-06 14:50:08 +00:00
test-libarchive-import.c Define and use cleanup helpers for libarchive 2016-12-05 15:20:56 +00:00
test-libarchive.sh main: Make ostree --version output YAML (and add gitrev) 2017-02-22 18:57:18 +00:00
test-local-pull-depth.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-local-pull.sh tests: Fix incorrect summary --update usage in test-local-pull.sh 2017-06-27 19:19:32 +00:00
test-lzma.c [ASAN] tests: Cleanup all current remaining leaks 2016-12-05 15:20:56 +00:00
test-mock-gio.c lib/repo-finder: Add mount based OstreeRepoFinder implementation 2017-06-26 15:56:07 +00:00
test-mock-gio.h lib/repo-finder: Add mount based OstreeRepoFinder implementation 2017-06-26 15:56:07 +00:00
test-mutable-tree.c [ASAN] tests: Cleanup all current remaining leaks 2016-12-05 15:20:56 +00:00
test-oldstyle-partial.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-ot-opt-utils.c [ASAN] tests: Cleanup all current remaining leaks 2016-12-05 15:20:56 +00:00
test-ot-tool-util.c [ASAN] tests: Cleanup all current remaining leaks 2016-12-05 15:20:56 +00:00
test-ot-unix-utils.c [ASAN] tests: Cleanup all current remaining leaks 2016-12-05 15:20:56 +00:00
test-parent.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-prune-collections.sh tests: Add integration tests for collections 2017-06-26 15:56:07 +00:00
test-prune.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-bare.sh tests: Run pull tests for bare/bare-user 2017-07-10 14:18:18 +00:00
test-pull-bareuser.sh tests: Run pull tests for bare/bare-user 2017-07-10 14:18:18 +00:00
test-pull-c.c tree-wide: Replace various uses of archive-z2archive 2017-06-29 16:00:13 +00:00
test-pull-collections.sh tests: New tests for creating commits with bindings and pulling them 2017-07-06 19:08:14 +00:00
test-pull-commit-only.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-contenturl.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-corruption.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-depth.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-large-metadata.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-localcache.sh Add "pull --localcache-repo" 2017-06-30 19:37:23 +00:00
test-pull-metalink.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-mirror-summary.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-mirrorlist.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-override-url.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-repeated.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-resume.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-subpath.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-summary-sigs.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-pull-untrusted.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-refs-collections.sh tests: Add integration tests for collections 2017-06-26 15:56:07 +00:00
test-refs.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-remote-add-collections.sh tests: Add integration tests for collections 2017-06-26 15:56:07 +00:00
test-remote-add.sh tests: Port to glib-tap.mk, make make check run all of the tests 2016-03-03 08:50:19 -05:00
test-remote-cookies.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00
test-remote-gpg-import.sh core: Fix default value of disable_xattrs 2017-04-04 15:54:46 +00:00
test-remote-headers.sh pull: complete detached meta fetch before scanning 2017-05-18 01:14:15 +00:00
test-repo-finder-avahi.c lib/repo-finder: Add Avahi based OstreeRepoFinder implementation 2017-06-26 15:56:07 +00:00
test-repo-finder-config.c lib/repo-finder: Add config-file based OstreeRepoFinder implementation 2017-06-26 15:56:07 +00:00
test-repo-finder-mount.c lib/repo-finder: Add mount based OstreeRepoFinder implementation 2017-06-26 15:56:07 +00:00
test-reset-nonlinear.sh tests: Use "bash strict mode" 2016-01-27 11:44:10 -05:00
test-rofiles-fuse.sh repo/checkout: Verify early if src/destination are on same device 2017-03-06 20:58:04 +00:00
test-rollsum-cli.c Add Coccinelle usage: one for blacklisting, one for patch collection 2017-03-30 19:19:54 +00:00
test-rollsum.c tree-wide: Switch tabs ⭾ in various files over to spaces ␠ 2017-05-11 18:17:26 +00:00
test-sizes.js core: Add size information to commit metadata 2013-10-19 11:56:51 -04:00
test-summary-collections.sh tests: Add integration tests for collections 2017-06-26 15:56:07 +00:00
test-summary-update.sh ostree/summary: Add support for adding additional metadata 2017-06-27 19:19:32 +00:00
test-summary-view.sh lib/repo: Omit deltas from the summary file if there are none 2017-06-07 16:55:35 +00:00
test-switchroot.sh test-switchroot.sh: skip if no busybox 2017-06-27 21:45:34 +00:00
test-symbols.sh Release 2017.8 2017-07-06 14:45:02 +00:00
test-sysroot-c.c lib: Add ostree_sysroot_load_if_changed() API 2016-03-03 21:56:23 -05:00
test-sysroot.js tests: Port sysroot.js away from libgsystem 2016-08-09 19:01:35 +00:00
test-varint.c [ASAN] tests: Cleanup all current remaining leaks 2016-12-05 15:20:56 +00:00
test-xattrs.sh repo+tests: Add [core]disable-xattrs=true, use it on overlayfs 2017-03-24 22:16:43 +00:00