summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-05-31 17:58:46 +0200
committerLudovic Courtès <ludo@gnu.org>2016-05-31 18:22:14 +0200
commit151afd84dc9bf8f13de79a689f7f163fba7254ec (patch)
treea20bebb620bc545f277cf2c6f709a2b881b1a3fb /tests
parent4078fa8f72fd109882f8b5e918cb6f7a9c1ed535 (diff)
daemon: Substitute queries return immediately when substitutes are disabled.
Reported by Federico Beffa <beffa@ieee.org> at <https://lists.gnu.org/archive/html/guix-devel/2016-05/msg00928.html>. * nix/libstore/local-store.cc (LocalStore::querySubstitutablePaths) (LocalStore::querySubstitutablePathInfos): Return when 'settings.useSubstitutes' is false. * tests/store.scm ("references/substitutes missing reference info"): Make sure to return #f on failure. * tests/store.scm ("substitutable-path-info when substitutes are turned off"): ("substitutable-paths when substitutes are turned off"): New tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/store.scm29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/store.scm b/tests/store.scm
index 3c2c2475616..38b8efce966 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -205,7 +205,8 @@
205 (%current-system)))) 205 (%current-system))))
206 (d (derivation s "the-thing" b '("--help") 206 (d (derivation s "the-thing" b '("--help")
207 #:inputs `((,b))))) 207 #:inputs `((,b)))))
208 (references/substitutes s (list (derivation->output-path d) b)))))) 208 (references/substitutes s (list (derivation->output-path d) b))
209 #f))))
209 210
210(test-assert "references/substitutes with substitute info" 211(test-assert "references/substitutes with substitute info"
211 (with-store s 212 (with-store s
@@ -231,6 +232,32 @@
231 (,t1) ;refs of T2 232 (,t1) ;refs of T2
232 ())))))) ;refs of T1 233 ())))))) ;refs of T1
233 234
235(test-equal "substitutable-path-info when substitutes are turned off"
236 '()
237 (with-store s
238 (set-build-options s #:use-substitutes? #f)
239 (let* ((b (add-to-store s "bash" #t "sha256"
240 (search-bootstrap-binary "bash"
241 (%current-system))))
242 (d (derivation s "the-thing" b '("--version")
243 #:inputs `((,b))))
244 (o (derivation->output-path d)))
245 (with-derivation-narinfo d
246 (substitutable-path-info s (list o))))))
247
248(test-equal "substitutable-paths when substitutes are turned off"
249 '()
250 (with-store s
251 (set-build-options s #:use-substitutes? #f)
252 (let* ((b (add-to-store s "bash" #t "sha256"
253 (search-bootstrap-binary "bash"
254 (%current-system))))
255 (d (derivation s "the-thing" b '("--version")
256 #:inputs `((,b))))
257 (o (derivation->output-path d)))
258 (with-derivation-narinfo d
259 (substitutable-paths s (list o))))))
260
234(test-assert "requisites" 261(test-assert "requisites"
235 (let* ((t1 (add-text-to-store %store "random1" 262 (let* ((t1 (add-text-to-store %store "random1"
236 (random-text) '())) 263 (random-text) '()))