github.com/openshift/installer@v1.4.17/scripts/openstack/manifest-tests/lb-default-stable/test_cluster-infra.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 glob
    10  import yaml
    11  
    12  ASSETS_DIR = ""
    13  
    14  class DefaultStableLoadBalancerClusterInfraObject(unittest.TestCase):
    15      def setUp(self):
    16          """Parse the Cluster Infrastructure object into a Python data structure."""
    17          self.machines = []
    18          cluster_infra = f'{ASSETS_DIR}/manifests/cluster-infrastructure-02-config.yml'
    19          with open(cluster_infra) as f:
    20              self.cluster_infra = yaml.load(f, Loader=yaml.FullLoader)
    21  
    22      def test_load_balancer(self):
    23          """Assert that the Cluster infrastructure object does not contain the LoadBalancer configuration."""
    24          self.assertNotIn("loadBalancer", self.cluster_infra["status"]["platformStatus"]["openstack"])
    25  
    26  
    27  if __name__ == '__main__':
    28      ASSETS_DIR = sys.argv.pop()
    29      with open(os.environ.get('JUNIT_FILE', '/dev/null'), 'wb') as output:
    30          unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output), failfast=False, buffer=False, catchbreak=False, verbosity=2)