1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-06 09:47:02 +01:00
Files
Maysa Macedo f6a9ce358f Fix FailureDomains check on manifests test
The `FailureDomains` was updated to become a pointer, consequently
the field may be absent in the `OpenShiftMachineV1Beta1MachineTemplate`.
This commits updates the manifests test to take that into account.
2023-11-13 14:36:58 +01:00

28 lines
936 B
Python
Executable File

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import xmlrunner
import os
import sys
import yaml
ASSETS_DIR = ""
class ControlPlaneMachineSet(unittest.TestCase):
def setUp(self):
"""Parse the CPMS into a Python data structure."""
with open(f'{ASSETS_DIR}/openshift/99_openshift-machine-api_master-control-plane-machine-set.yaml') as f:
self.cpms = yaml.load(f, Loader=yaml.FullLoader)
def test_compute_zones(self):
"""Assert that the OpenStack CPMS failureDomains value is empty."""
self.assertIsNone(self.cpms["spec"]["template"]["machines_v1beta1_machine_openshift_io"].get("failureDomains"))
if __name__ == '__main__':
ASSETS_DIR = sys.argv.pop()
with open(os.environ.get('JUNIT_FILE', '/dev/null'), 'wb') as output:
unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output), failfast=False, buffer=False, catchbreak=False, verbosity=2)