MCPcopy Create free account
hub / github.com/apache/cloudstack / setUpClass

Method setUpClass

test/integration/component/test_eip_elb.py:896–974  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

894
895 @classmethod
896 def setUpClass(cls):
897 cls.testClient = super(TestELB, cls).getClsTestClient()
898 cls.api_client = cls.testClient.getApiClient()
899
900 cls.services = Services().services
901 # Get Zone, Domain and templates
902 cls.domain = get_domain(cls.api_client)
903 cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
904 cls.services['mode'] = cls.zone.networktype
905
906 try:
907 cls.services["netscaler"] = cls.config.__dict__[
908 "netscalerDevice"].__dict__
909 except KeyError:
910 raise unittest.SkipTest("Please make sure you have included netscalerDevice\
911 dict in your config file (keys - ipaddress, username,\
912 password")
913 except Exception as e:
914 raise unittest.SkipTest(e)
915
916 cls.template = get_template(
917 cls.api_client,
918 cls.zone.id,
919 cls.services["ostype"]
920 )
921 cls.services["virtual_machine"]["zoneid"] = cls.zone.id
922 cls.services["virtual_machine"]["template"] = cls.template.id
923
924 cls.service_offering = ServiceOffering.create(
925 cls.api_client,
926 cls.services["service_offering"]
927 )
928 cls.account = Account.create(
929 cls.api_client,
930 cls.services["account"],
931 admin=True,
932 domainid=cls.domain.id
933 )
934 # Spawn an instance
935 cls.vm_1 = VirtualMachine.create(
936 cls.api_client,
937 cls.services["virtual_machine"],
938 accountid=cls.account.name,
939 domainid=cls.account.domainid,
940 serviceofferingid=cls.service_offering.id
941 )
942 cls.vm_2 = VirtualMachine.create(
943 cls.api_client,
944 cls.services["virtual_machine"],
945 accountid=cls.account.name,
946 domainid=cls.account.domainid,
947 serviceofferingid=cls.service_offering.id
948 )
949 networks = Network.list(
950 cls.api_client,
951 zoneid=cls.zone.id,
952 listall=True
953 )

Callers

nothing calls this directly

Calls 10

get_domainFunction · 0.90
get_zoneFunction · 0.90
get_templateFunction · 0.90
getClsTestClientMethod · 0.80
getApiClientMethod · 0.80
getZoneForTestsMethod · 0.80
ServicesClass · 0.70
createMethod · 0.65
listMethod · 0.65
assignMethod · 0.45

Tested by

no test coverage detected