diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2023-11-10 21:37:28 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2023-12-11 23:18:53 +0100 |
| commit | 1e47148f46e31eb99ce8ec7bc12232cf50d0ebec (patch) | |
| tree | a2693022e88bc939e32b47671f8464d3ec3d4df0 /tests | |
| parent | b650dcabf1cd1aa596228e1e7eff4acf372ef6a6 (diff) | |
daemon: Implement ‘substitute-urls’ RPC.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump.
(WorkerOp): Add ‘wopSubstituteURLs’.
* nix/nix-daemon/nix-daemon.cc (performOp): Implement it.
* guix/store.scm (%protocol-version): Bump.
(operation-id): Add ‘substitute-urls’.
(substitute-urls): New procedure.
* tests/store.scm ("substitute-urls, default")
("substitute-urls, client-specified URLs")
("substitute-urls, disabled"): New tests.
Change-Id: I2c0119500c3a1eecfa5ebf32463ffb0f173161de
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/store.scm | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/tests/store.scm b/tests/store.scm index 5df28adf0d2..45948f4f433 100644 --- a/tests/store.scm +++ b/tests/store.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012-2021, 2023 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -105,7 +105,28 @@ | |||
| 105 | "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/bin/guile"))) | 105 | "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/bin/guile"))) |
| 106 | (not (direct-store-path? (%store-prefix))))) | 106 | (not (direct-store-path? (%store-prefix))))) |
| 107 | 107 | ||
| 108 | (test-skip (if %store 0 15)) | 108 | (test-skip (if %store 0 18)) |
| 109 | |||
| 110 | (test-equal "substitute-urls, default" | ||
| 111 | (list (getenv "GUIX_BINARY_SUBSTITUTE_URL")) | ||
| 112 | (with-store store | ||
| 113 | (set-build-options store #:use-substitutes? #t) | ||
| 114 | (substitute-urls store))) | ||
| 115 | |||
| 116 | (test-equal "substitute-urls, client-specified URLs" | ||
| 117 | '("http://substitutes.example.org" | ||
| 118 | "http://other.example.org") | ||
| 119 | (with-store store | ||
| 120 | (set-build-options store #:use-substitutes? #t | ||
| 121 | #:substitute-urls '("http://substitutes.example.org" | ||
| 122 | "http://other.example.org")) | ||
| 123 | (substitute-urls store))) | ||
| 124 | |||
| 125 | (test-equal "substitute-urls, disabled" | ||
| 126 | '() | ||
| 127 | (with-store store | ||
| 128 | (set-build-options store #:use-substitutes? #f) | ||
| 129 | (substitute-urls store))) | ||
| 109 | 130 | ||
| 110 | (test-equal "profiles/per-user exists and is not writable" | 131 | (test-equal "profiles/per-user exists and is not writable" |
| 111 | #o755 | 132 | #o755 |
