aboutsummaryrefslogtreecommitdiff
path: root/tests/ca
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-17 11:22:31 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-17 17:36:12 -0400
commitaa74c7b0bcd31a6c0f75f5fa09f417bcbef4ad14 (patch)
tree719c00d6fac1b6c4748749f2e035ff7819210080 /tests/ca
parent64ee02890c965bc5d8747f78e6298205c9307335 (diff)
Gate experimental features in `DerivationOutput::fromJSON`
This is an entry point for outside data, so we need to check enabled experimental features here.
Diffstat (limited to 'tests/ca')
-rw-r--r--tests/ca/derivation-json.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/ca/derivation-json.sh b/tests/ca/derivation-json.sh
index 3615177e9..c1480fd17 100644
--- a/tests/ca/derivation-json.sh
+++ b/tests/ca/derivation-json.sh
@@ -16,6 +16,9 @@ drvPath3=$(nix derivation add --dry-run < $TEST_HOME/foo.json)
# With --dry-run nothing is actually written
[[ ! -e "$drvPath3" ]]
+# But the JSON is rejected without the experimental feature
+expectStderr 1 nix derivation add < $TEST_HOME/foo.json --experimental-features nix-command | grepQuiet "experimental Nix feature 'ca-derivations' is disabled"
+
# Without --dry-run it is actually written
drvPath4=$(nix derivation add < $TEST_HOME/foo.json)
[[ "$drvPath4" = "$drvPath3" ]]