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

Method test_11_destroy_ssvm

test/integration/smoke/test_ssvm.py:1129–1191  ·  view source on GitHub ↗

Test destroy SSVM

(self)

Source from the content-addressed store, hash-verified

1127 "sg"],
1128 required_hardware="true")
1129 def test_11_destroy_ssvm(self):
1130 """Test destroy SSVM
1131 """
1132
1133 # Validate the following
1134 # 1. SSVM should be completely destroyed and a new one will spin up
1135 # 2. listSystemVMs will show a different name for the
1136 # systemVM from what it was before
1137 # 3. new SSVM will have a public/private and link-local-ip
1138 # 4. cloud process within SSVM must be up and running
1139
1140 list_ssvm_response = list_ssvms(
1141 self.apiclient,
1142 systemvmtype='secondarystoragevm',
1143 state='Running',
1144 zoneid=self.zone.id
1145 )
1146 self.assertEqual(
1147 isinstance(list_ssvm_response, list),
1148 True,
1149 "Check list response returns a valid list"
1150 )
1151 ssvm_response = list_ssvm_response[0]
1152
1153 old_name = ssvm_response.name
1154
1155 self.debug("Destroying SSVM: %s" % ssvm_response.id)
1156 cmd = destroySystemVm.destroySystemVmCmd()
1157 cmd.id = ssvm_response.id
1158 self.apiclient.destroySystemVm(cmd)
1159
1160 ssvm_response = self.checkForRunningSystemVM(ssvm_response, 'secondarystoragevm')
1161
1162 # Verify Name, Public IP, Private IP and Link local IP
1163 # for newly created SSVM
1164 self.assertNotEqual(
1165 ssvm_response.name,
1166 old_name,
1167 "Check SSVM new name with name of destroyed SSVM"
1168 )
1169 self.assertEqual(
1170 hasattr(ssvm_response, 'privateip'),
1171 True,
1172 "Check whether SSVM has private IP field"
1173 )
1174
1175 self.assertEqual(
1176 hasattr(ssvm_response, 'linklocalip'),
1177 True,
1178 "Check whether SSVM has Control IP field"
1179 )
1180
1181 self.assertEqual(
1182 hasattr(ssvm_response, 'publicip'),
1183 True,
1184 "Check whether SSVM has public IP field"
1185 )
1186

Callers

nothing calls this directly

Calls 6

waitForSystemVMAgentMethod · 0.95
list_ssvmsFunction · 0.90
assertEqualMethod · 0.80
debugMethod · 0.80

Tested by

no test coverage detected