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:
parent
34a4f24141
commit
9bedc0c393
4 changed files with 8 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
|||
},
|
||||
"compose": {
|
||||
"output-format": "tar",
|
||||
"distro": "fedora-30",
|
||||
"filename": "root.tar.xz",
|
||||
"blueprint-draft": {
|
||||
"name": "tar-boot-test",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
"type": "qemu"
|
||||
},
|
||||
"compose": {
|
||||
"distro": "fedora-30",
|
||||
"output-format": "vhd",
|
||||
"filename": "image.vhd",
|
||||
"blueprint-draft": {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
"type": "qemu"
|
||||
},
|
||||
"compose": {
|
||||
"distro": "fedora-30",
|
||||
"output-format": "vmdk",
|
||||
"filename": "disk.vmdk",
|
||||
"blueprint-draft": {
|
||||
|
|
|
|||
5
test/run
5
test/run
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue