Commit Graph

2504 Commits

Author SHA1 Message Date
Alexander Larsson
c86e4f0c90 Add remotes-config-dir to OstreeRepo
This allows you to replace the default
$sysroot/$sysconfdir/ostree/repos.d string value, and to use a similar
feature for repos that are not the system repo.

In particular, this allows us to support /etc/xdg-app/remotes.d for
xdg-app.

Closes: #247
Approved by: cgwalters
2016-04-14 16:21:01 +00:00
Colin Walters
d9a334950b man: Elaborate on per-remote GPG
Closes: #258
Approved by: alexlarsson
2016-04-14 16:05:52 +00:00
Alexander Larsson
9e7e594907 Add OstreeRepo option for an out-of-band cache dir
This allows you to have a writable cache dir even for a system-owned
repository.

Closes: #250
Approved by: cgwalters
2016-04-14 15:55:08 +00:00
Alexander Larsson
b787fce612 Add cache_dir_fd to OstreeRepo
This will allow us later to easily swap out the cache dir.

Closes: #250
Approved by: cgwalters
2016-04-14 15:55:08 +00:00
Alexander Larsson
77ea287cd2 commit: Fix crash if dfd_iter is NULL
in write_directory_content_to_mtree_internal dfd_iter can be NULL,
for instance if commiting from --tree=ref=FOO. Don't blindly de-ref
it to avoid crashing.

Closes: #256
Approved by: cgwalters
2016-04-13 19:37:06 +00:00
Alexander Larsson
6a57d0a2f0 fetcher: Initialize output_stream_set_lock mutex
ostree pull-local crashed for me in thread_closure_unref () doing:
    g_mutex_clear (&thread_closure->output_stream_set_lock);

Seems like we never initialize this mutex.

Closes: #254
Approved by: cgwalters
2016-04-13 14:11:46 +00:00
Gatis Paeglis
80c68ba7f0 Fix AS_HELP_STRING for builtin grub2 mkconfig
Closes: #253
Approved by: giuseppe
2016-04-12 11:22:50 +00:00
Colin Walters
581a643e17 build: Move grub2-15_ostree back to pkglibexecdir
It's not quite namespaced enough to have
`/usr/libexec/grub2-15_ostree`, and the Fedora spec file expects
things in `/usr/libexec/ostree`.  Changing the spec file would be
annoying as we'd need conditionals.

Closes: #249
Approved by: gatispaeglis
2016-04-11 14:30:22 +00:00
Colin Walters
594162f16a pull: More consistently use remote_repo_local for local repos
I think it's cleaner if we use `remote_repo_local` to know
that we have a local repo.  In reality, it might be nicest
if we didn't even create an `OstreeFetcher` for this case,
but untangling the code is tricky.

Closes: #239
Approved by: alexlarsson
2016-04-11 13:51:50 +00:00
Jonathan Lebon
b69fd11487 ostree-repo-pull: always initialize flags_i
Otherwise we get undefined behaviour if the client didn't explicitly set
any flags.

Also, add documentation for all the other options supported by
ostree_repo_pull_with_options().

Closes: #252
Approved by: cgwalters
2016-04-11 13:31:20 +00:00
Alexander Larsson
e62beae695 Fix the symbol versions for ostree_repo_get_remote_*option
These were accidentally added to 2016.4 instead of 2016.5

Closes: #251
Approved by: cgwalters
2016-04-11 13:07:07 +00:00
Jonathan Lebon
41661e47e1 small cleanups
- Revert 'cannot' --> 'can not' (it's the exception!)
- Remove duplicate function
- Squelch compiler warnings

Closes: #248
Approved by: cgwalters
2016-04-08 18:43:18 +00:00
Alexander Larsson
ddda8e5b8b Add support for ostree static-delta delete
Closes: #245
Approved by: giuseppe
2016-04-08 13:42:43 +00:00
Giuseppe Scrivano
8ff9a48ce3 cfg.mk: ignore syntax-check for git.mk
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #246
Approved by: cgwalters
2016-04-08 13:32:41 +00:00
Alexander Larsson
6aa447a917 Add test case for inheriting remote options
Closes: #236
Approved by: cgwalters
2016-04-07 20:02:46 +00:00
Alexander Larsson
d7181f22a6 Inherit remotes and remote options from parent repo
Closes: #236
Approved by: cgwalters
2016-04-07 20:02:46 +00:00
Alexander Larsson
37382590dc Export ostree_repo_get_remote_option* functions
These are useful for ostree users (like xdg-app) that have custom
options for remotes. In particular they are useful when we later make them
all respect self->parent_repo.

Closes: #236
Approved by: cgwalters
2016-04-07 20:02:46 +00:00
Alexander Larsson
91734a8a18 Support pathnames for --subpath=...
This allows you to pull a single file, rather than just a directory.

Closes: #244
Approved by: cgwalters
2016-04-07 15:15:39 +00:00
Colin Walters
984bf91826 Use git.mk
It's a lot nicer than manually maintaining .gitignore in general.

Closes: #235
Approved by: giuseppe
2016-04-07 12:49:40 +00:00
Giuseppe Scrivano
e81aabba8c docs: Prefer the form "cannot" to "can not"
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Giuseppe Scrivano
3152516ab3 Remove empty new lines at the EOF
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Giuseppe Scrivano
6a091c96ba contrib: indent golang code using only tabs instead of both tabs and spaces
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Giuseppe Scrivano
7763c452dd tests: add missing ${CMD_PREFIX} before ostree
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Giuseppe Scrivano
039d3f1dbd tests: add libostreetest.h to EXTRA_DIST
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Colin Walters
4b1ac83aa6 build: Make tests/libreaddir-rand.so rule use AM_V_GEN
So non-verbose builds don't have a verbose rule smack in the middle.

Closes: #241
Approved by: giuseppe
2016-04-07 07:34:12 +00:00
Colin Walters
e9640ca4d9 build: Find grub2-mkconfig a bit more automagically
If one happens to not have grub2 installed, the previous commit
would cause us to fall back to `grub-mkconfig` with bad results.

We should likely just do dynamic detection and avoid pain, but
there's no harm in also allowing this to be statically determined.

The automagic here is that if `/etc/os-release` says `ID_LIKE=fedora`,
we know to use `grub2-mkconfig`.  But distro scripts should set this
in the build configurations using `--with-grub2-mkconfig=`.

Closes: #240
Approved by: jlebon
2016-04-06 21:16:11 +00:00
Alexander Larsson
ace0d4650b pull-local: Support --gpg-verify and --gpg-verify-summary
Force the otherwise disabled gpg verifications on.
Note: You need to pass --remote=foo so we know what gpg keys to verify
against.

Closes: #237
Approved by: cgwalters
2016-04-05 19:12:09 +00:00
Alexander Larsson
87298c84b8 Fix local-pull test
This was not being run for whatever reason. Also, the test
count was wrong.

Closes: #237
Approved by: cgwalters
2016-04-05 19:12:09 +00:00
Alexander Larsson
eabb4e3545 pull: Don't try to cache summaries for pull-local
Not only does this not make sense from a performance perspective, but
it also doesn't work because we can't use a url as a path element.

Closes: #237
Approved by: cgwalters
2016-04-05 19:12:09 +00:00
Gatis Paeglis
4e81548447 Introducing ostree-grub-generator
ostree-grub-generator can be used to customize
the generated grub.cfg file. Compile time
decision ostree-grub-generator vs grub2-mkconfig
can be overwritten with the OSTREE_GRUB2_EXEC
envvar - useful for auto tests and OS installers.

Why this alternative approach:

1) The current approach is less flexible than using a
   custom 'ostree-grub-generator' script. Each system can
   adjust this script for its needs, instead of using the
   hardcoded values from ostree-bootloader-grub2.c.

2) Too much overhead on embedded to generate grub.cfg
   via /etc/grub.d/ configuration files. It is still
   possible to do so, even with this patch applied.
   No need to install grub2 package on a target device.

3) The grub2-mkconfig code path has other issues:
   https://bugzilla.gnome.org/show_bug.cgi?id=761180

Task: https://bugzilla.gnome.org/show_bug.cgi?id=762220

Closes: #228
Approved by: cgwalters
2016-04-04 14:19:35 +00:00
Krzesimir Nowak
826c2149b8 manual: Fix a bunch of typos and docbookisms
Closes: #238
Approved by: cgwalters
2016-04-04 14:09:00 +00:00
Simon McVittie
18e9169d7a libtest.sh: only check whether $(pwd) is empty once
test-sysroot.js runs libtestExec() twice, one of which is after
creating non-hidden directories in $(pwd), so this check needs to be
skipped the second time.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #234
Approved by: cgwalters
2016-03-31 18:54:13 +00:00
Simon McVittie
9c4babf316 test-xattrs: sync how this is skipped with test-rofiles-fuse
If we touch test-xattrs before sourcing libtest.sh, we get:

test tmpdir=/tmp/test-tmp-ostree_test-xattrs.sh.test-HSEXEY is not
empty; run this test via `make check TESTS=`, not directly

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #234
Approved by: cgwalters
2016-03-31 18:54:13 +00:00
Simon McVittie
839628b3fa test-abi: use G_TEST_SRCDIR, G_TEST_BUILDDIR
There's no need to invent new variables for these.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #234
Approved by: cgwalters
2016-03-31 18:54:13 +00:00
Simon McVittie
efb86ba9d3 libtest.sh: use G_TEST_SRCDIR, G_TEST_BUILDDIR to find resources
This fixes the bug that in installed-tests that run testlib.sh under
"bash -c" (i.e. the C and JS tests), $(dirname $0) is "." and we can't do
the LD_PRELOAD correctly:

ERROR: ld.so: object './libreaddir-rand.so' from LD_PRELOAD cannot be
preloaded (cannot open shared object file): ignored.

Similarly, those tests can't copy gpghome correctly.

This also removes the confusing situation that SRCDIR in libtest.sh
(which is ${top_srcdir}/tests) does not mean the same thing as SRCDIR
in test-abi.sh (which is just ${top_srcdir}).

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #234
Approved by: cgwalters
2016-03-31 18:54:13 +00:00
Colin Walters
bdf24cdc04 tests: Make failing to kill the GPG agent non-fatal
It's not working for me in `make check` on a RHEL 7 Workstation,
apparently because no GPG agent is spawned.  I'm guessing this has
something to do with the GPG version?

The downside of this is we will be less likely to notice if GPG
changes again and we start leaking agents like we're in The Matrix
Reloaded.  But the real solution to that is containers anyways.

Closes: #233
Approved by: smcv
2016-03-31 18:43:31 +00:00
Simon McVittie
9dafc82024 Probe for GNU parallel more accurately
moreutils parallel isn't compatible with the command-line syntax
used here. Because it doesn't implement GNU-style --help and exits 1
when that option is given, this test was correctly skipped when
using moreutils parallel, but only by mistake.

moreutils parallel might conceivably gain --help and --version in
future, but hopefully nothing incompatible with GNU parallel is going
to gain a --gnu option.

Also use the --gnu option to force the new command-line semantics;
some versions optionally supported an incompatible command-line syntax
taken from moreutils parallel.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Jonathan Lebon
8cda8b6866 basic-test: commit with a non-empty subject
[smcv: split out from a larger commit, part of PR #231; add commit message]
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Jonathan Lebon
7835fcdc68 test-pull-untrusted.sh: always corrupt a regular file, not a symlink
test-pull-untrusted.sh would pass when run as root, but fail when run
as testuser. It turned out that the way the files were stored in the
repo when running as a testuser were different, which meant that a
different .file object was chosen for corruption. Except that file
turned out to be a symlink, so the echo "broke" actually just wrote
to the no_such_file symlink target, thus keeping the actual symlink
file's checksum the same and causing the pull-local to pass when it
should have failed.

[smcv: split this out of a larger commit, part of PR #231]
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
e1ce859368 Skip tests that run rofiles-fuse if /dev/fuse or /etc/mtab unavailable
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
d458399615 Force libreaddir-rand to be a shared library
If installed-tests are disabled, it would normally be a static
(convenience) library, which isn't something we can LD_PRELOAD.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
1dd85513e5 tests/admin-test.sh: this is a bash script, not a POSIX sh script
The "function foo()" syntax is bash-specific, and Colin indicated in
PR #226 that he prefers to require bash rather than trying to support
every POSIX shell.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
07aa8e1c76 Load g-i bindings from builddir during build-time testing
Previously, the build-time tests would only pass if the g-i bindings to
OSTree were already installed, with a reasonably similar version.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
2b9032f016 .gitignore: update
Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
b25ddd29ab In tests that use gpg, terminate the gpg-agent after testing
Otherwise we leak those processes.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
47fd5c74f1 tap-test: clean up temporary test directories as intended
The script created ./.testtmp but looked for ./.test, which isn't
going to work.

This means the various "ostree trivial-httpd --autoexit" processes
actually exit, because their web roots are cleaned up now.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
f8bef792cb Symlink libreaddir-rand.so into tests directory
This means it can be LD_PRELOADed during build-time testing.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
3e3755c497 various tests: skip if temp directory lacks xattr support
Some autobuilder environments place the entire build chroot on tmpfs, so
even /var/tmp might not have this.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
c276025466 test-xattrs: use TAP syntax to skip test
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Colin Walters
39777ded54 docs/CONTRIBUTING.md: Update for github move, Homu etc.
Closes: #230
Approved by: jlebon
2016-03-30 16:17:21 +00:00