From a1a8b7f2e20513a3ad968e74e7ec52546404e3c6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 11 Feb 2017 22:26:36 +0100 Subject: tests: Relax test on utmpx entries. Partly fixes . Reported by Paul Garlick . * tests/syscalls.scm ("utmpx-entries"): Check whether ENTRY is of type 'BOOT_TIME', in which case PID may be 0. --- tests/syscalls.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 1934704375..8db45b41b6 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -447,7 +447,8 @@ (define perform-container-tests? (every (lambda (entry) (match (utmpx-user entry) ((? string?) - (> (utmpx-pid entry) 0)) + (or (eqv? (login-type BOOT_TIME) (utmpx-login-type entry)) + (> (utmpx-pid entry) 0))) (#f ;might be DEAD_PROCESS #t))) entries)))) -- cgit v1.2.3 From ce8963c5b7a728257920aeceeb89e40d166d09f4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 13 Feb 2017 16:04:09 +0100 Subject: tests: Adjust for 'http-fetch' change in (guix import json). This is a followup to commit 81e0bc1834490a1a8092c75a0733b15c2b407285. * tests/cpan.scm ("cpan->guix-package"): Add a 'rest' argument to the lambda that mocks 'http-fetch'. * tests/crate.scm ("crate->guix-package"): Likewise. * tests/gem.scm ("gem->guix-package"): Likewise. * tests/pypi.scm ("pypi->guix-package"): Likewise. ("pypi->guix-package, wheels"): Likewise. --- tests/cpan.scm | 2 +- tests/crate.scm | 2 +- tests/gem.scm | 2 +- tests/pypi.scm | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/cpan.scm b/tests/cpan.scm index 0c28a74d3e..8b588517c9 100644 --- a/tests/cpan.scm +++ b/tests/cpan.scm @@ -72,7 +72,7 @@ (define test-source test-source) (_ (error "Unexpected URL: " url)))))))) (mock ((guix http-client) http-fetch - (lambda (url) + (lambda (url . rest) (match url ("https://api.metacpan.org/release/Foo-Bar" (values (open-input-string test-json) diff --git a/tests/crate.scm b/tests/crate.scm index 0bb344bb8a..eb93822bbb 100644 --- a/tests/crate.scm +++ b/tests/crate.scm @@ -65,7 +65,7 @@ (define test-source-hash (test-assert "crate->guix-package" ;; Replace network resources with sample data. (mock ((guix http-client) http-fetch - (lambda (url) + (lambda (url . rest) (match url ("https://crates.io/api/v1/crates/foo" (open-input-string test-crate)) diff --git a/tests/gem.scm b/tests/gem.scm index 669cd8ee60..a39e8ba514 100644 --- a/tests/gem.scm +++ b/tests/gem.scm @@ -47,7 +47,7 @@ (define test-json (test-assert "gem->guix-package" ;; Replace network resources with sample data. (mock ((guix http-client) http-fetch - (lambda (url) + (lambda (url . rest) (match url ("https://rubygems.org/api/v1/gems/foo.json" (values (open-input-string test-json) diff --git a/tests/pypi.scm b/tests/pypi.scm index a132900566..28cc115a9d 100644 --- a/tests/pypi.scm +++ b/tests/pypi.scm @@ -118,7 +118,7 @@ (define test-metadata ("https://example.com/foo-1.0.0-py2.py3-none-any.whl" #f) (_ (error "Unexpected URL: " url))))) (mock ((guix http-client) http-fetch - (lambda (url) + (lambda (url . rest) (match url ("https://pypi.python.org/pypi/foo/json" (values (open-input-string test-json) @@ -181,7 +181,7 @@ (define test-metadata (delete-file-recursively "foo-1.0.0.dist-info"))) (_ (error "Unexpected URL: " url))))) (mock ((guix http-client) http-fetch - (lambda (url) + (lambda (url . rest) (match url ("https://pypi.python.org/pypi/foo/json" (values (open-input-string test-json) -- cgit v1.2.3