aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-gc.sh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-11-11 23:05:43 +0100
committerLudovic Courtès <ludo@gnu.org>2015-11-11 23:29:20 +0100
commit3a96d7c3dd864e4312df723ea54c2f710f55380c (patch)
tree7e8ec13fadda544f33c095e8742314210c4db6a0 /tests/guix-gc.sh
parent6237b9fa39c6ab3283c50b96520b990c8612abc1 (diff)
downloadguix-3a96d7c3dd864e4312df723ea54c2f710f55380c.tar
guix-3a96d7c3dd864e4312df723ea54c2f710f55380c.tar.gz
guix gc: Error out when extra arguments are passed.
Fixes <http://bugs.gnu.org/21817>. Reported by Petter Berntsen <petter@mykolab.ch>. * guix/scripts/gc.scm (guix-gc)[assert-no-extra-arguments]: New procedure. Use it for actions 'collect-garbage', 'optimize', and 'verify'. * tests/guix-gc.sh: Add tests.
Diffstat (limited to 'tests/guix-gc.sh')
-rw-r--r--tests/guix-gc.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/guix-gc.sh b/tests/guix-gc.sh
index c1eb66cef5..a100f186f5 100644
--- a/tests/guix-gc.sh
+++ b/tests/guix-gc.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -25,6 +25,12 @@ guix gc --version
trap "rm -f guix-gc-root" EXIT
rm -f guix-gc-root
+# For some operations, passing extra arguments is an error.
+for option in "" "-C 500M" "--verify" "--optimize"
+do
+ if guix gc $option whatever; then false; else true; fi
+done
+
# Check the references of a .drv.
drv="`guix build guile-bootstrap -d`"
out="`guix build guile-bootstrap`"