mirror of
https://github.com/NixOS/nix.git
synced 2024-10-31 22:30:52 +00:00
Test nix-env --switch-generation
This commit is contained in:
parent
7bbc68fdff
commit
d58ceae022
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user