aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-02-18 23:07:21 +0100
committerLudovic Courtès <ludo@gnu.org>2022-03-10 11:43:14 +0100
commit5fabaf112858c5c5e8787e83f8f2002fdc710917 (patch)
tree35703599a95387d28185028a623b728fa7172b8b /tests
parent26e67e0280f9e35543c8ea71c6a3d58beb83287d (diff)
downloadguix-5fabaf112858c5c5e8787e83f8f2002fdc710917.tar.gz
guix-5fabaf112858c5c5e8787e83f8f2002fdc710917.zip
tests: Check 'guix home reconfigure' for a second generation.
* tests/guix-home.sh: Invoke "guix home reconfigure" a second time with a modify config file and check the result.
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-home.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
index 3b397649cc..f054d15172 100644
--- a/tests/guix-home.sh
+++ b/tests/guix-home.sh
@@ -108,6 +108,7 @@ EOF
# Make sure preexisting files were backed up.
grep "overridden" "$HOME"/*guix-home*backup/.bashrc
grep "overridden" "$HOME"/*guix-home*backup/.config/test.conf
+ rm -r "$HOME"/*guix-home*backup
#
# Test 'guix home describe'.
@@ -132,6 +133,28 @@ EOF
test "$(canonical_file_name)" == "$(readlink "${HOME}/.guix-home")"
#
+ # Configure a new generation.
+ #
+
+ # Change the bashrc snippet content and comment out one service.
+ sed -i "home.scm" -e's/the content of/the NEW content of/g'
+ sed -i "home.scm" -e"s/(simple-service 'test-config/#;(simple-service 'test-config/g"
+
+ guix home reconfigure "${test_directory}/home.scm"
+ test "$(tail -n 2 "${HOME}/.bashrc")" == "\
+# dot-bashrc test file for guix home
+# the NEW content of bashrc-test-config.sh"
+
+ # This file must have been removed and not backed up.
+ ! test -e "$HOME/.config/test.conf"
+ ! test -e "$HOME"/*guix-home*backup/.config/test.conf
+
+ test "$(cat "$(configuration_file)")" == "$(cat home.scm)"
+ test "$(canonical_file_name)" == "$(readlink "${HOME}/.guix-home")"
+
+ test $(guix home list-generations | grep "^Generation" | wc -l) -eq 2
+
+ #
# Test 'guix home search'.
#