From 792ba21b15b8bddfda67c436440f1fa9d6703f5c Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Tue, 17 Dec 2024 14:09:46 -0500 Subject: [PATCH] tests/vm-migration: check VM location before/after move Signed-off-by: Simon Deziel --- tests/vm-migration | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/vm-migration b/tests/vm-migration index c1974c8e..2f28b5aa 100644 --- a/tests/vm-migration +++ b/tests/vm-migration @@ -131,8 +131,14 @@ lxc exec member1 -- lxc config device add v1 vol1-disk disk pool=ceph source=vol lxc exec member1 -- lxc start v1 sleep 60 +# Ascertain that the VM is indeed on member1. +[ "$(lxc exec member1 -- lxc list -c L -f csv v1)" = "member1" ] + # Move the VM to member2 but with a timeout as this sometimes hangs indefinitely but when it works it's fast. lxc exec member1 -- timeout 600 lxc move v1 --target member2 +# Verify the migration did succeeded and the VM is running on member2. +[ "$(lxc exec member1 -- lxc list -c L -f csv v1)" = "member2" ] + # shellcheck disable=SC2034 FAIL=0