about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-26T17·45+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-26T17·45+0100
commitd58ceae022ad887686e55068db7229f931eb96af (patch)
tree832d7de044b75c0737cb20654f346d2e670a2d3d /tests
parent7bbc68fdff0afe22a517b63f3ca37d9021a5799c (diff)
Test nix-env --switch-generation
Diffstat (limited to 'tests')
-rw-r--r--tests/user-envs.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/user-envs.sh b/tests/user-envs.sh
index ab445a8ee9fc..0d997acd69d9 100644
--- a/tests/user-envs.sh
+++ b/tests/user-envs.sh
@@ -86,7 +86,9 @@ if nix-env -q '*' | grep -q foo; then false; fi
 nix-env -q '*' | grep -q bar
 
 # Rollback: should bring "foo" back.
+oldGen="$(nix-store -q --resolve $profiles/test)"
 nix-env --rollback
+[ "$(nix-store -q --resolve $profiles/test)" != "$oldGen" ]
 nix-env -q '*' | grep -q foo-2.0
 nix-env -q '*' | grep -q bar
 
@@ -99,6 +101,10 @@ if nix-env -q '*' | grep -q bar; then false; fi
 nix-env --list-generations
 test "$(nix-env --list-generations | wc -l)" -eq 7
 
+# Switch to a specified generation.
+nix-env --switch-generation 7
+[ "$(nix-store -q --resolve $profiles/test)" = "$oldGen" ]
+
 # Install foo-1.0, now using its store path.
 nix-env -i "$outPath10"
 nix-env -q '*' | grep -q foo-1.0