summaryrefslogtreecommitdiff
path: root/tests/test-repo.c
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* tests: Add single process repo locking testsDan Nicholson2021-06-051-0/+306
| | | | | | | | | | The semantics of multiple process locking are covered by test-concurrency.py, but the semantics of the repository locking from a single process aren't handled there. This checks how the repository locking is handled from a single thread with one OstreeRepo, a single thread with multiple OstreeRepos, and multiple threads sharing an OstreeRepo.
* repo: Make locking APIs publicColin Walters2021-06-051-0/+26
| | | | | | | | Doing anything even somewhat sophisticated requires this; turns out our own `ostree prune` CLI wants this, e.g. https://github.com/ostreedev/ostree/issues/2337 Closes: https://github.com/ostreedev/ostree/issues/2286
* repo: Add ostree_repo_write_regfileColin Walters2021-04-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This API is push rather than pull, which makes it much more suitable to use cases like parsing a tar file from external code. Now, we have a large mess in this area internally because the original file writing code was pull based, but static deltas hit the same problem of wanting a push API, so I added this special `OstreeRepoBareContent` just for writing regular files from a push API. Eventually...I'd like to deprecate the pull based API, and rework things so that for regular files the push API is the default, and then `write_content_object()` would be split up into archive/bare cases. In this world the `ostree_repo_write_content()` API would then need to hackily bridge pull to push and it'd be less efficient. Anyways for now due to this bifurcation, this API only works on non-archive repositories, but that's fine for now because that's what I want for the `ostree-ext-container` bits.
* repo: Add ostree_repo_write_symlinkColin Walters2021-04-081-0/+12
| | | | | | | Continuation of the addition of `ostree_repo_write_regfile_inline()`. This will be helpful for ostree-rs-ext and importing from tar, it's quite inefficient and awkward for small files to end up creating a whole `GInputStream` and `GFileInfo` and etc. for small files.
* repo: Add ostree_repo_write_regfile_inlineColin Walters2021-04-081-1/+43
| | | | | | | | | | | | | | | When working on ostree-ext and importing from tar, it's quite inefficient and awkward for small files to end up creating a whole `GInputStream` and `GFileInfo` and etc. for small files. Plus the gtk-rs binding API to map from `impl Read` to Gio https://docs.rs/gio/0.9.1/gio/struct.ReadInputStream.html requires that the input stream is `Send` but the Rust `tar` API isn't. This is only 1/3 of the problem; we also need similar APIs to directly create a symlink, and to stream large objects via a push-based API.
* tests: Update tests for ostree_repo_get_min_free_space_bytes()Umang Jain2018-09-211-7/+2
| | | | | | | https://github.com/ostreedev/ostree/issues/1720 Closes: #1722 Approved by: pwithnall
* Add tests for ostree_repo_get_min_free_space_bytesUmang Jain2018-09-041-0/+54
| | | | | | | https://phabricator.endlessm.com/T23694 Closes: #1715 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
* tests/repo: Drop modeline from top of filePhilip Withnall2017-09-281-2/+1
| | | | | | | | | As per commit 6e4146a3. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1203 Approved by: cgwalters
* tests: Update some tests to use OSTREE_REPO_MODE_ARCHIVE not ARCHIVE_Z2Philip Withnall2017-09-281-3/+3
| | | | | | | | | The latter is deprecated now. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1203 Approved by: cgwalters
* lib/repo: Add ostree_repo_hash() and testsPhilip Withnall2017-09-211-0/+168
Add a hash function for OstreeRepo instances, which relies on the repo being open, and hence being able to hash the device and inode of its root directory. Add unit tests for this and ostree_repo_equal(). Signed-off-by: Philip Withnall <withnall@endlessm.com> https://github.com/ostreedev/ostree/issues/1191 Closes: #1205 Approved by: cgwalters