aboutsummaryrefslogtreecommitdiff
path: root/tests/functional
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/nix-profile.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/functional/nix-profile.sh b/tests/functional/nix-profile.sh
index 7c478a0cd..b19341851 100644
--- a/tests/functional/nix-profile.sh
+++ b/tests/functional/nix-profile.sh
@@ -47,7 +47,7 @@ cp ./config.nix $flake1Dir/
# Test upgrading from nix-env.
nix-env -f ./user-envs.nix -i foo-1.0
-nix profile list | grep -A2 'Index:.*0' | grep 'Store paths:.*foo-1.0'
+nix profile list | grep -A2 'Name:.*foo' | grep 'Store paths:.*foo-1.0'
nix profile install $flake1Dir -L
nix profile list | grep -A4 'Index:.*1' | grep 'Locked flake URL:.*narHash'
[[ $($TEST_HOME/.nix-profile/bin/hello) = "Hello World" ]]
@@ -81,7 +81,7 @@ nix profile rollback
# Test uninstall.
[ -e $TEST_HOME/.nix-profile/bin/foo ]
-nix profile remove 0
+nix profile remove "foo"
(! [ -e $TEST_HOME/.nix-profile/bin/foo ])
nix profile history | grep 'foo: 1.0 -> ∅'
nix profile diff-closures | grep 'Version 3 -> 4'
@@ -93,6 +93,13 @@ nix profile remove 1
nix profile install $(nix-build --no-out-link ./simple.nix)
[[ $(cat $TEST_HOME/.nix-profile/hello) = "Hello World!" ]]
+# Test packages with same name from different sources
+mkdir $TEST_ROOT/simple-too
+cp ./simple.nix ./config.nix simple.builder.sh $TEST_ROOT/simple-too
+nix profile install --file $TEST_ROOT/simple-too/simple.nix ''
+nix profile list | grep -A4 'Name:.*simple' | grep 'Name:.*simple1'
+nix profile remove simple1
+
# Test wipe-history.
nix profile wipe-history
[[ $(nix profile history | grep Version | wc -l) -eq 1 ]]
@@ -104,7 +111,7 @@ nix profile upgrade 0
nix profile history | grep "packages.$system.default: 1.0, 1.0-man -> 3.0, 3.0-man"
# Test new install of CA package.
-nix profile remove 0
+nix profile remove flake1
printf 4.0 > $flake1Dir/version
printf Utrecht > $flake1Dir/who
nix profile install $flake1Dir
@@ -112,19 +119,20 @@ nix profile install $flake1Dir
[[ $(nix path-info --json $(realpath $TEST_HOME/.nix-profile/bin/hello) | jq -r .[].ca) =~ fixed:r:sha256: ]]
# Override the outputs.
-nix profile remove 0 1
+nix profile remove simple flake1
nix profile install "$flake1Dir^*"
[[ $($TEST_HOME/.nix-profile/bin/hello) = "Hello Utrecht" ]]
[ -e $TEST_HOME/.nix-profile/share/man ]
[ -e $TEST_HOME/.nix-profile/include ]
printf Nix > $flake1Dir/who
-nix profile upgrade 0
+nix profile list
+nix profile upgrade flake1
[[ $($TEST_HOME/.nix-profile/bin/hello) = "Hello Nix" ]]
[ -e $TEST_HOME/.nix-profile/share/man ]
[ -e $TEST_HOME/.nix-profile/include ]
-nix profile remove 0
+nix profile remove flake1
nix profile install "$flake1Dir^man"
(! [ -e $TEST_HOME/.nix-profile/bin/hello ])
[ -e $TEST_HOME/.nix-profile/share/man ]