|
38 | 38 | PT_SUB_PCI['sata'] = ['SATA controller']
|
39 | 39 | PT_SUB_PCI['nvme'] = ['Non-Volatile memory controller']
|
40 | 40 | UUID_DB = {
|
41 |
| - 'SOS_VM':'dbbbd434-7a57-4216-a12c-2201f1ab0240', |
42 |
| - 'SAFETY_VM':'fc836901-8685-4bc0-8b71-6e31dc36fa47', |
| 41 | + 'SOS_VM':['dbbbd434-7a57-4216-a12c-2201f1ab0240'], |
| 42 | + 'SAFETY_VM':['fc836901-8685-4bc0-8b71-6e31dc36fa47'], |
43 | 43 | 'PRE_STD_VM':['26c5e0d8-8f8a-47d8-8109-f201ebd61a5e', 'dd87ce08-66f9-473d-bc58-7605837f935e'],
|
44 | 44 | 'POST_STD_VM':['d2795438-25d6-11e8-864e-cb7a18b34643', '615db82a-e189-4b4f-8dbb-d321343e4ab3',
|
45 | 45 | '38158821-5208-4005-b72a-8a609e4190d0', 'a6750180-f87a-48d2-91d9-4e7f62b6519e', 'd1816e4a-a9bb-4cb4-a066-3f1a8a5ce73f'],
|
46 |
| - 'POST_RT_VM':'495ae2e5-2603-4d64-af76-d4bc5a8ec0e5', |
47 |
| - 'KATA_VM':'a7ada506-1ab0-4b6b-a0da-e513ca9b8c2f', |
| 46 | + 'POST_RT_VM':['495ae2e5-2603-4d64-af76-d4bc5a8ec0e5'], |
| 47 | + 'KATA_VM':['a7ada506-1ab0-4b6b-a0da-e513ca9b8c2f'], |
48 | 48 | }
|
49 | 49 |
|
50 | 50 | VM_DB = {
|
@@ -156,19 +156,29 @@ def load_vm_check(load_vms, item):
|
156 | 156 | if "POST_RT_VM" == load_str:
|
157 | 157 | rt_vm_ids.append(order_i)
|
158 | 158 |
|
159 |
| - if len(kata_vm_ids) >=2: |
| 159 | + if len(kata_vm_ids) > len(UUID_DB["KATA_VM"]): |
160 | 160 | key = "vm:id={},{}".format(kata_vm_ids[0], item)
|
161 |
| - ERR_LIST[key] = "KATA VM number should not be greater than 1" |
| 161 | + ERR_LIST[key] = "KATA VM number should not be greater than {}".format(len(UUID_DB["KATA_VM"])) |
162 | 162 | return
|
163 | 163 |
|
164 |
| - if len(rt_vm_ids) >= 2: |
| 164 | + if len(rt_vm_ids) > len(UUID_DB["POST_RT_VM"]): |
165 | 165 | key = "vm:id={},{}".format(rt_vm_ids[0], item)
|
166 |
| - ERR_LIST[key] = "POST RT VM number should not be greater than 1" |
| 166 | + ERR_LIST[key] = "POST RT VM number should not be greater than {}".format(len(UUID_DB["POST_RT_VM"])) |
167 | 167 | return
|
168 | 168 |
|
169 |
| - if len(sos_vm_ids) >= 2: |
| 169 | + if len(sos_vm_ids) > 1: |
170 | 170 | key = "vm:id={},{}".format(sos_vm_ids[0], item)
|
171 |
| - ERR_LIST[key] = "SOS vm number should not be greater than 1" |
| 171 | + ERR_LIST[key] = "SOS VM number should not be greater than 1" |
| 172 | + return |
| 173 | + |
| 174 | + if len(post_vm_ids) > len(UUID_DB["POST_STD_VM"]): |
| 175 | + key = "vm:id={},{}".format(post_vm_ids[0], item) |
| 176 | + ERR_LIST[key] = "POST Standard vm number should not be greater than {}".format(len(UUID_DB["POST_STD_VM"])) |
| 177 | + return |
| 178 | + |
| 179 | + if len(pre_vm_ids) > len(UUID_DB["PRE_STD_VM"]): |
| 180 | + key = "vm:id={},{}".format(pre_vm_ids[0], item) |
| 181 | + ERR_LIST[key] = "PRE Standard vm number should not be greater than {}".format(len(UUID_DB["PRE_STD_VM"])) |
172 | 182 | return
|
173 | 183 |
|
174 | 184 | if post_vm_ids and sos_vm_ids:
|
|
0 commit comments