github.com/openshift/installer@v1.4.17/scripts/openstack/manifest-tests/base-case/test_cpms.py (about)

     1  #!/usr/bin/env python
     2  # -*- coding: utf-8 -*-
     3  
     4  import unittest
     5  import xmlrunner
     6  
     7  import os
     8  import sys
     9  import yaml
    10  
    11  ASSETS_DIR = ""
    12  
    13  class ControlPlaneMachineSet(unittest.TestCase):
    14      def setUp(self):
    15          """Parse the CPMS into a Python data structure."""
    16          with open(f'{ASSETS_DIR}/openshift/99_openshift-machine-api_master-control-plane-machine-set.yaml') as f:
    17              self.cpms = yaml.load(f, Loader=yaml.FullLoader)
    18  
    19      def test_compute_zones(self):
    20          """Assert that the OpenStack CPMS failureDomains value is empty."""
    21          self.assertIsNone(self.cpms["spec"]["template"]["machines_v1beta1_machine_openshift_io"].get("failureDomains"))
    22  
    23  
    24  if __name__ == '__main__':
    25      ASSETS_DIR = sys.argv.pop()
    26      with open(os.environ.get('JUNIT_FILE', '/dev/null'), 'wb') as output:
    27          unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output), failfast=False, buffer=False, catchbreak=False, verbosity=2)