Skip to content

Commit

Permalink
Add some more context on why certain tests are failing
Browse files Browse the repository at this point in the history
  • Loading branch information
legoktm committed Apr 5, 2024
1 parent 0c93510 commit 1e36c74
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_vms_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _validate_apt_sources(self, vm):
stdout, stderr = vm.run(cmd)
contents = stdout.decode("utf-8").rstrip("\n")

self.assertTrue(self.apt_url in contents)
self.assertIn(self.apt_url, contents, f"{vm.name} missing apt sources list")

def _ensure_packages_up_to_date(self, vm, fedora=False):
"""
Expand All @@ -101,7 +101,10 @@ def _ensure_packages_up_to_date(self, vm, fedora=False):
else:
cmd = "sudo dnf check-update"
# Will raise CalledProcessError if updates available
stdout, stderr = vm.run(cmd)
try:
stdout, stderr = vm.run(cmd)
except subprocess.CalledProcessError:
self.assertTrue(False, fail_msg)
# 'stdout' will contain timestamped progress info; ignore it
results = stderr.rstrip().decode("utf-8")
stdout_lines = results.split("\n")
Expand Down

0 comments on commit 1e36c74

Please sign in to comment.