Skip to content

Commit

Permalink
Dump /var/log/ramen.log in kubevirt self test
Browse files Browse the repository at this point in the history
This verifies both ssh access and the ramen service inside the vm.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Oct 29, 2023
1 parent 206368b commit ff2f274
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/addons/kubevirt/test
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,20 @@ def verify_ssh(cluster):

for i in range(retries):
time.sleep(delay)
print("Running 'hostname' inside the VM via ssh")
print(f"Last entries in /var/log/ramen.log (attempt {i+1}/{retries})")
try:
out = virtctl.ssh(
"testvm",
"hostname",
"tail -6 /var/log/ramen.log",
username="cirros",
namespace=NAMESPACE,
known_hosts="", # Skip host key verification.
context=cluster,
)
except Exception as e:
print(f"Attempt {i+1}/{retries} failed: {e}")
print(f"{e}")
print(f"Retrying in {delay} seconds...")
else:
print(f"Attempt {i+1}/{retries} succeeded")
print(out)
break
else:
Expand Down

0 comments on commit ff2f274

Please sign in to comment.