Merge ~dannf/canonical-server-hwe-utils:iso-test-matrix into canonical-server-hwe-utils:master

Proposed by dann frazier
Status: Merged
Approved by: Patricia Domingues
Approved revision: 9ddc2c58123fc365484dc22e99cefc353fb05d4c
Merged at revision: 9ddc2c58123fc365484dc22e99cefc353fb05d4c
Proposed branch: ~dannf/canonical-server-hwe-utils:iso-test-matrix
Merge into: canonical-server-hwe-utils:master
Diff against target: 115 lines (+103/-0)
2 files modified
installer-test-matrix/config.yaml (+31/-0)
installer-test-matrix/generate-matrix.py (+72/-0)
Reviewer Review Type Date Requested Status
Patricia Domingues Pending
Review via email: mp+389042@code.launchpad.net
To post a comment you must log in.
Revision history for this message
dann frazier (dannf) wrote :

Sample output:

$ ./generate-matrix.py -r bionic
crb1s pxe GA
crb2s usb-hdd HWE
d05 pxe GA
d05 pxe HWE
d05 cd GA
d05 usb-hdd HWE
sabre pxe GA
taishan2280v2 cd HWE
taishan2280v2 usb-hdd GA
taishan2280v2 pxe HWE
taishan2280v2 pxe GA
$ ./generate-matrix.py -r xenial
crb1s pxe GA
crb2s cd HWE
d05 pxe HWE
d05 usb-hdd HWE
sabre pxe HWE
taishan2280v2 cd HWE
taishan2280v2 pxe HWE

Revision history for this message
Patricia Domingues (patriciasd) wrote :

Great. Many thanks. +1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/installer-test-matrix/config.yaml b/installer-test-matrix/config.yaml
0new file mode 1006440new file mode 100644
index 0000000..066623f
--- /dev/null
+++ b/installer-test-matrix/config.yaml
@@ -0,0 +1,31 @@
1releases:
2 focal:
3 boot-options: [ GA ]
4 bionic:
5 boot-options: [ GA, HWE ]
6 xenial:
7 boot-options: [ GA, HWE ]
8
9platforms:
10 crb1s:
11 coverage: spot
12 crb2s:
13 coverage: spot
14 d05:
15 coverage: full
16 unsupported:
17 releases:
18 xenial:
19 boot-options: GA
20 sabre:
21 coverage: spot
22 unsupported:
23 releases:
24 xenial:
25 boot-options: GA
26 taishan2280v2:
27 coverage: full
28 unsupported:
29 releases:
30 xenial:
31 boot-options: GA
diff --git a/installer-test-matrix/generate-matrix.py b/installer-test-matrix/generate-matrix.py
0new file mode 10075532new file mode 100755
index 0000000..14c2d0a
--- /dev/null
+++ b/installer-test-matrix/generate-matrix.py
@@ -0,0 +1,72 @@
1#!/usr/bin/env python3
2
3import argparse
4import random
5import sys
6import yaml
7
8
9def is_supported(platform_config, release, boot_option):
10 if "unsupported" not in platform_config.keys():
11 return True
12 if "releases" not in platform_config["unsupported"]:
13 return True
14 if release not in platform_config["unsupported"]["releases"]:
15 return True
16 if "boot-options" not in platform_config["unsupported"]["releases"][release].keys():
17 return False
18 if (
19 boot_option
20 in platform_config["unsupported"]["releases"][release]["boot-options"]
21 ):
22 return False
23 return True
24
25
26if __name__ == "__main__":
27 parser = argparse.ArgumentParser()
28 parser.add_argument("--config", "-c", default="./config.yaml")
29 parser.add_argument("--release", "-r", required=True)
30 args = parser.parse_args()
31
32 with open(args.config, "r") as f:
33 y = yaml.load(f, Loader=yaml.SafeLoader)
34 release = y["releases"][args.release]
35
36 # Create shuffled lists of the various install
37 # config variables. We'll round-robin through them.
38 boot_options = release["boot-options"][:]
39 random.shuffle(boot_options)
40 media_options = ["iso", "pxe"]
41 random.shuffle(media_options)
42 cd_hdd = ["cd", "usb-hdd"]
43 random.shuffle(cd_hdd)
44
45 for platform in y["platforms"]:
46 p = y["platforms"][platform]
47 done = False
48 for m in range(len(media_options)):
49 if done:
50 break
51 # pop/append pattern creates a circular queue
52 media_type = media_options.pop(0)
53 media_options.append(media_type)
54 for b in range(len(boot_options)):
55 boot_type = boot_options.pop(0)
56 boot_options.append(boot_type)
57 if not is_supported(p, args.release, boot_type):
58 continue
59 # Alternate between booting the ISO as a CD
60 # and as a USB stick. Both create a nearly identical
61 # install environment, so we don't consider them
62 # separate media types.
63 if media_type == "iso":
64 media_string = cd_hdd.pop(0)
65 cd_hdd.append(media_string)
66 else:
67 media_string = media_type
68 sys.stdout.write("%s %s %s\n" % (platform, media_string, boot_type))
69 if p["coverage"] == "spot":
70 # We only need 1 case for spot testing
71 done = True
72 break

Subscribers

People subscribed via source and target branches

to all changes: