From 30ab26fbe66787999815fa29fe9a2406dd4ee360 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 21 Aug 2020 15:02:01 -0700 Subject: [PATCH] Tweak _iot_zezere_remote to keep retrying ssh for up to 10 mins The time before the ssh key provision request goes through turns out to be kinda unpredictable, so instead of just a hardcoded wait then assuming it should succeed, let's do a loop-y retry thing instead. Signed-off-by: Adam Williamson --- tests/_iot_zezere_remote.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/_iot_zezere_remote.pm b/tests/_iot_zezere_remote.pm index 5b0da0be..4fd833e7 100644 --- a/tests/_iot_zezere_remote.pm +++ b/tests/_iot_zezere_remote.pm @@ -42,10 +42,10 @@ sub run { assert_and_click "zezere_provision_schedule"; # exit quit_firefox; - # wait for the provision request to go through - sleep 60; - # ssh into iot host and create key file - assert_script_run 'ssh -o StrictHostKeyChecking=no root@172.16.2.119 touch /tmp/zezerekeyfile'; + # time before the provision request goes through is kinda hard to + # predict, so we'll just try over and over for up to 10 minutes + # and bail as soon as it works + assert_script_run "until ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no root@172.16.2.119 touch /tmp/zezerekeyfile; do sleep 10; done", 600; }