test/run: allow filter on distro

This way we can test the distros on their respective CI, as not
all distros can be built in all environment. In particular RHEL
needs to be on a subscribed host.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-12-10 00:05:29 +01:00 committed by Lars Karlitski
parent 34a4f24141
commit 9bedc0c393
4 changed files with 8 additions and 0 deletions

View file

@ -4,6 +4,7 @@
},
"compose": {
"output-format": "tar",
"distro": "fedora-30",
"filename": "root.tar.xz",
"blueprint-draft": {
"name": "tar-boot-test",

View file

@ -3,6 +3,7 @@
"type": "qemu"
},
"compose": {
"distro": "fedora-30",
"output-format": "vhd",
"filename": "image.vhd",
"blueprint-draft": {

View file

@ -3,6 +3,7 @@
"type": "qemu"
},
"compose": {
"distro": "fedora-30",
"output-format": "vmdk",
"filename": "disk.vmdk",
"blueprint-draft": {

View file

@ -227,6 +227,7 @@ def run_test(case, private_key, store):
def main():
parser = argparse.ArgumentParser(description='Run test cases.')
parser.add_argument('--cases', type=str, nargs='*', help='Limit tests to given cases.')
parser.add_argument('--distros', type=str, nargs='*', help='Limit tests to given distros.')
arg = parser.parse_args()
failed = False
@ -237,6 +238,10 @@ def main():
with open(filename) as f:
case = json.load(f)
if arg.distros:
if case["compose"]["distro"] not in arg.distros:
continue
print(f"RUNNING: {filename}")
if run_test(case, private_key, store):
print(f"SUCCESS")