@@ -80,18 +80,22 @@ class TestIpReservation(cloudstackTestCase):
8080 """
8181 @classmethod
8282 def setUpClass (cls ):
83- cloudstackTestClient = super (TestIpReservation , cls ).getClsTestClient ()
84- cls .api_client = cloudstackTestClient .getApiClient ()
85- # Fill test data from the external config file
86- cls .testData = cloudstackTestClient .getConfigParser ().parsedDict
83+ cls .testClient = super (TestIpReservation , cls ).getClsTestClient ()
84+ cls .api_client = cls .testClient .getApiClient ()
85+
86+ # Fill services from the external config file
87+ cls .services = cls .testClient .getConfigParser ().parsedDict
88+
8789 # Get Zone, Domain and templates
8890 cls .domain = get_domain (cls .api_client )
8991 cls .zone = get_zone (cls .api_client , cls .testClient .getZoneForTests ())
9092 cls .template = get_template (
9193 cls .api_client ,
9294 cls .zone .id ,
93- cls .testData ["ostype" ]
95+ cls .services ["ostype" ]
9496 )
97+ if cls .template == FAILED :
98+ assert False , "get_template() failed to return template with description %s" % cls .services ["ostype" ]
9599 cls .testData ["domainid" ] = cls .domain .id
96100 cls .testData ["zoneid" ] = cls .zone .id
97101 cls .testData ["virtual_machine" ]["zoneid" ] = cls .zone .id
@@ -524,18 +528,22 @@ class TestRestartNetwork(cloudstackTestCase):
524528 """
525529 @classmethod
526530 def setUpClass (cls ):
527- cloudstackTestClient = super (TestRestartNetwork , cls ).getClsTestClient ()
528- cls .api_client = cloudstackTestClient .getApiClient ()
529- # Fill test data from the external config file
530- cls .testData = cloudstackTestClient .getConfigParser ().parsedDict
531+ cls .testClient = super (TestRestartNetwork , cls ).getClsTestClient ()
532+ cls .api_client = cls .testClient .getApiClient ()
533+
534+ # Fill services from the external config file
535+ cls .services = cls .testClient .getConfigParser ().parsedDict
536+
531537 # Get Zone, Domain and templates
532- cls .domain = get_domain (cls .api_client , cls . testData )
533- cls .zone = get_zone (cls .api_client , cls .testData )
538+ cls .domain = get_domain (cls .api_client )
539+ cls .zone = get_zone (cls .api_client , cls .testClient . getZoneForTests () )
534540 cls .template = get_template (
535541 cls .api_client ,
536542 cls .zone .id ,
537- cls .testData ["ostype" ]
543+ cls .services ["ostype" ]
538544 )
545+ if cls .template == FAILED :
546+ assert False , "get_template() failed to return template with description %s" % cls .services ["ostype" ]
539547 cls .testData ["domainid" ] = cls .domain .id
540548 cls .testData ["zoneid" ] = cls .zone .id
541549 cls .testData ["virtual_machine" ]["zoneid" ] = cls .zone .id
@@ -645,18 +653,22 @@ class TestUpdateIPReservation(cloudstackTestCase):
645653 """
646654 @classmethod
647655 def setUpClass (cls ):
648- cloudstackTestClient = super (TestUpdateIPReservation , cls ).getClsTestClient ()
649- cls .api_client = cloudstackTestClient .getApiClient ()
650- # Fill test data from the external config file
651- cls .testData = cloudstackTestClient .getConfigParser ().parsedDict
656+ cls .testClient = super (TestUpdateIPReservation , cls ).getClsTestClient ()
657+ cls .api_client = cls .testClient .getApiClient ()
658+
659+ # Fill services from the external config file
660+ cls .services = cls .testClient .getConfigParser ().parsedDict
661+
652662 # Get Zone, Domain and templates
653- cls .domain = get_domain (cls .api_client , cls . testData )
654- cls .zone = get_zone (cls .api_client , cls .testData )
663+ cls .domain = get_domain (cls .api_client )
664+ cls .zone = get_zone (cls .api_client , cls .testClient . getZoneForTests () )
655665 cls .template = get_template (
656666 cls .api_client ,
657667 cls .zone .id ,
658- cls .testData ["ostype" ]
668+ cls .services ["ostype" ]
659669 )
670+ if cls .template == FAILED :
671+ assert False , "get_template() failed to return template with description %s" % cls .services ["ostype" ]
660672 cls .testData ["domainid" ] = cls .domain .id
661673 cls .testData ["zoneid" ] = cls .zone .id
662674 cls .testData ["virtual_machine" ]["zoneid" ] = cls .zone .id
@@ -791,18 +803,22 @@ class TestRouterOperations(cloudstackTestCase):
791803 """
792804 @classmethod
793805 def setUpClass (cls ):
794- cloudstackTestClient = super (TestRouterOperations , cls ).getClsTestClient ()
795- cls .api_client = cloudstackTestClient .getApiClient ()
796- # Fill test data from the external config file
797- cls .testData = cloudstackTestClient .getConfigParser ().parsedDict
806+ cls .testClient = super (TestRouterOperations , cls ).getClsTestClient ()
807+ cls .api_client = cls .testClient .getApiClient ()
808+
809+ # Fill services from the external config file
810+ cls .services = cls .testClient .getConfigParser ().parsedDict
811+
798812 # Get Zone, Domain and templates
799- cls .domain = get_domain (cls .api_client , cls . testData )
800- cls .zone = get_zone (cls .api_client , cls .testData )
813+ cls .domain = get_domain (cls .api_client )
814+ cls .zone = get_zone (cls .api_client , cls .testClient . getZoneForTests () )
801815 cls .template = get_template (
802816 cls .api_client ,
803817 cls .zone .id ,
804- cls .testData ["ostype" ]
818+ cls .services ["ostype" ]
805819 )
820+ if cls .template == FAILED :
821+ assert False , "get_template() failed to return template with description %s" % cls .services ["ostype" ]
806822 cls .testData ["domainid" ] = cls .domain .id
807823 cls .testData ["zoneid" ] = cls .zone .id
808824 cls .testData ["virtual_machine" ]["zoneid" ] = cls .zone .id
@@ -957,18 +973,22 @@ class TestFailureScnarios(cloudstackTestCase):
957973 """
958974 @classmethod
959975 def setUpClass (cls ):
960- cloudstackTestClient = super (TestFailureScnarios , cls ).getClsTestClient ()
961- cls .api_client = cloudstackTestClient .getApiClient ()
962- # Fill test data from the external config file
963- cls .testData = cloudstackTestClient .getConfigParser ().parsedDict
976+ cls .testClient = super (TestFailureScnarios , cls ).getClsTestClient ()
977+ cls .api_client = cls .testClient .getApiClient ()
978+
979+ # Fill services from the external config file
980+ cls .services = cls .testClient .getConfigParser ().parsedDict
981+
964982 # Get Zone, Domain and templates
965- cls .domain = get_domain (cls .api_client , cls . testData )
966- cls .zone = get_zone (cls .api_client , cls .testData )
983+ cls .domain = get_domain (cls .api_client )
984+ cls .zone = get_zone (cls .api_client , cls .testClient . getZoneForTests () )
967985 cls .template = get_template (
968986 cls .api_client ,
969987 cls .zone .id ,
970- cls .testData ["ostype" ]
988+ cls .services ["ostype" ]
971989 )
990+ if cls .template == FAILED :
991+ assert False , "get_template() failed to return template with description %s" % cls .services ["ostype" ]
972992 cls .testData ["domainid" ] = cls .domain .id
973993 cls .testData ["zoneid" ] = cls .zone .id
974994 cls .testData ["virtual_machine" ]["zoneid" ] = cls .zone .id
0 commit comments