From 9e187daf2aff6c0a8af971c02cf2f250ae6af5fc Mon Sep 17 00:00:00 2001 From: hamistao Date: Wed, 11 Sep 2024 19:59:15 -0300 Subject: [PATCH] tests: Update devlxd request source identification Signed-off-by: hamistao --- tests/devlxd-container | 4 +++- tests/devlxd-vm | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/devlxd-container b/tests/devlxd-container index bb0d57afd..76c27cde0 100755 --- a/tests/devlxd-container +++ b/tests/devlxd-container @@ -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" diff --git a/tests/devlxd-vm b/tests/devlxd-vm index 4037423dc..ccca1290e 100755 --- a/tests/devlxd-vm +++ b/tests/devlxd-vm @@ -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