From 572c29c4c35f3e43b8141723dcb8f86ab156c976 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Fri, 4 Oct 2024 19:25:34 +0300 Subject: [PATCH] e2e: adjust $VM_HOSTNAME for policy node config usage. Take into account that $VM_HOSTNAME's like xyzzy-foobar-22.04 will propagate to the VM distro hostname as xyzzy-foobar-22. Signed-off-by: Krisztian Litkey --- test/e2e/run.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/e2e/run.sh b/test/e2e/run.sh index 70a694bf3..ac8943550 100755 --- a/test/e2e/run.sh +++ b/test/e2e/run.sh @@ -481,26 +481,31 @@ get-config-generation() { vm-command-q "kubectl get -n kube-system $resource -ojsonpath={.metadata.generation}" } +get-hostname-for-vm() { + local node="${node:-$VM_HOSTNAME}" + echo ${node%.*} +} + get-config-node-status-generation() { - local resource="$1" node="${node:-$VM_HOSTNAME}" + local resource="$1" node="$(get-hostname-for-vm)" vm-command-q "kubectl get -n kube-system $resource \ -ojsonpath=\"{.status.nodes['$node'].generation}\"" } get-config-node-status-result() { - local resource="$1" node="${node:-$VM_HOSTNAME}" + local resource="$1" node="$(get-hostname-for-vm)" vm-command-q "kubectl get -n kube-system $resource \ -ojsonpath=\"{.status.nodes['$node'].status}\"" } get-config-node-status-error() { - local resource="$1" node="${node:-$VM_HOSTNAME}" + local resource="$1" node="$(get-hostname-for-vm)" vm-command-q "kubectl get -n kube-system $resource \ -ojsonpath=\"{.status.nodes['$node'].error}\"" } wait-config-node-status() { - local resource="$1" node="${node:-$VM_HOSTNAME}" + local resource="$1" node="$(get-hostname-for-vm)" local timeout="${timeout:-5s}" local deadline=$(deadline-for-timeout $timeout) local generation jsonpath result errors