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

Method setUp

test/integration/smoke/test_nic.py:42–150  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

40class TestNic(cloudstackTestCase):
41
42 def setUp(self):
43 self.cleanup = []
44 self.logger = logging.getLogger('TestNIC')
45 self.stream_handler = logging.StreamHandler()
46 self.logger.setLevel(logging.DEBUG)
47 self.logger.addHandler(self.stream_handler)
48
49
50 def signal_handler(signal, frame):
51 self.tearDown()
52 sys.exit(0)
53
54 # assign the signal handler immediately
55 signal.signal(signal.SIGINT, signal_handler)
56
57 self.hypervisor = self.testClient.getHypervisorInfo()
58 if self.hypervisor.lower() == "hyperv":
59 self.skipTest("Not supported on Hyper-V")
60
61 try:
62 self.apiclient = self.testClient.getApiClient()
63 self.dbclient = self.testClient.getDbConnection()
64 self.services = self.testClient.getParsedTestDataConfig()
65
66 # Get Zone, Domain and templates
67 domain = get_domain(self.apiclient)
68 self.zone = get_zone(
69 self.apiclient,
70 self.testClient.getZoneForTests()
71 )
72
73 # if local storage is enabled, alter the offerings to use
74 # localstorage
75 # this step is needed for devcloud
76 if self.zone.localstorageenabled:
77 self.services["service_offerings"][
78 "tiny"]["storagetype"] = 'local'
79 template = get_suitable_test_template(
80 self.apiclient,
81 self.zone.id,
82 self.services["ostype"],
83 self.hypervisor
84 )
85 if template == FAILED:
86 assert False, "get_suitable_test_template() failed to return template with description %s" % self.services["ostype"]
87 # Set Zones and disk offerings
88 self.services["small"]["zoneid"] = self.zone.id
89 self.services["small"]["template"] = template.id
90
91 self.services["iso1"]["zoneid"] = self.zone.id
92 self.services["network"]["zoneid"] = self.zone.id
93
94 # Create Account, VMs, NAT Rules etc
95 self.account = Account.create(
96 self.apiclient,
97 self.services["account"],
98 domainid=domain.id
99 )

Callers

nothing calls this directly

Calls 13

get_domainFunction · 0.90
get_zoneFunction · 0.90
getHypervisorInfoMethod · 0.80
getApiClientMethod · 0.80
getDbConnectionMethod · 0.80
getZoneForTestsMethod · 0.80
debugMethod · 0.80
createMethod · 0.65
updateMethod · 0.65
getLoggerMethod · 0.45

Tested by

no test coverage detected