Skip to content

Commit

Permalink
tests: Update devlxd request source identification
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Sep 13, 2024
1 parent 09d91a0 commit 9e187da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/devlxd-container
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ kill -9 "${monitorPID}"

# If the guest retrieved the image from the host, the host should emit an "image-retrieved" lifecycle event. The
# requestor address tells us that this was definitely the guest.
[ "$(grep -wF 'image-retrieved' monitor.json | jq -r '.metadata.requestor.address')" = "@devlxd" ]
# Newer LXD versions use the protocol instead of the requestor address to distinguish devlxd requests
[ "$(grep -wF 'image-retrieved' monitor.json | jq -r '.metadata.requestor.address')" = "@devlxd" ] || \
[ "$(grep -wF 'image-retrieved' monitor.json | jq -r '.metadata.requestor.protocol')" = "devlxd" ]
rm monitor.json

echo "==> Deleting container"
Expand Down
3 changes: 2 additions & 1 deletion tests/devlxd-vm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ if hasNeededAPIExtension devlxd_images_vm; then

# If the guest retrieved the image from the host, the host should emit an "image-retrieved" lifecycle event. The
# requestor address tells us that this was definitely the guest.
[ "$(grep -wF 'image-retrieved' monitor.json | jq -r '.metadata.requestor.address')" = "@devlxd" ]
[ "$(grep -wF 'image-retrieved' monitor.json | jq -r '.metadata.requestor.address')" = "@devlxd" ] || \
[ "$(grep -wF 'image-retrieved' monitor.json | jq -r '.metadata.requestor.protocol')" = "devlxd" ]
rm monitor.json
fi

Expand Down

0 comments on commit 9e187da

Please sign in to comment.