Test destroy CPVM
(self)
| 1199 | "sg"], |
| 1200 | required_hardware="true") |
| 1201 | def test_12_destroy_cpvm(self): |
| 1202 | """Test destroy CPVM |
| 1203 | """ |
| 1204 | |
| 1205 | # Validate the following |
| 1206 | # 1. CPVM should be completely destroyed and a new one will spin up |
| 1207 | # 2. listSystemVMs will show a different name for the systemVM from |
| 1208 | # what it was before |
| 1209 | # 3. new CPVM will have a public/private and link-local-ip |
| 1210 | # 4. cloud process within CPVM must be up and running |
| 1211 | |
| 1212 | list_cpvm_response = list_ssvms( |
| 1213 | self.apiclient, |
| 1214 | systemvmtype='consoleproxy', |
| 1215 | zoneid=self.zone.id |
| 1216 | ) |
| 1217 | self.assertEqual( |
| 1218 | isinstance(list_cpvm_response, list), |
| 1219 | True, |
| 1220 | "Check list response returns a valid list" |
| 1221 | ) |
| 1222 | cpvm_response = list_cpvm_response[0] |
| 1223 | |
| 1224 | old_name = cpvm_response.name |
| 1225 | |
| 1226 | self.debug("Destroying CPVM: %s" % cpvm_response.id) |
| 1227 | cmd = destroySystemVm.destroySystemVmCmd() |
| 1228 | cmd.id = cpvm_response.id |
| 1229 | self.apiclient.destroySystemVm(cmd) |
| 1230 | |
| 1231 | cpvm_response = self.checkForRunningSystemVM(cpvm_response, 'consoleproxy') |
| 1232 | |
| 1233 | # Verify Name, Public IP, Private IP and Link local IP |
| 1234 | # for newly created CPVM |
| 1235 | self.assertNotEqual( |
| 1236 | cpvm_response.name, |
| 1237 | old_name, |
| 1238 | "Check SSVM new name with name of destroyed CPVM" |
| 1239 | ) |
| 1240 | self.assertEqual( |
| 1241 | hasattr(cpvm_response, 'privateip'), |
| 1242 | True, |
| 1243 | "Check whether CPVM has private IP field" |
| 1244 | ) |
| 1245 | |
| 1246 | self.assertEqual( |
| 1247 | hasattr(cpvm_response, 'linklocalip'), |
| 1248 | True, |
| 1249 | "Check whether CPVM has Control IP field" |
| 1250 | ) |
| 1251 | |
| 1252 | self.assertEqual( |
| 1253 | hasattr(cpvm_response, 'publicip'), |
| 1254 | True, |
| 1255 | "Check whether CPVM has public IP field" |
| 1256 | ) |
| 1257 | |
| 1258 | # Wait for the agent to be up |
nothing calls this directly
no test coverage detected