summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-12-05 23:41:30 +0100
committerMarius Bakke <mbakke@fastmail.com>2017-12-05 23:41:30 +0100
commit77181815ae70cf573b6fa390a4400b718835aa8a (patch)
tree731ccaaccc7a69ddc90f04bb71a6a39aa5f3be5a /tests
parente3f9406b7c4b3b1afe3dd6affb7f7898434d607a (diff)
parent35377cfa908340e51fd22af7369aef15499d4a36 (diff)
downloadpatches-77181815ae70cf573b6fa390a4400b718835aa8a.tar
patches-77181815ae70cf573b6fa390a4400b718835aa8a.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-system.sh4
-rw-r--r--tests/lint.scm15
-rw-r--r--tests/publish.scm2
-rw-r--r--tests/store.scm4
-rw-r--r--tests/syscalls.scm7
5 files changed, 26 insertions, 6 deletions
diff --git a/tests/guix-system.sh b/tests/guix-system.sh
index 4bb866adfa..213864833a 100644
--- a/tests/guix-system.sh
+++ b/tests/guix-system.sh
@@ -123,9 +123,9 @@ else
then
# FIXME: With Guile 2.2.0 the error is reported on line 4.
# See <http://bugs.gnu.org/26107>.
- grep "$tmpfile:[49]:[0-9]: GRUB-config.*[Uu]nbound variable" "$errorfile"
+ grep "$tmpfile:[49]:[0-9]\+: GRUB-config.*[Uu]nbound variable" "$errorfile"
else
- grep "$tmpfile:9:[0-9]: GRUB-config.*[Uu]nbound variable" "$errorfile"
+ grep "$tmpfile:9:[0-9]\+: GRUB-config.*[Uu]nbound variable" "$errorfile"
fi
fi
diff --git a/tests/lint.scm b/tests/lint.scm
index 1d0fc4708c..064f3d177e 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
@@ -331,6 +331,19 @@
(check-patch-file-names pkg)))
"file names of patches should start with the package name")))
+(test-assert "patches: file name too long"
+ (->bool
+ (string-contains
+ (with-warnings
+ (let ((pkg (dummy-package "x"
+ (source
+ (dummy-origin
+ (patches (list (string-append "x-"
+ (make-string 100 #\a)
+ ".patch"))))))))
+ (check-patch-file-names pkg)))
+ "file name is too long")))
+
(test-assert "patches: not found"
(->bool
(string-contains
diff --git a/tests/publish.scm b/tests/publish.scm
index f33898fd58..352caf5325 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -352,7 +352,7 @@ FileSize: ~a~%"
(let* ((base "http://localhost:6797/")
(part (store-path-hash-part %item))
(url (string-append base part ".narinfo"))
- (nar-url (string-append base "/nar/gzip/" (basename %item)))
+ (nar-url (string-append base "nar/gzip/" (basename %item)))
(cached (string-append cache "/gzip/" (basename %item)
".narinfo"))
(nar (string-append cache "/gzip/"
diff --git a/tests/store.scm b/tests/store.scm
index 45aeb329b0..fdf3be33f6 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -180,7 +180,9 @@
(random-text) '())))
(let-values (((paths freed) (delete-paths %store (list p))))
(and (equal? paths (list p))
- (> freed 0)
+ ;; XXX: On some file systems (notably Btrfs), freed
+ ;; may return 0. See <https://bugs.gnu.org/29363>.
+ ;;(> freed 0)
(not (file-exists? p))))))
(test-assert "add-text-to-store vs. delete-paths"
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 2b5c4c3be1..22ca2a05d4 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -525,7 +525,12 @@
(every (lambda (entry)
(match (utmpx-user entry)
((? string?)
- (or (eqv? (login-type BOOT_TIME) (utmpx-login-type entry))
+ ;; Ensure we have a valid PID for those entries where it
+ ;; makes sense.
+ (or (not (memv (utmpx-login-type entry)
+ (list (login-type INIT_PROCESS)
+ (login-type LOGIN_PROCESS)
+ (login-type USER_PROCESS))))
(> (utmpx-pid entry) 0)))
(#f ;might be DEAD_PROCESS
#t)))