about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-12-04T13·30+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-12-04T13·30+0100
commit2d5e8e267b58f531f00b043c9e3dbaefad62a4a1 (patch)
tree7ffc983e9b68fdfed02f39013d747dc901449164 /tests
parent5ad89398d12bf8bc83426036dedc2c601ff8f795 (diff)
Add a test for ‘nix-env --set-flag active ...’
Diffstat (limited to 'tests')
-rw-r--r--tests/user-envs.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/user-envs.sh b/tests/user-envs.sh
index 2bc9bee50baa..465d2fc55d99 100644
--- a/tests/user-envs.sh
+++ b/tests/user-envs.sh
@@ -22,6 +22,14 @@ test "$(nix-env -p $profiles/test -q '*' | wc -l)" -eq 1
 nix-env -p $profiles/test -q '*' | grep -q foo-1.0
 test "$($profiles/test/bin/foo)" = "foo-1.0"
 
+# Disable foo.
+nix-env -p $profiles/test --set-flag active false foo
+! [ -e "$profiles/test/bin/foo" ]
+
+# Enable foo.
+nix-env -p $profiles/test --set-flag active true foo
+[ -e "$profiles/test/bin/foo" ]
+
 # Store the path of foo-1.0.
 outPath10=$(nix-env -p $profiles/test -q --out-path --no-name '*' | grep foo-1.0)
 echo "foo-1.0 = $outPath10"
@@ -67,7 +75,7 @@ if nix-env -p $profiles/test -q '*' | grep -q bar; then false; fi
 
 # Count generations.
 nix-env -p $profiles/test --list-generations
-test "$(nix-env -p $profiles/test --list-generations | wc -l)" -eq 5
+test "$(nix-env -p $profiles/test --list-generations | wc -l)" -eq 7
 
 # Install foo-1.0, now using its store path.
 echo $outPath10