summaryrefslogtreecommitdiff
path: root/buildutil
Commit message (Collapse)AuthorAgeFilesLines
* build: create tests directory for split buildsAlex Kiernan2019-11-081-0/+1
| | | | | | | | | | | | | | | | | | | | | When `--disable-dependency-tracking` is in effect with separate build directory, the tests directory isn't created as a result of the dependency generation, which leads to a build race for the tests directory being created and failures: Making all in . make[2]: Entering directory 'TOPDIR/build/tmp/work/riscv64-yoe-linux-musl/ostree/2019.5-r0/build' (echo '[Test]' > tests/test-local-pull-depth.sh.test.tmp; \ echo 'Type=session' >> tests/test-local-pull-depth.sh.test.tmp; \ echo 'Exec=env G_TEST_SRCDIR=/usr/libexec/installed-tests/libostree G_TEST_BUILDDIR=/usr/libexec/installed-tests/libostree /usr/libexec/installed-tests/libostree/test-local-pull-depth.sh' >> tests/test-local-pull-depth.sh.test.tmp; \ mv tests/test-local-pull-depth.sh.test.tmp tests/test-local-pull-depth.sh.test) /bin/sh: tests/test-local-pull-depth.sh.test.tmp: No such file or directory /bin/sh: line 1: tests/test-local-pull-depth.sh.test.tmp: No such file or directory /bin/sh: line 2: tests/test-local-pull-depth.sh.test.tmp: No such file or directory mv: cannot stat 'tests/test-local-pull-depth.sh.test.tmp': No such file or directory make[2]: *** [Makefile:9282: tests/test-local-pull-depth.sh.test] Error 1 Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
* 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: allow specifying tmpdirJonathan Lebon2017-09-211-1/+2
| | | | | | | | Allow developers to override the default /var/tmp dir, which e.g. might be on overlayfs and thus produces reduced coverage. Closes: #1207 Approved by: cgwalters
* build: Use AM_TESTS_ENVIRONMENT rather than TESTS_ENVIRONMENTPhilip Withnall2017-05-231-1/+1
| | | | | | | | | | | | | TESTS_ENVIRONMENT is reserved for the user to be able to set when running the tests. AM_TESTS_ENVIRONMENT is for the tests’ Makefile to set itself. https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #880 Approved by: cgwalters
* Add --enable-installed-tests=exclusive, fix installed caseColin Walters2017-05-081-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The major reason to do this is that running tests *both* installed and uninstalled in our CI is a mostly pointless waste of time. Particularly given we have a few expensive tests. We *do* have tests that only run uninstalled (since they require the source code) like `test-symbols.sh`. Hence, add `--enable-installed-tests=exclusive` to mean *only* do installed for most tests. We'll still have uninstalled coverage via the Travis/Debian configs, and we could perhaps do another build with a subset of uninstalled tests, but I'm not really concerned about it. I'd like to do a renewed push for the InstalledTests model since I feel it's just fundamentally better. (`g-d-t-r` kind of sucks, but then so does the automake runner). Also while we're here - fix the CI to use the correct context, which started this mess. Closes: #837 Approved by: dbnicholson
* Terminate individual tests after (10 * $TEST_TIMEOUT_FACTOR) minutesSimon McVittie2016-12-011-1/+5
| | | | | | | | | | | | | | | | | | | | While using the Automake parallel test harness, if a test hangs for long enough for an external watchdog to kill the entire build process (as happens in Debian sbuild after 150 minutes with no activity on stdout/stderr), the logs will not be shown. If we make an individual test time out sooner, logs are more likely to be shown. We use SIGABRT so that the process(es) under test will dump core, allowing the point at which ostree is blocking to be analyzed. After 1 minute, if any have not died, we kill them again with SIGKILL. To support slow platforms and slow debugging tools, if TEST_TIMEOUT_FACTOR is set, multiply the 10 minute timeout by that. Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #607 Approved by: cgwalters
* tests: Support TEST_SKIP_CLEANUP=errColin Walters2016-11-211-5/+16
| | | | | | | | | | I find myself often wanting to debug interactively failing tests. This makes it more convenient to keep around the temporary directories just for those tests, rather than accumulating tons of tempdirs from the successful tests as well. Closes: #588 Approved by: jlebon
* build: Import attributes.m4, detect CFLAGS at build timeColin Walters2016-08-081-0/+292
| | | | | | | | | I want to add `-Werror=int-conversion`, but it's only available in newer GCC versions. So let's start autodetecting available compiler flags. Closes: #431 Approved by: giuseppe
* tap-test: clean up temporary test directories as intendedSimon McVittie2016-03-311-1/+1
| | | | | | | | | | | | | 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
* admin: Add an `unlock` command, and libostree APIColin Walters2016-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm trying to improve the developer experience on OSTree-managed systems, and I had an epiphany the other day - there's no reason we have to be absolutely against mutating the current rootfs live. The key should be making it easy to rollback/reset to a known good state. I see this command as useful for two related but distinct workflows: - `ostree admin unlock` will assume you're doing "development". The semantics hare are that we mount an overlayfs on `/usr`, but the overlay data is in `/var/tmp`, and is thus discarded on reboot. - `ostree admin unlock --hotfix` first clones your current deployment, then creates an overlayfs over `/usr` persistent to this deployment. Persistent in that now the initramfs switchroot tool knows how to mount it as well. In this model, if you want to discard the hotfix, at the moment you roll back/reboot into the clone. Note originally, I tried using `rofiles-fuse` over `/usr` for this, but then everything immediately explodes because the default (at least CentOS 7) SELinux policy denies tons of things (including `sshd_t` access to `fusefs_t`). Sigh. So the switch to `overlayfs` came after experimentation. It still seems to have some issues...specifically `unix_chkpwd` is broken, possibly because it's setuid? Basically I can't ssh in anymore. But I *can* `rpm -Uvh strace.rpm` which is handy. NOTE: I haven't tested the hotfix path fully yet, specifically the initramfs bits.
* tests: Unify some tmpdir code, add ability for C to use libtest.shColin Walters2016-03-031-4/+14
| | | | | | | | | | | | | | I want to be able to easily test the C API on actual data in an OSTree repo. The shell `libtest.sh` has code to generate it. Bridge the two worlds by introducing a little `libostreetest` library which has a C API which spawns a shell that runs things in `libtest.sh`. Yes, this is about as beautiful as it sounds, which is to say, it's not. But it works! Note while we were here, I realized we were actually now creating *two* tmpdirs per test in `make check` because the tap driver was already doing that. Unify it so we know the C code can rely on it.
* tests: Port to glib-tap.mk, make `make check` run all of the testsColin Walters2016-03-034-0/+818
OSTree's code for testing predates the `glib-tap.mk` making its way into GLib. Let's switch to it, as it provides a number of advantages. By far the biggest advantage is that `make check` can start to run most of the tests *in addition* to having them work installed. This commit keeps the installed tests working, but `make check` turns out to be really broken because...our TAP usage has bitrotted to say the least. Fix that all up. Do some hacks so that the tests work uninstalled as well - in particular, `glib-tap.mk` and the bits encoded into `g_test_build_filename()` assume *recursive* Automake (blah). Work around that by creating a symlink when installed to loop back.