summaryrefslogtreecommitdiff
path: root/tests/libostreetest.c
Commit message (Collapse)AuthorAgeFilesLines
* ostree: check g_setenv return valueLuca BRUNO2022-01-101-1/+2
| | | | | This adds proper return-value checks on g_setenv calls. It fixes a static analysis warning highlighted by Coverity.
* tests: assert mandatory values are presentLuca BRUNO2021-12-101-2/+4
| | | | | This adds a couple of string assertions to make sure that the test run is sane.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* tests: [scan-build] Initialize a variableColin Walters2019-10-181-1/+1
| | | | False positive.
* tests: Remove unused includes in libostreetest.cMatthew Leeds2019-02-111-2/+0
| | | | | | | | Since commit a06bd82cd we no longer use OVERLAYFS_SUPER_MAGIC or statfs() so remove the includes for linux/magic.h and sys/vfs.h Closes: #1815 Approved by: cgwalters
* 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
* Cope with xattr syscalls raising EOPNOTSUPPSimon McVittie2017-10-161-4/+6
| | | | | | | | | | | ENOTSUP and EOPNOTSUPP are numerically equal on most Linux ports, but inexplicably differ on PA-RISC (hppa) and possibly other rare architectures. Signed-off-by: Simon McVittie <smcv@collabora.com> Closes: #1275 Approved by: cgwalters
* tests: check for relabeling rather than overlayJonathan Lebon2017-09-301-16/+75
| | | | | | | | | | | | | | | | | Instead of checking for overlayfs, let's explicitly check for our ability to relabel files since we now have a `libtest` function to do this. Also port that logic to `libostreetest`. Note that overlayfs *does* allow manipulating user xattrs. So ideally, we should break down `OSTREE_NO_XATTRS` further to distinguish between tests that use bare repos from other modes. We check the current directory instead of `/` so that developers can just point `TEST_TMPDIR` to a non-overlayfs mount point when hacking from a container. Closes: #1170 Approved by: cgwalters
* tree-wide: Remove Emacs modelinesColin Walters2017-09-211-2/+1
| | | | | | | | | We added a `.dir-locals.el` in commit: 9a77017d87b74c5e2895cdd64ad098018929403f There's no need to have it per-file, with that people might think to add other editors, which is the wrong direction. Closes: #1206 Approved by: jlebon
* tests: Port some bits of C to new styleColin Walters2017-09-131-34/+13
| | | | | | | | Where we can; perhaps after updating libglnx we should use the new test error macro? Closes: #1169 Approved by: jlebon
* tree-wide: Replace archive-z2 with archiveColin Walters2017-09-011-2/+2
| | | | | | | | | | | | In almost all places. There are just a few exceptions; one tricky bit for example is that the repo config must still have `mode=archive-z2`, since `archive` used to mean something else. (We could very likely just get rid of that check, but eh, later). I also added a test that one can still do `ostree repo init --mode=archive-z2`. Closes: #1125 Approved by: jlebon
* libglnx: bump and use new helper methodsJonathan Lebon2017-05-121-1/+1
| | | | | | | Update submodule: libglnx Closes: #857 Approved by: cgwalters
* repo+tests: Add [core]disable-xattrs=true, use it on overlayfsColin Walters2017-03-241-2/+18
| | | | | | | | | | | | | | | | | | | | | | There are a lot of things suboptimal about this approach, but on the other hand we need to get our CI back up and running. The basic approach is to - in the test suite, detect if we're on overlayfs. If so, set a flag in the repo, which gets picked up by a few strategic places in the core to turn on "ignore xattrs". I also had to add a variant of this for the sysroot work. The core problem here is while overlayfs will let us read and see the SELinux labels, it won't let us write them. Down the line, we should improve this so that we can selectively ignore e.g. `security.*` attributes but not `user.*` say. Closes: https://github.com/ostreedev/ostree/issues/758 Closes: #759 Approved by: jlebon
* tests: Ensure mutable deployments from libostreetestDan Nicholson2016-06-271-0/+3
| | | | | | | | | | | | | When creating sysroots with libostreetest, we don't get the benefit of the OSTREE_SYSROOT_DEBUG setting in libtest.sh. That means we'll get immutable deployments that can't be easily cleaned up. Ensure the environment variable is set before creating new sysroots. It would be nice to set the debug flags directly, but that's private API that isn't currently pulled into libostreetest. Closes: #372 Approved by: cgwalters
* libostreetest: include libtest.sh from srcdir, not builddirSimon McVittie2016-06-131-2/+2
| | | | | | | Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #337 Approved by: cgwalters
* tests/test-pull-c: New test that runs through the pull API via CColin Walters2016-06-071-4/+4
| | | | | | | | | We have had in the past issues with running `ostree_repo_pull()` multiple times in the same process, embarassingly enough. Nothing in the current test suite covers this, so let's start. Closes: #322 Approved by: jlebon
* tests: Use strict mode by default for C testsColin Walters2016-06-061-2/+2
| | | | | | | | | I was extending the C-based test suite to cover more, and noticed that we weren't aborting if a command failed. That made the tests somewhat less useful, so let's fix it. Closes: #321 Approved by: jlebon
* lib: Add ostree_sysroot_load_if_changed() APIColin Walters2016-03-031-6/+28
| | | | | | | | | This will allow daemons like rpm-ostree to detect if there are any new deployments efficiently, in combination with using inotify. If there are any changes, rpm-ostree wants publish them on DBus. While we're here, add some changes to start doing unit C testing of the sysroot API.
* tests: Unify some tmpdir code, add ability for C to use libtest.shColin Walters2016-03-031-0/+82
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.