diff --git a/tests/devlxd-container b/tests/devlxd-container index 7bc710eea..7e7dd1754 100755 --- a/tests/devlxd-container +++ b/tests/devlxd-container @@ -115,7 +115,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 53d4fb531..71f9062d9 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