diff options
Diffstat (limited to 'tests/guix-environment-container.sh')
| -rw-r--r-- | tests/guix-environment-container.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index 5b89f8383b6..8947a4ea1ba 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh | |||
| @@ -186,6 +186,24 @@ HOME="$tmpdir" guix environment --bootstrap --container --user=foognu \ | |||
| 186 | -- /bin/sh -c 'test $(pwd) == "/home/foo" -a ! -d '"$tmpdir" | 186 | -- /bin/sh -c 'test $(pwd) == "/home/foo" -a ! -d '"$tmpdir" |
| 187 | ) | 187 | ) |
| 188 | 188 | ||
| 189 | # '--cwd' is independent from sharing the host current working directory. | ||
| 190 | ( | ||
| 191 | cd "$tmpdir" \ | ||
| 192 | && guix environment --bootstrap --container --no-cwd --cwd=/tmp \ | ||
| 193 | --ad-hoc guile-bootstrap --pure \ | ||
| 194 | -- /bin/sh -c 'test $(pwd) == "/tmp" -a ! -d '"$tmpdir" | ||
| 195 | ) | ||
| 196 | |||
| 197 | # Relative '--cwd' is resolved against the host CWD and still honors '--user'. | ||
| 198 | mkdir -p "$tmpdir/home/wd" | ||
| 199 | home_dir="$(cd "$tmpdir/home"; pwd -P)" | ||
| 200 | ( | ||
| 201 | cd "$tmpdir/home/wd" \ | ||
| 202 | && HOME="$home_dir" guix environment --bootstrap --container --user=foo \ | ||
| 203 | --cwd=. --ad-hoc guile-bootstrap --pure \ | ||
| 204 | -- /bin/sh -c 'test "$(pwd)" = "/home/foo/wd"' | ||
| 205 | ) | ||
| 206 | |||
| 189 | # Check that the root file system is read-only by default... | 207 | # Check that the root file system is read-only by default... |
| 190 | guix environment --bootstrap --container --ad-hoc guile-bootstrap \ | 208 | guix environment --bootstrap --container --ad-hoc guile-bootstrap \ |
| 191 | -- guile -c '(mkdir "/whatever")' && false | 209 | -- guile -c '(mkdir "/whatever")' && false |
