From cc6cbf14507044fb5bf693c1c45818ba204884a5 Mon Sep 17 00:00:00 2001 From: Liu Wenlong Date: Wed, 21 Nov 2018 15:17:57 +0800 Subject: templates: add job generation support for iPXE based boards Since iPXE based boards can use NBD boot[1], now in releng-scripts, we also add support to generate LAVA jobs for iPXE based boards. With this support, Intel-UP2, one of the community reference boards, can do validation tests with the generated jobs easily. [1] https://git.lavasoftware.org/lava/lava/merge_requests/64/diffs Change-Id: I9adce67d7e9207181675e82bf22a653c73682eb8 Signed-off-by: Liu Wenlong --- utils/job-prereq.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'utils') diff --git a/utils/job-prereq.py b/utils/job-prereq.py index 2dadc61..f688aca 100755 --- a/utils/job-prereq.py +++ b/utils/job-prereq.py @@ -13,13 +13,18 @@ FILE_MAP = { "nbdroot", } +FILE_MAP_X86 = { + "kernel", + "initrd", + "nbdroot", +} + # Mapping for qemu between command line QEMU args and LAVA yaml template file names FILE_MAP_QEMU = { "kernel": "kernel", "initrd": "ramdisk", } - def parse_cmdline(machines): description = "Print to stdout the file names needed to create a LAVA job" parser = argparse.ArgumentParser(description=description, @@ -51,15 +56,18 @@ def main(): url_version=args.build_type[2], machine=args.machine) job_yaml = yaml.load(job) - if args.machine != "qemux86-64": - for key in FILE_MAP: + if args.machine == "qemux86-64": + for key in FILE_MAP_QEMU: + if getattr(args, key): + print job_yaml["actions"][0]["deploy"]["images"][FILE_MAP_QEMU[key]].get("url").split('/')[-1] + elif args.machine == "intel-corei7-64": + for key in FILE_MAP_X86: if getattr(args, key): print job_yaml["actions"][0]["deploy"][key].get("url").split('/')[-1] else: - for key in FILE_MAP_QEMU: + for key in FILE_MAP: if getattr(args, key): - print job_yaml["actions"][0]["deploy"]["images"][FILE_MAP_QEMU[key]].get("url").split('/')[-1] - + print job_yaml["actions"][0]["deploy"][key].get("url").split('/')[-1] if __name__ == '__main__': main() -- cgit 1.2.3-korg