Skip to content

Commit

Permalink
tests: Add trust by explicitly using a token
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Pelizäus <[email protected]>
  • Loading branch information
roosterfish committed Jun 12, 2024
1 parent 52c4e61 commit ad269aa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/suites/remote.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_remote_url() {
# Add remotes using password.
# shellcheck disable=2153
for url in "${LXD_ADDR}" "https://${LXD_ADDR}"; do
lxc_remote remote add test "${url}" --accept-certificate --password foo
Expand All @@ -9,6 +10,18 @@ test_remote_url() {
lxc_remote remote remove test
done

# Add remotes by setting the token explicitly.
# shellcheck disable=2153
for url in "${LXD_ADDR}" "https://${LXD_ADDR}"; do
token="$(lxc config trust add --name foo -q)"
lxc_remote remote add test "${url}" --accept-certificate --token "${token}"
lxc_remote info test:
lxc_remote config trust list | awk '/@/ {print $8}' | while read -r line ; do
lxc_remote config trust remove "\"${line}\""
done
lxc_remote remote remove test
done

# shellcheck disable=2153
urls="${LXD_DIR}/unix.socket unix:${LXD_DIR}/unix.socket unix://${LXD_DIR}/unix.socket"

Expand Down

0 comments on commit ad269aa

Please sign in to comment.