me
/
guix
Archived
1
0
Fork 0

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.
master
Ludovic Courtès 2022-02-18 23:07:21 +01:00
parent 26e67e0280
commit 5fabaf1128
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 23 additions and 0 deletions

View File

@ -108,6 +108,7 @@ EOF
# Make sure preexisting files were backed up. # Make sure preexisting files were backed up.
grep "overridden" "$HOME"/*guix-home*backup/.bashrc grep "overridden" "$HOME"/*guix-home*backup/.bashrc
grep "overridden" "$HOME"/*guix-home*backup/.config/test.conf grep "overridden" "$HOME"/*guix-home*backup/.config/test.conf
rm -r "$HOME"/*guix-home*backup
# #
# Test 'guix home describe'. # Test 'guix home describe'.
@ -131,6 +132,28 @@ EOF
} }
test "$(canonical_file_name)" == "$(readlink "${HOME}/.guix-home")" 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'. # Test 'guix home search'.
# #