summaryrefslogtreecommitdiff
path: root/tests/test-repo.sh
diff options
context:
space:
mode:
authorMatthew Leeds <matthew.leeds@endlessm.com>2020-07-30 17:05:43 -0700
committerAlexander Larsson <alexander.larsson@gmail.com>2020-08-31 16:29:03 +0200
commitd2d5397cc15fb60faf515e444d9cc34b9e5af16d (patch)
treedb169fdb7a5da5c35d92977e13ea8e58200c626a /tests/test-repo.sh
parentf24b1fdc1aff9787d219a87a4ca15f0eed4d6420 (diff)
downloadflatpak-d2d5397cc15fb60faf515e444d9cc34b9e5af16d.tar.gz
Add pin command to keep unused runtimes
As discussed here [1], we want a way to mark runtimes to be kept even when they are unused by any apps and we are removing such runtimes. Currently this is a command that can be run manually; a subsequent commit will pin runtimes automatically if they are installed independently of any app. A unit test is included. [1] https://github.com/flatpak/flatpak/issues/2639#issuecomment-662311756
Diffstat (limited to 'tests/test-repo.sh')
-rw-r--r--tests/test-repo.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/test-repo.sh b/tests/test-repo.sh
index a367a1b1..5c2db337 100644
--- a/tests/test-repo.sh
+++ b/tests/test-repo.sh
@@ -24,7 +24,7 @@ set -euo pipefail
skip_without_bwrap
skip_revokefs_without_fuse
-echo "1..37"
+echo "1..38"
#Regular repo
setup_repo
@@ -587,6 +587,30 @@ assert_not_file_has_content list-log "org\.test\.Platform"
ok "uninstall --unused"
+${FLATPAK} ${U} install -y test-repo org.test.Platform
+
+${FLATPAK} ${U} list -a --columns=application > list-log
+assert_file_has_content list-log "org\.test\.Platform"
+
+# Check that the runtime won't be removed if it's pinned
+${FLATPAK} ${U} pin org.test.Platform
+${FLATPAK} ${U} pin > pins
+assert_file_has_content pins "org\.test\.Platform"
+rm pins
+
+${FLATPAK} ${U} uninstall -y --unused
+
+${FLATPAK} ${U} list -a --columns=application > list-log
+assert_file_has_content list-log "org\.test\.Platform"
+
+# Remove the pin and try again
+${FLATPAK} ${U} pin --remove "org.test.Platform"
+${FLATPAK} ${U} uninstall -y --unused
+${FLATPAK} ${U} list -a --columns=application > list-log
+assert_not_file_has_content list-log "org\.test\.Platform"
+
+ok "uninstall --unused ignores pinned runtimes"
+
# Test that remote-ls works in all of the following cases:
# * system remote, and --system is used
# * system remote, and --system is omitted