summaryrefslogtreecommitdiff
path: root/tests/test-prune.sh
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* prune: Error if --static-deltas-only without --delete-commitColin Walters2018-03-051-3/+4
| | | | | | | | | | | | | | The original changes here apparently had the *idea* that `--static-deltas-only` would be useful in general, but we never implemented that. The current situation where it's ignored unless `--delete-commit` is specified is very misleading and I can easily see it leading to data loss for people. Let's error out until we have a chance to make it actually useful. Related: https://github.com/ostreedev/ostree/issues/1479 Closes: #1482 Approved by: giuseppe
* lib/repo: Do account for size with prune --no-pruneColin Walters2018-03-051-0/+7
| | | | | | | | | | | | | | I think this got changed in a refactor. We definitely want to total up the amount of space that *would* be freed even with `--no-prune` AKA `OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE`. It's actually a bit terrifying this is apparently the first test case for the `--no-prune` option... Closes: https://github.com/ostreedev/ostree/issues/1480 Closes: #1483 Approved by: jlebon
* 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
* bin/prune: Add --only-branchColin Walters2017-09-181-1/+52
| | | | | | | | | | | | | | | | | In 5c940987e768523ef1411b65bcaad09fba6befef / #646 we added `--retain-branch-depth`; this adds a symmetric `--only-branch` for the case where a repo owner just wants to prune a specific branch. The implementation here is pretty straightforward; we just walk all refs and inject the equivalent of `--retain-branch-depth=$ref=-1` if they're *not* in `--only-branch`. Closes: https://github.com/ostreedev/ostree/issues/1115 Closes: #1127 Approved by: jlebon
* tests/prune: Factor out a helper for counting commits in the repoColin Walters2017-09-181-28/+20
| | | | | | | We had lots of duplicates; prep for adding more tests. Closes: #1127 Approved by: jlebon
* tree-wide: Replace archive-z2 with archiveColin Walters2017-09-011-1/+1
| | | | | | | | | | | | 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
* repo+tests: Add [core]disable-xattrs=true, use it on overlayfsColin Walters2017-03-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | 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
* Add support for more selective pruningColin Walters2017-01-191-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | There are use cases for having a single repo with branches with different lifecycles; a simple example of what I was trying to do in CentOS Atomic Host work is have "stable" and "devel" branches, were we want to prune devel, but retain *all* of stable. This patch is split into two parts - first we add a low level "delete all objects not in this set" API, and change the current prune API to use this. Next, we move more logic into the "ostree prune" command. This paves the way for demonstrating how more sophisticated algorithms/logic could be developed outside of the ostree core. Also, the --keep-younger-than logic already lived in the commandline, so it makes sense to keep extending it there. Closes: https://github.com/ostreedev/ostree/issues/604 Closes: #646 Approved by: jlebon
* lib: Add an API to list only "our" objects, fix prune to use itColin Walters2016-08-251-1/+37
| | | | | | | | | | | | When doing a prune, we should not try to delete objects in parent repos, since it'll fail. There is a bigger discussion about the semantics of `parent=` to be had, but this will fix trying to use `ostree prune --repo=/ostree/repo/extensions/rpmostree/pkgcache`. Closes: https://github.com/ostreedev/ostree/issues/467 Closes: #471 Approved by: jlebon
* prune: Retain the tip of each ref even with date pruningColin Walters2016-08-091-5/+11
| | | | | | | | | | | | | | I hit an error with [CAHC](https://wiki.centos.org/SpecialInterestGroup/Atomic/Devel) where we were doing time-based pruning. `ostree summary -u` started failing, and it took me a bit to realize it was because we were pruning even the tip of old branches, which I was not at all expecting, and I don't think users will too. Perhaps in the future we could add some sort of --prune-ref-tips or something if people wanted it, but I doubt it. Closes: #445 Approved by: jlebon
* tests: add missing ${CMD_PREFIX} before ostreeGiuseppe Scrivano2016-04-071-2/+2
| | | | | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #242 Approved by: cgwalters
* various tests: skip if temp directory lacks xattr supportSimon McVittie2016-03-311-0/+2
| | | | | | | | | | 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
* tests: Add a commitpartial + prune testColin Walters2016-03-231-1/+9
| | | | Followup for previous commit.
* tests: Port to glib-tap.mk, make `make check` run all of the testsColin Walters2016-03-031-0/+0
| | | | | | | | | | | | | | | | | | 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.
* tests: Use "bash strict mode"Colin Walters2016-01-271-1/+1
| | | | | | | | | | I noticed in the static deltas tests, there were some tests that should have been under `-o pipefail` to ensure we properly propagate errors. There were a few places where we were referencing undefined variables. Overall, this is clearly a good idea IMO.
* tests: add tests for prune --static-deltas-onlyGiuseppe Scrivano2015-12-181-0/+20
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* parse-datetime: use the module from gnulibGiuseppe Scrivano2015-12-041-0/+12
| | | | | | | | | | | | | Use the parse-datetime module from gnulib, and adapt it to not require other modules as portability is not really an issue for us. DATE can be specified in different formats, such as: "-1 week", "last monday", "1 week ago". Include the generated .c file in the repository so to not add another dependency to Bison. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* tests: add tests for prune --keep-younger-than=DATEGiuseppe Scrivano2015-11-161-0/+11
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* tests: add test for ostree prune --delete-commitGiuseppe Scrivano2015-11-161-4/+9
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* tests: add tests for prune and tombstones commitsGiuseppe Scrivano2015-11-031-0/+80
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>