aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-04-17 00:08:34 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-04-17 00:08:34 +0200
commitf5961dd5854cec1ed9a41365836d63aa15256642 (patch)
tree9e6168827adf5e4e90128d55fad6f0ab6448c86a /tests
parent05bb85fda06dc361b8d3d1eef0759606784b3130 (diff)
parente28ff04108ae7506a21d451cc23d63937076e2a3 (diff)
downloadguix-f5961dd5854cec1ed9a41365836d63aa15256642.tar.gz
guix-f5961dd5854cec1ed9a41365836d63aa15256642.zip
Merge branch 'master' into staging
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-build.sh7
-rw-r--r--tests/guix-gc.sh6
-rw-r--r--tests/store-roots.scm53
-rw-r--r--tests/zlib.scm7
4 files changed, 67 insertions, 6 deletions
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index 66bf6be8d0..d479296ef1 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -183,6 +183,13 @@ then false; else true; fi
rm -f "$result"
+# Check relative file name canonicalization: <https://bugs.gnu.org/35271>.
+mkdir "$result"
+guix build -r "$result/x" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
+test -x "$result/x/bin/guile"
+rm "$result/x"
+rmdir "$result"
+
# Cross building.
guix build coreutils --target=mips64el-linux-gnu --dry-run --no-substitutes
diff --git a/tests/guix-gc.sh b/tests/guix-gc.sh
index ef2d9543b7..8284287730 100644
--- a/tests/guix-gc.sh
+++ b/tests/guix-gc.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2013, 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -34,7 +34,7 @@ unset drv
unset out
# For some operations, passing extra arguments is an error.
-for option in "" "-C 500M" "--verify" "--optimize"
+for option in "" "-C 500M" "--verify" "--optimize" "--list-roots"
do
if guix gc $option whatever; then false; else true; fi
done
@@ -69,6 +69,8 @@ guix gc --delete "$drv"
drv="`guix build --root=guix-gc-root lsh -d`"
test -f "$drv" && test -L guix-gc-root
+guix gc --list-roots | grep "$PWD/guix-gc-root"
+
guix gc --list-live | grep "$drv"
if guix gc --delete "$drv";
then false; else true; fi
diff --git a/tests/store-roots.scm b/tests/store-roots.scm
new file mode 100644
index 0000000000..5bcf1bc87e
--- /dev/null
+++ b/tests/store-roots.scm
@@ -0,0 +1,53 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (test-store-deduplication)
+ #:use-module (guix tests)
+ #:use-module (guix store)
+ #:use-module (guix store roots)
+ #:use-module ((guix utils) #:select (call-with-temporary-directory))
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-64))
+
+(define %store
+ (open-connection))
+
+(test-begin "store-roots")
+
+(test-assert "gc-roots, regular root"
+ (let* ((item (add-text-to-store %store "something"
+ (random-text)))
+ (root (string-append %gc-roots-directory "/test-gc-root")))
+ (symlink item root)
+ (let ((result (member root (gc-roots))))
+ (delete-file root)
+ result)))
+
+(test-assert "gc-roots, indirect root"
+ (call-with-temporary-directory
+ (lambda (directory)
+ (let* ((item (add-text-to-store %store "something"
+ (random-text)))
+ (root (string-append directory "/gc-root")))
+ (symlink item root)
+ (add-indirect-root %store root)
+ (let ((result (member root (gc-roots))))
+ (delete-file root)
+ result)))))
+
+(test-end "store-roots")
diff --git a/tests/zlib.scm b/tests/zlib.scm
index 5455240a71..7c595a422c 100644
--- a/tests/zlib.scm
+++ b/tests/zlib.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2019 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -26,11 +26,10 @@
;; Test the (guix zlib) module.
-(unless (zlib-available?)
- (exit 77))
-
(test-begin "zlib")
+(unless (zlib-available?)
+ (test-skip 1))
(test-assert "compression/decompression pipe"
(let ((data (random-bytevector (+ (random 10000)
(* 20 1024)))))