tests: better handle templates with no 'createrepo' installed

This commit is contained in:
Marek Marczykowski-Górecki 2015-11-03 02:44:25 +01:00
parent 44c340c046
commit 31ad72aa70
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -179,8 +179,12 @@ Test package
p.stdin.close()
p.wait()
retcode = self.updatevm.run('cd /tmp/repo; createrepo .', wait=True)
if retcode != 0:
raise RuntimeError("createrepo failed, cannot perform test")
if retcode == 127:
self.skipTest("createrepo not installed in template {}".format(
self.template))
elif retcode != 0:
self.skipTest("createrepo failed with code {}, cannot perform the "
"test".format(retcode))
def test_000_update(self):
filename = self.create_pkg(self.tmpdir, self.pkg_name, '1.0')