summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2014-10-10 17:58:43 +0400
committerAlex Kost <alezost@gmail.com>2014-10-12 08:45:38 +0400
commitb3bb82f1542ec0805b87305482829102f2faaa92 (patch)
treee209c5e03ff1ad44068bf84e6f2402a364ed42fa /tests
parent3ccde087528cc04ef5275224ca6123b68e075e3c (diff)
guix package: Add '--switch-generation' option.
* guix/scripts/package.scm (switch-to-generation): New procedure. (switch-to-previous-generation): Use it. (guix-package): Adjust for '--switch-generation' option. * tests/guix-package.sh: Test it. * doc/guix.texi (Invoking guix package): Document it.
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-package.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index e35871f2a24..3e0e36fa23c 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -87,6 +87,8 @@ then
87 # Exit with 1 when a generation does not exist. 87 # Exit with 1 when a generation does not exist.
88 if guix package -p "$profile" --list-generations=42; 88 if guix package -p "$profile" --list-generations=42;
89 then false; else true; fi 89 then false; else true; fi
90 if guix package -p "$profile" --switch-generation=99;
91 then false; else true; fi
90 92
91 # Remove a package. 93 # Remove a package.
92 guix package --bootstrap -p "$profile" -r "guile-bootstrap" 94 guix package --bootstrap -p "$profile" -r "guile-bootstrap"
@@ -101,6 +103,12 @@ then
101 test "`readlink_base "$profile"`" = "$profile-1-link" 103 test "`readlink_base "$profile"`" = "$profile-1-link"
102 test -x "$profile/bin/guile" && ! test -x "$profile/bin/make" 104 test -x "$profile/bin/guile" && ! test -x "$profile/bin/make"
103 105
106 # Switch to the rolled generation and switch back.
107 guix package -p "$profile" --switch-generation=2
108 test "`readlink_base "$profile"`" = "$profile-2-link"
109 guix package -p "$profile" --switch-generation=-1
110 test "`readlink_base "$profile"`" = "$profile-1-link"
111
104 # Move to the empty profile. 112 # Move to the empty profile.
105 for i in `seq 1 3` 113 for i in `seq 1 3`
106 do 114 do
@@ -133,10 +141,12 @@ then
133 grep "`guix build -e "$boot_make"`" "$profile/manifest" 141 grep "`guix build -e "$boot_make"`" "$profile/manifest"
134 142
135 # Make a "hole" in the list of generations, and make sure we can 143 # Make a "hole" in the list of generations, and make sure we can
136 # roll back "over" it. 144 # roll back and switch "over" it.
137 rm "$profile-1-link" 145 rm "$profile-1-link"
138 guix package --bootstrap -p "$profile" --roll-back 146 guix package --bootstrap -p "$profile" --roll-back
139 test "`readlink_base "$profile"`" = "$profile-0-link" 147 test "`readlink_base "$profile"`" = "$profile-0-link"
148 guix package -p "$profile" --switch-generation=+1
149 test "`readlink_base "$profile"`" = "$profile-2-link"
140 150
141 # Make sure LIBRARY_PATH gets listed by `--search-paths'. 151 # Make sure LIBRARY_PATH gets listed by `--search-paths'.
142 guix package --bootstrap -p "$profile" -i guile-bootstrap -i gcc-bootstrap 152 guix package --bootstrap -p "$profile" -i guile-bootstrap -i gcc-bootstrap