How to use delete_environment method in lisa

Best Python code snippet using lisa_python

test_murano_services.py

Source:test_murano_services.py Github

copy

Full Screen

...32 self.environments.append(env)33 resp, sess = self.create_session(env['id'])34 resp, serv = self.create_AD(env['id'], sess['id'])35 resp = self.delete_service(env['id'], sess['id'], serv['id'])36 resp = self.delete_environment(env['id'])37 self.environments.pop(self.environments.index(env))38 @testtools.skip('It is look as a bug')39 @attr(type='negative')40 def test_create_AD_wo_env_id(self):41 """ Try create AD without env_id42 Target component: Murano43 Scenario:44 1. Send request to create environment45 2. Send request to create session46 3. Send request to add AD using wrong env_id47 4. Send request to delete environment48 """49 resp, env = self.create_environment('test')50 self.environments.append(env)51 resp, sess = self.create_session(env['id'])52 self.assertRaises(Exception, self.create_AD,53 None, sess['id'])54 resp = self.delete_environment(env['id'])55 self.environments.pop(self.environments.index(env))56 @attr(type='negative')57 def test_create_AD_wo_sess_id(self):58 """ Try to create AD without session id59 Target component: Murano60 Scenario:61 1. Send request to create environment62 2. Send request to create session63 3. Send request to add AD using uncorrect session id64 5. Send request to delete environment65 """66 resp, env = self.create_environment('test')67 self.environments.append(env)68 resp, sess = self.create_session(env['id'])69 self.assertRaises(Exception, self.create_AD,70 env['id'], "")71 resp = self.delete_environment(env['id'])72 self.environments.pop(self.environments.index(env))73 @testtools.skip("It is look like a bug")74 @attr(type='negative')75 def test_delete_AD_wo_env_id(self):76 """ Try to delete AD without environment id77 Target component: Murano78 Scenario:79 1. Send request to create environment80 2. Send request to create session81 3. Send request to add AD82 4. Send request to remove AD using uncorrect environment id83 5. Send request to delete environment84 """85 resp, env = self.create_environment('test')86 self.environments.append(env)87 resp, sess = self.create_session(env['id'])88 resp, serv = self.create_AD(env['id'], sess['id'])89 self.assertRaises(Exception, self.delete_service,90 None, sess['id'], serv['id'])91 resp = self.delete_environment(env['id'])92 self.environments.pop(self.environments.index(env))93 @attr(type='negative')94 def test_delete_AD_wo_session_id(self):95 """ Try to delete AD without session id96 Target component: Murano97 Scenario:98 1. Send request to create environment99 2. Send request to create session100 3. Send request to add AD101 4. Send request to remove AD using wrong session id102 5. Send request to delete environment103 """104 resp, env = self.create_environment('test')105 self.environments.append(env)106 resp, sess = self.create_session(env['id'])107 resp, serv = self.create_AD(env['id'], sess['id'])108 self.assertRaises(Exception, self.delete_service,109 env['id'], "", serv['id'])110 resp = self.delete_environment(env['id'])111 self.environments.pop(self.environments.index(env))112 @attr(type='smoke')113 def test_create_and_delete_IIS(self):114 """ Create and delete IIS115 Target component: Murano116 Scenario:117 1. Send request to create environment118 2. Send request to create session119 3. Send request to add IIS120 4. Send request to remove IIS121 5. Send request to delete environment122 """123 resp, env = self.create_environment('test')124 self.environments.append(env)125 resp, sess = self.create_session(env['id'])126 resp, serv = self.create_IIS(env['id'], sess['id'])127 resp = self.delete_service(env['id'], sess['id'], serv['id'])128 resp = self.delete_environment(env['id'])129 self.environments.pop(self.environments.index(env))130 @testtools.skip('It is look as a bug')131 @attr(type='negative')132 def test_create_IIS_wo_env_id(self):133 """ Try to create IIS without env id134 Target component: Murano135 Scenario:136 1. Send request to create environment137 2. Send request to create session138 3. Send request to add IIS using wrong environment id139 4. Send request to delete environment140 """141 resp, env = self.create_environment('test')142 self.environments.append(env)143 resp, sess = self.create_session(env['id'])144 self.assertRaises(Exception, self.create_IIS,145 None, sess['id'])146 resp = self.delete_environment(env['id'])147 self.environments.pop(self.environments.index(env))148 @attr(type='negative')149 def test_create_IIS_wo_sess_id(self):150 """ Try to create IIS without session id151 Target component: Murano152 Scenario:153 1. Send request to create environment154 2. Send request to create session155 3. Send request to add IIS using wrong session id156 4. Send request to delete environment157 """158 resp, env = self.create_environment('test')159 self.environments.append(env)160 resp, sess = self.create_session(env['id'])161 self.assertRaises(Exception, self.create_IIS,162 env['id'], "")163 resp = self.delete_environment(env['id'])164 self.environments.pop(self.environments.index(env))165 @testtools.skip("It is look like a bug")166 @attr(type='negative')167 def test_delete_IIS_wo_env_id(self):168 """ Try to delete IIS without env id169 Target component: Murano170 Scenario:171 1. Send request to create environment172 2. Send request to create session173 3. Send request to add IIS174 4. Send request to delete IIS using wrong environment id175 5. Send request to delete environment176 """177 resp, env = self.create_environment('test')178 self.environments.append(env)179 resp, sess = self.create_session(env['id'])180 resp, serv = self.create_IIS(env['id'], sess['id'])181 self.assertRaises(Exception, self.delete_service,182 None, sess['id'], serv['id'])183 resp = self.delete_environment(env['id'])184 self.environments.pop(self.environments.index(env))185 @attr(type='negative')186 def test_delete_IIS_wo_session_id(self):187 """ Try to delete IIS without session id188 Target component: Murano189 Scenario:190 1. Send request to create environment191 2. Send request to create session192 3. Send request to add IIS193 4. Send request to delete IIS using wrong session id194 5. Send request to delete environment195 """196 resp, env = self.create_environment('test')197 self.environments.append(env)198 resp, sess = self.create_session(env['id'])199 resp, serv = self.create_IIS(env['id'], sess['id'])200 self.assertRaises(Exception, self.delete_service,201 env['id'], "", serv['id'])202 resp = self.delete_environment(env['id'])203 self.environments.pop(self.environments.index(env))204 @attr(type='smoke')205 def test_create_and_delete_apsnet(self):206 """ Create and delete apsnet207 Target component: Murano208 Scenario:209 1. Send request to create environment210 2. Send request to create session211 3. Send request to add apsnet212 4. Send request to remove apsnet213 5. Send request to delete environment214 """215 resp, env = self.create_environment('test')216 self.environments.append(env)217 resp, sess = self.create_session(env['id'])218 resp, serv = self.create_apsnet(env['id'], sess['id'])219 resp = self.delete_service(env['id'], sess['id'], serv['id'])220 resp = self.delete_environment(env['id'])221 self.environments.pop(self.environments.index(env))222 @testtools.skip('It is look as a bug')223 @attr(type='negative')224 def test_create_apsnet_wo_env_id(self):225 """ Try to create aspnet without env id226 Target component: Murano227 Scenario:228 1. Send request to create environment229 2. Send request to create session230 3. Send request to add aspnet using wrong environment id231 4. Send request to delete environment232 """233 resp, env = self.create_environment('test')234 self.environments.append(env)235 resp, sess = self.create_session(env['id'])236 self.assertRaises(Exception, self.create_apsnet,237 None, sess['id'])238 resp = self.delete_environment(env['id'])239 self.environments.pop(self.environments.index(env))240 @attr(type='negative')241 def test_create_apsnet_wo_sess_id(self):242 """ Try to create aspnet without session id243 Target component: Murano244 Scenario:245 1. Send request to create environment246 2. Send request to create session247 3. Send request to add aspnet using wrong session id248 4. Send request to delete environment249 """250 resp, env = self.create_environment('test')251 self.environments.append(env)252 resp, sess = self.create_session(env['id'])253 self.assertRaises(Exception, self.create_apsnet,254 env['id'], "")255 resp = self.delete_environment(env['id'])256 self.environments.pop(self.environments.index(env))257 @testtools.skip("It is look like a bug")258 @attr(type='negative')259 def test_delete_apsnet_wo_env_id(self):260 """ Try to delete aspnet without env id261 Target component: Murano262 Scenario:263 1. Send request to create environment264 2. Send request to create session265 3. Send request to add aspnet266 4. Send request to delete aspnet using wrong environment id267 5. Send request to delete environment268 """269 resp, env = self.create_environment('test')270 self.environments.append(env)271 resp, sess = self.create_session(env['id'])272 resp, serv = self.create_apsnet(env['id'], sess['id'])273 self.assertRaises(Exception, self.delete_service,274 None, sess['id'], serv['id'])275 resp = self.delete_environment(env['id'])276 self.environments.pop(self.environments.index(env))277 @attr(type='negative')278 def test_delete_apsnet_wo_session_id(self):279 """ Try to delete aspnet without session id280 Target component: Murano281 Scenario:282 1. Send request to create environment283 2. Send request to create session284 3. Send request to add aspnet285 4. Send request to delete aspnet using wrong session id286 5. Send request to delete environment287 """288 resp, env = self.create_environment('test')289 self.environments.append(env)290 resp, sess = self.create_session(env['id'])291 resp, serv = self.create_apsnet(env['id'], sess['id'])292 self.assertRaises(Exception, self.delete_service,293 env['id'], "", serv['id'])294 resp = self.delete_environment(env['id'])295 self.environments.pop(self.environments.index(env))296 @attr(type='smoke')297 def test_create_and_delete_IIS_farm(self):298 """ Create and delete IIS farm299 Target component: Murano300 Scenario:301 1. Send request to create environment302 2. Send request to create session303 3. Send request to add IIS farm304 4. Send request to remove IIS farm305 5. Send request to delete environment306 """307 resp, env = self.create_environment('test')308 self.environments.append(env)309 resp, sess = self.create_session(env['id'])310 resp, serv = self.create_IIS_farm(env['id'], sess['id'])311 resp = self.delete_service(env['id'], sess['id'], serv['id'])312 resp = self.delete_environment(env['id'])313 self.environments.pop(self.environments.index(env))314 @testtools.skip('It is look as a bug')315 @attr(type='negative')316 def test_create_IIS_farm_wo_env_id(self):317 """ Try to create IIS farm without env id318 Target component: Murano319 Scenario:320 1. Send request to create environment321 2. Send request to create session322 3. Send request to add IIS farm using wrong environment id323 4. Send request to delete environment324 """325 resp, env = self.create_environment('test')326 self.environments.append(env)327 resp, sess = self.create_session(env['id'])328 self.assertRaises(Exception, self.create_IIS_farm,329 None, sess['id'])330 resp = self.delete_environment(env['id'])331 self.environments.pop(self.environments.index(env))332 @attr(type='negative')333 def test_create_IIS_farm_wo_sess_id(self):334 """ Try to create IIS farm without session id335 Target component: Murano336 Scenario:337 1. Send request to create environment338 2. Send request to create session339 3. Send request to create IIS farm using wrong session id340 4. Send request to delete environment341 """342 resp, env = self.create_environment('test')343 self.environments.append(env)344 resp, sess = self.create_session(env['id'])345 self.assertRaises(Exception, self.create_IIS_farm,346 env['id'], "")347 resp = self.delete_environment(env['id'])348 self.environments.pop(self.environments.index(env))349 @testtools.skip("It is look like a bug")350 @attr(type='negative')351 def test_delete_IIS_farm_wo_env_id(self):352 """ Try to delete IIS farm without env id353 Target component: Murano354 Scenario:355 1. Send request to create environment356 2. Send request to create session357 3. Send request to add IIS farm358 4. Send request to delete IIS farm using wrong environment id359 5. Send request to delete environment360 """361 resp, env = self.create_environment('test')362 self.environments.append(env)363 resp, sess = self.create_session(env['id'])364 resp, serv = self.create_IIS_farm(env['id'], sess['id'])365 self.assertRaises(Exception, self.delete_service,366 None, sess['id'], serv['id'])367 resp = self.delete_environment(env['id'])368 self.environments.pop(self.environments.index(env))369 @attr(type='negative')370 def test_delete_IIS_farm_wo_session_id(self):371 """ Try to delete IIS farm without session id372 Target component: Murano373 Scenario:374 1. Send request to create environment375 2. Send request to create session376 3. Send request to add IIS farm377 4. Send request to delete IIS farm using wrong environment id378 5. Send request to delete environment379 """380 resp, env = self.create_environment('test')381 self.environments.append(env)382 resp, sess = self.create_session(env['id'])383 resp, serv = self.create_IIS_farm(env['id'], sess['id'])384 self.assertRaises(Exception, self.delete_service,385 env['id'], "", serv['id'])386 resp = self.delete_environment(env['id'])387 self.environments.pop(self.environments.index(env))388 @attr(type='smoke')389 def test_create_and_delete_apsnet_farm(self):390 """ Create and delete apsnet farm391 Target component: Murano392 Scenario:393 1. Send request to create environment394 2. Send request to create session395 3. Send request to add apsnet farm396 4. Send request to remove apsnet farm397 5. Send request to delete environment398 """399 resp, env = self.create_environment('test')400 self.environments.append(env)401 resp, sess = self.create_session(env['id'])402 resp, serv = self.create_apsnet_farm(env['id'], sess['id'])403 resp = self.delete_service(env['id'], sess['id'], serv['id'])404 resp = self.delete_environment(env['id'])405 self.environments.pop(self.environments.index(env))406 @testtools.skip('It is look as a bug')407 @attr(type='negative')408 def test_create_apsnet_farm_wo_env_id(self):409 """ Try to create aspnet farm without env id410 Target component: Murano411 Scenario:412 1. Send request to create environment413 2. Send request to create session414 3. Send request to create aspnet farm using wrong environment id415 4. Send request to delete environment416 """417 resp, env = self.create_environment('test')418 self.environments.append(env)419 resp, sess = self.create_session(env['id'])420 self.assertRaises(Exception, self.create_apsnet_farm,421 None, sess['id'])422 resp = self.delete_environment(env['id'])423 self.environments.pop(self.environments.index(env))424 @attr(type='negative')425 def test_create_apsnet_farm_wo_sess_id(self):426 """ Try to create aspnet farm without sess id427 Target component: Murano428 Scenario:429 1. Send request to create environment430 2. Send request to create session431 3. Send request to create aspnet farm using wrong session id432 4. Send request to delete environment433 """434 resp, env = self.create_environment('test')435 self.environments.append(env)436 resp, sess = self.create_session(env['id'])437 self.assertRaises(Exception, self.create_apsnet_farm,438 env['id'], "")439 resp = self.delete_environment(env['id'])440 self.environments.pop(self.environments.index(env))441 @testtools.skip("It is look like a bug")442 @attr(type='negative')443 def test_delete_apsnet_farm_wo_env_id(self):444 """ Try to delete aspnet farm without env id445 Target component: Murano446 Scenario:447 1. Send request to create environment448 2. Send request to create session449 3. Send request to add aspnet farm450 4. Send request to delete aspnet farm using wrong environment id451 5. Send request to delete environment452 """453 resp, env = self.create_environment('test')454 self.environments.append(env)455 resp, sess = self.create_session(env['id'])456 resp, serv = self.create_apsnet_farm(env['id'], sess['id'])457 self.assertRaises(Exception, self.delete_service,458 None, sess['id'], serv['id'])459 resp = self.delete_environment(env['id'])460 self.environments.pop(self.environments.index(env))461 @attr(type='negative')462 def test_delete_apsnet_farm_wo_session_id(self):463 """ Try to delete aspnet farm without session id464 Target component: Murano465 Scenario:466 1. Send request to create environment467 2. Send request to create session468 3. Send request to add aspnet farm469 4. Send request to delete aspnet farm using wrong session id470 5. Send request to delete environment471 """472 resp, env = self.create_environment('test')473 self.environments.append(env)474 resp, sess = self.create_session(env['id'])475 resp, serv = self.create_apsnet_farm(env['id'], sess['id'])476 self.assertRaises(Exception, self.delete_service,477 env['id'], "", serv['id'])478 resp = self.delete_environment(env['id'])479 self.environments.pop(self.environments.index(env))480 @attr(type='smoke')481 def test_create_and_delete_SQL(self):482 """ Create and delete SQL483 Target component: Murano484 Scenario:485 1. Send request to create environment486 2. Send request to create session487 3. Send request to add SQL488 4. Send request to remove SQL489 5. Send request to delete environment490 """491 resp, env = self.create_environment('test')492 self.environments.append(env)493 resp, sess = self.create_session(env['id'])494 resp, serv = self.create_SQL(env['id'], sess['id'])495 resp = self.delete_service(env['id'], sess['id'], serv['id'])496 resp = self.delete_environment(env['id'])497 self.environments.pop(self.environments.index(env))498 @testtools.skip('It is look as a bug')499 @attr(type='negative')500 def test_create_SQL_wo_env_id(self):501 """ Try to create SQL without env id502 Target component: Murano503 Scenario:504 1. Send request to create environment505 2. Send request to create session506 3. Send request to create SQL using wrong environment id507 4. Send request to delete environment508 """509 resp, env = self.create_environment('test')510 self.environments.append(env)511 resp, sess = self.create_session(env['id'])512 self.assertRaises(Exception, self.create_SQL,513 None, sess['id'])514 resp = self.delete_environment(env['id'])515 self.environments.pop(self.environments.index(env))516 @attr(type='negative')517 def test_create_SQL_wo_sess_id(self):518 """ Try to create SQL without session id519 Target component: Murano520 Scenario:521 1. Send request to create environment522 2. Send request to create session523 3. Send request to create SQL using wrong session id524 4. Send request to delete environment525 """526 resp, env = self.create_environment('test')527 self.environments.append(env)528 resp, sess = self.create_session(env['id'])529 self.assertRaises(Exception, self.create_SQL,530 env['id'], "")531 resp = self.delete_environment(env['id'])532 self.environments.pop(self.environments.index(env))533 @testtools.skip("It is look like a bug")534 @attr(type='negative')535 def test_delete_SQL_wo_env_id(self):536 """ Try to delete SQL without env id537 Target component: Murano538 Scenario:539 1. Send request to create environment540 2. Send request to create session541 3. Send request to add SQL542 4. Send request to delete SQL using wrong environment id543 5. Send request to delete environment544 """545 resp, env = self.create_environment('test')546 self.environments.append(env)547 resp, sess = self.create_session(env['id'])548 resp, serv = self.create_SQL(env['id'], sess['id'])549 self.assertRaises(Exception, self.delete_service,550 None, sess['id'], serv['id'])551 resp = self.delete_environment(env['id'])552 self.environments.pop(self.environments.index(env))553 @attr(type='negative')554 def test_delete_SQL_wo_session_id(self):555 """ Try to delete SQL without session id556 Target component: Murano557 Scenario:558 1. Send request to create environment559 2. Send request to create session560 3. Send request to add SQL561 4. Send request to delete SQL using wrong session id562 5. Send request to delete environment563 """564 resp, env = self.create_environment('test')565 self.environments.append(env)566 resp, sess = self.create_session(env['id'])567 resp, serv = self.create_SQL(env['id'], sess['id'])568 self.assertRaises(Exception, self.delete_service,569 env['id'], "", serv['id'])570 resp = self.delete_environment(env['id'])571 self.environments.pop(self.environments.index(env))572 @attr(type='smoke')573 def test_create_and_delete_SQL_cluster(self):574 """ Create and delete SQL575 Target component: Murano576 Scenario:577 1. Send request to create environment578 2. Send request to create session579 3. Send request to add SQL580 4. Send request to delete SQL581 5. Send request to delete environment582 """583 resp, env = self.create_environment('test')584 self.environments.append(env)585 resp, sess = self.create_session(env['id'])586 resp, serv = self.create_SQL_cluster(env['id'], sess['id'])587 resp = self.delete_service(env['id'], sess['id'], serv['id'])588 resp = self.delete_environment(env['id'])589 self.environments.pop(self.environments.index(env))590 @attr(type='smoke')591 def test_get_list_services(self):592 """ Get a list of services593 Target component: Murano594 Scenario:595 1. Send request to create environment596 2. Send request to create session597 3. Send request to add AD598 4. Send request to get list of services599 5. Send request to delete environment600 """601 resp, env = self.create_environment('test')602 self.environments.append(env)603 resp, sess = self.create_session(env['id'])604 resp, serv = self.create_AD(env['id'], sess['id'])605 resp, somelist = self.get_list_services(env['id'], sess['id'])606 resp = self.delete_environment(env['id'])607 self.environments.pop(self.environments.index(env))608 @attr(type='negative')609 def test_get_list_of_services_wo_env_id(self):610 """ Try to get services list withoun env id611 Target component: Murano612 Scenario:613 1. Send request to create environment614 2. Send request to create session615 3. Send request to add AD616 4. Send request to get services list using wrong environment id617 5. Send request to delete environment618 """619 resp, env = self.create_environment('test')620 self.environments.append(env)621 resp, sess = self.create_session(env['id'])622 resp, serv = self.create_AD(env['id'], sess['id'])623 self.assertRaises(Exception, self.get_list_services,624 None, sess['id'])625 resp = self.delete_environment(env['id'])626 self.environments.pop(self.environments.index(env))627 @attr(type='negative')628 def test_get_list_of_services_wo_sess_id(self):629 """ Try to get services list withoun session id630 Target component: Murano631 Scenario:632 1. Send request to create environment633 2. Send request to create session634 3. Send request to add AD635 4. Send request to get services list using wrong session id636 5. Send request to delete environment637 """638 resp, env = self.create_environment('test')639 self.environments.append(env)640 resp, sess = self.create_session(env['id'])641 resp, serv = self.create_AD(env['id'], sess['id'])642 resp, somelist = self.get_list_services(env['id'], "")643 assert somelist == []644 resp = self.delete_environment(env['id'])645 self.environments.pop(self.environments.index(env))646 @attr(type='negative')647 def test_get_list_of_services_after_delete_env(self):648 """ Try to get services list after deleting env649 Target component: Murano650 Scenario:651 1. Send request to create environment652 2. Send request to create session653 3. Send request to add AD654 4. Send request to delete environment655 5. Send request to get services list656 """657 resp, env = self.create_environment('test')658 self.environments.append(env)659 resp, sess = self.create_session(env['id'])660 resp, serv = self.create_AD(env['id'], sess['id'])661 resp = self.delete_environment(env['id'])662 self.assertRaises(Exception, self.get_list_services,663 env['id'], sess['id'])664 self.environments.pop(self.environments.index(env))665 @attr(type='negative')666 def test_get_list_of_services_after_delete_session(self):667 """ Try to get services list after deleting session668 Target component: Murano669 Scenario:670 1. Send request to create environment671 2. Send request to create session672 3. Send request to add AD673 4. Send request to delete session674 5. Send request to get services list675 6. Send request to delete environment676 """677 resp, env = self.create_environment('test')678 self.environments.append(env)679 resp, sess = self.create_session(env['id'])680 resp, serv = self.create_AD(env['id'], sess['id'])681 resp = self.delete_session(env['id'], sess['id'])682 self.assertRaises(Exception, self.get_list_services,683 env['id'], sess['id'])684 resp = self.delete_environment(env['id'])685 self.environments.pop(self.environments.index(env))686 @testtools.skip("Service is not yet able to do it")687 @attr(type='smoke')688 def test_update_service(self):689 """ Update service690 Target component: Murano691 Scenario:692 1. Send request to create environment693 2. Send request to create session694 3. Send request to add AD695 4. Send request to update service696 5. Send request to remove AD697 6. Send request to delete environment698 """699 resp, env = self.create_environment('test')700 self.environments.append(env)701 resp, sess = self.create_session(env['id'])702 resp, serv = self.create_AD(env['id'], sess['id'])703 resp, updt = self.update_service(env['id'], sess['id'], serv['id'],704 serv)705 resp = self.delete_service(env['id'], sess['id'], serv['id'])706 resp = self.delete_environment(env['id'])707 self.environments.pop(self.environments.index(env))708 @attr(type='smoke')709 def test_get_service_info(self):710 """ Get service detailed info711 Target component: Murano712 Scenario:713 1. Send request to create environment714 2. Send request to create session715 3. Send request to create AD716 4. Send request to get detailed info about service717 5. Send request to delete environment718 """719 resp, env = self.create_environment('test')720 self.environments.append(env)721 resp, sess = self.create_session(env['id'])722 resp, serv = self.create_AD(env['id'], sess['id'])723 resp, serv = self.get_service_info(env['id'], sess['id'], serv['id'])724 resp = self.delete_environment(env['id'])725 self.environments.pop(self.environments.index(env))726 @attr(type='positive')727 def test_alternate_service_create1(self):728 """ Check alternate creating and deleting services729 Target component: Murano730 Scenario:731 1. Send request to create environment732 2. Send request to create session733 3. Send request to create session734 4. Send request to create session735 5. Send request to create AD(session1)736 6. Send request to create IIS(session1)737 7. Send request to create SQL(session1)738 8. Send request to create IIS(session3)739 9. Send request to create aspnet farm(session3)740 10. Send request to create AD(session3)741 11. Send request to create IIS farm(session3)742 12. Send request to create SQL cluster(session3)743 13. Send request to delete IIS(session1)744 14. Send request to create IIS(session2)745 15. Send request to delete environment746 """747 resp, env = self.create_environment('test')748 self.environments.append(env)749 resp, sess1 = self.create_session(env['id'])750 resp, sess2 = self.create_session(env['id'])751 resp, sess3 = self.create_session(env['id'])752 resp, serv1 = self.create_AD(env['id'], sess1['id'])753 resp, infa = self.get_list_services(env['id'], sess1['id'])754 assert len(infa) == 1755 resp, serv2 = self.create_IIS(env['id'], sess1['id'], serv1['domain'])756 resp, infa = self.get_list_services(env['id'], sess1['id'])757 assert len(infa) == 2758 resp, serv3 = self.create_SQL(env['id'], sess1['id'], serv1['domain'])759 resp, infa = self.get_list_services(env['id'], sess1['id'])760 assert len(infa) == 3761 resp, serv31 = self.create_IIS(env['id'], sess3['id'])762 resp, infa = self.get_list_services(env['id'], sess3['id'])763 assert len(infa) == 1764 resp, serv32 = self.create_apsnet_farm(env['id'], sess3['id'])765 resp, infa = self.get_list_services(env['id'], sess3['id'])766 assert len(infa) == 2767 resp, serv33 = self.create_AD(env['id'], sess3['id'])768 resp, infa = self.get_list_services(env['id'], sess3['id'])769 assert len(infa) == 3770 resp, serv34 = self.create_IIS_farm(env['id'], sess3['id'],771 serv33['domain'])772 resp, infa = self.get_list_services(env['id'], sess3['id'])773 assert len(infa) == 4774 resp, serv35 = self.create_SQL_cluster(env['id'], sess3['id'],775 serv33['domain'])776 resp, infa = self.get_list_services(env['id'], sess3['id'])777 assert len(infa) == 5778 resp = self.delete_service(env['id'], sess1['id'], serv2['id'])779 resp, infa = self.get_list_services(env['id'], sess1['id'])780 assert len(infa) == 2781 resp, serv21 = self.create_IIS(env['id'], sess2['id'])782 resp, infa = self.get_list_services(env['id'], sess2['id'])783 assert len(infa) == 1784 resp = self.delete_environment(env['id'])785 self.environments.pop(self.environments.index(env))786 @attr(type='positive')787 def test_alternate_service_create2(self):788 """ Check alternate creating and deleting services789 Target component: Murano790 Scenario:791 1. Send request to create environment792 2. Send request to create session793 3. Send request to create IIS794 4. Send request to create aspnet farm795 5. Send request to create AD796 6. Send request to create IIS797 7. Send request to delete environment798 """799 resp, env = self.create_environment('test')800 self.environments.append(env)801 resp, sess = self.create_session(env['id'])802 resp, serv1 = self.create_IIS(env['id'], sess['id'])803 resp, infa = self.get_list_services(env['id'], sess['id'])804 assert len(infa) == 1805 resp, serv2 = self.create_apsnet_farm(env['id'], sess['id'])806 resp, infa = self.get_list_services(env['id'], sess['id'])807 assert len(infa) == 2808 resp, serv3 = self.create_AD(env['id'], sess['id'])809 resp, infa = self.get_list_services(env['id'], sess['id'])810 assert len(infa) == 3811 resp, serv4 = self.create_IIS(env['id'], sess['id'], serv3['domain'])812 resp, infa = self.get_list_services(env['id'], sess['id'])813 assert len(infa) == 4814 resp = self.delete_environment(env['id'])815 self.environments.pop(self.environments.index(env))816 @attr(type='positive')817 def test_alternate_service_create3(self):818 """ Check alternate creating and deleting services819 Target component: Murano820 Scenario:821 1. Send request to create environment822 2. Send request to create session823 3. Send request to create aspnet farm824 4. Send request to create SQL cluster825 5. Send request to create SQL826 6. Send request to create AD827 7. Send request to delete environment828 """829 resp, env = self.create_environment('test')830 self.environments.append(env)831 resp, sess = self.create_session(env['id'])832 resp, serv1 = self.create_apsnet_farm(env['id'], sess['id'])833 resp, infa = self.get_list_services(env['id'], sess['id'])834 assert len(infa) == 1835 resp, serv2 = self.create_SQL_cluster(env['id'], sess['id'])836 resp, infa = self.get_list_services(env['id'], sess['id'])837 assert len(infa) == 2838 resp, serv3 = self.create_SQL(env['id'], sess['id'])839 resp, infa = self.get_list_services(env['id'], sess['id'])840 assert len(infa) == 3841 resp, serv4 = self.create_AD(env['id'], sess['id'])842 resp, infa = self.get_list_services(env['id'], sess['id'])843 assert len(infa) == 4844 resp = self.delete_environment(env['id'])845 self.environments.pop(self.environments.index(env))846 @attr(type='positive')847 def test_alternate_service_create4(self):848 """ Check alternate creating and deleting services849 Target component: Murano850 Scenario:851 1. Send request to create environment852 2. Send request to create session853 3. Send request to create IIS854 4. Send request to create AD855 5. Send request to create SQL856 6. Send request to create SQL cluster857 7. Send request to create aspnet farm858 8. Send request to delete environment859 """860 resp, env = self.create_environment('test')861 self.environments.append(env) 862 resp, sess = self.create_session(env['id'])863 resp, serv1 = self.create_IIS(env['id'], sess['id'])864 resp, infa = self.get_list_services(env['id'], sess['id'])865 assert len(infa) == 1866 resp, serv2 = self.create_AD(env['id'], sess['id'])867 resp, infa = self.get_list_services(env['id'], sess['id'])868 assert len(infa) == 2869 resp, serv3 = self.create_SQL(env['id'], sess['id'], serv2['domain'])870 resp, infa = self.get_list_services(env['id'], sess['id'])871 assert len(infa) == 3872 resp, serv4 = self.create_SQL_cluster(env['id'], sess['id'],873 serv2['domain'])874 resp, infa = self.get_list_services(env['id'], sess['id'])875 assert len(infa) == 4876 resp, serv5 = self.create_apsnet_farm(env['id'], sess['id'],877 serv2['domain'])878 resp, infa = self.get_list_services(env['id'], sess['id'])879 assert len(infa) == 5880 resp = self.delete_environment(env['id'])881 self.environments.pop(self.environments.index(env))882 @attr(type='positive')883 def test_alternate_service_create5(self):884 """ Check alternate creating and deleting services885 Target component: Murano886 Scenario:887 1. Send request to create environment888 2. Send request to create session889 3. Send request to create aspnet890 4. Send request to create IIS891 5. Send request to delete aspnet892 6. Send request to create AD893 7. Send request to delete IIS894 8. Send request to delete environment895 """896 resp, env = self.create_environment('test')897 self.environments.append(env)898 resp, sess = self.create_session(env['id'])899 resp, serv1 = self.create_apsnet(env['id'], sess['id'])900 resp, infa = self.get_list_services(env['id'], sess['id'])901 assert len(infa) == 1902 resp, serv2 = self.create_IIS(env['id'], sess['id'])903 resp, infa = self.get_list_services(env['id'], sess['id'])904 assert len(infa) == 2905 resp = self.delete_service(env['id'], sess['id'], serv1['id'])906 resp, infa = self.get_list_services(env['id'], sess['id'])907 assert len(infa) == 1908 resp, serv1 = self.create_AD(env['id'], sess['id'])909 resp, infa = self.get_list_services(env['id'], sess['id'])910 assert len(infa) == 2911 resp = self.delete_service(env['id'], sess['id'], serv2['id'])912 resp, infa = self.get_list_services(env['id'], sess['id'])913 assert len(infa) == 1914 resp = self.delete_environment(env['id'])915 self.environments.pop(self.environments.index(env))916 @attr(type='positive')917 def test_alternate_service_create6(self):918 """ Check alternate creating and deleting services919 Target component: Murano920 Scenario:921 1. Send request to create environment922 2. Send request to create session923 3. Send request to create SQL cluster924 4. Send request to create SQL cluster925 5. Send request to create SQL cluster926 6. Send request to create SQL cluster927 7. Send request to create SQL cluster928 8. Send request to create IIS929 9. Send request to delete environment930 """931 resp, env = self.create_environment('test')932 self.environments.append(env) 933 resp, sess = self.create_session(env['id'])934 for i in xrange(5):935 resp, serv1 = self.create_SQL_cluster(env['id'], sess['id'])936 resp, infa = self.get_list_services(env['id'], sess['id'])937 assert len(infa) == i + 1938 resp, serv2 = self.create_IIS(env['id'], sess['id'])939 resp, infa = self.get_list_services(env['id'], sess['id'])940 assert len(infa) == 6941 resp = self.delete_environment(env['id'])942 self.environments.pop(self.environments.index(env))943 @attr(type='positive')944 def test_alternate_service_create7(self):945 """ Check alternate creating and deleting services946 Target component: Murano947 Scenario:948 1. Send request to create environment949 2. Send request to create session950 3. Send request to create aspnet951 4. Send request to create SQL952 5. Send request to create IIS953 6. Send request to create SQL954 7. Send request to create aspnet955 8. Send request to create IIS956 7. Send request to delete environment957 """958 resp, env = self.create_environment('test')959 self.environments.append(env) 960 resp, sess = self.create_session(env['id'])961 resp, serv1 = self.create_apsnet(env['id'], sess['id'])962 resp, infa = self.get_list_services(env['id'], sess['id'])963 assert len(infa) == 1964 resp, serv2 = self.create_SQL(env['id'], sess['id'])965 resp, infa = self.get_list_services(env['id'], sess['id'])966 assert len(infa) == 2967 resp, serv3 = self.create_IIS(env['id'], sess['id'])968 resp, infa = self.get_list_services(env['id'], sess['id'])969 assert len(infa) == 3970 resp, serv4 = self.create_SQL(env['id'], sess['id'])971 resp, infa = self.get_list_services(env['id'], sess['id'])972 assert len(infa) == 4973 resp, serv5 = self.create_apsnet(env['id'], sess['id'])974 resp, infa = self.get_list_services(env['id'], sess['id'])975 assert len(infa) == 5976 resp, serv6 = self.create_IIS(env['id'], sess['id'])977 resp, infa = self.get_list_services(env['id'], sess['id'])978 assert len(infa) == 6979 resp = self.delete_environment(env['id'])980 self.environments.pop(self.environments.index(env))981 @attr(type='positive')982 def test_alternate_service_create8(self):983 """ Check alternate creating and deleting services984 Target component: Murano985 Scenario:986 1. Send request to create environment987 2. Send request to create session988 3. Send request to create IIS989 4. Send request to create SQL990 5. Send request to create aspnet farm991 6. Send request to delete IIS992 7. Send request to create IIS993 8. Send request to delete environment994 """995 resp, env = self.create_environment('test')996 self.environments.append(env) 997 resp, sess = self.create_session(env['id'])998 resp, serv1 = self.create_IIS(env['id'], sess['id'])999 resp, infa = self.get_list_services(env['id'], sess['id'])1000 assert len(infa) == 11001 resp, serv2 = self.create_SQL(env['id'], sess['id'])1002 resp, infa = self.get_list_services(env['id'], sess['id'])1003 assert len(infa) == 21004 resp, serv3 = self.create_apsnet_farm(env['id'], sess['id'])1005 resp, infa = self.get_list_services(env['id'], sess['id'])1006 assert len(infa) == 31007 resp = self.delete_service(env['id'], sess['id'], serv1['id'])1008 resp, infa = self.get_list_services(env['id'], sess['id'])1009 assert len(infa) == 21010 resp, serv1 = self.create_IIS(env['id'], sess['id'])1011 resp, infa = self.get_list_services(env['id'], sess['id'])1012 assert len(infa) == 31013 resp = self.delete_environment(env['id'])1014 self.environments.pop(self.environments.index(env))1015 @attr(type='negative')1016 def test_double_delete_service(self):1017 """ Try to double delete service1018 Target component: Murano1019 Scenario:1020 1. Send request to create environment1021 2. Send request to create session1022 3. Send request to create IIS1023 4. Send request to delete IIS1024 5. Send request to delete IIS1025 6. Send request to delete environment1026 """1027 resp, env = self.create_environment('test')1028 self.environments.append(env)1029 resp, sess = self.create_session(env['id'])1030 resp, serv1 = self.create_IIS(env['id'], sess['id'])1031 resp = self.delete_service(env['id'], sess['id'], serv1['id'])1032 self.assertRaises(Exception, self.delete_service, env['id'],1033 sess['id'], serv1['id'])1034 resp = self.delete_environment(env['id'])...

Full Screen

Full Screen

test_Environments.py

Source:test_Environments.py Github

copy

Full Screen

...16 assert len(environment_provider("").get_environments()) == 017 environment = environment_provider("").add_environment("an_environment")18 assert len(environment_provider("").get_environments()) == 119 assert environment_provider("").get_environments()[0]['name'] == "an_environment"20 environment_provider("").delete_environment(environment)21 def test_delete_environment(self):22 assert len(environment_provider("").get_environments()) == 023 environment = environment_provider("").add_environment("an_environment")24 environment_2 = environment_provider("").add_environment("second_environment")25 assert len(environment_provider("").get_environments()) == 226 environment_provider("").delete_environment(environment)27 assert len(environment_provider("").get_environments()) == 128 assert environment_provider("").get_environments()[0]['name'] == "second_environment"29 environment_provider("").delete_environment(environment_2)30 assert len(environment_provider("").get_environments()) == 031 def test_delete_nonempty_host_environment(self):32 host_provider = HostProvider("")33 data = {34 'name': 'Csillamponi',35 'host': 'crane.gov',36 'username': 'Bela',37 'password': 'encrypted'38 }39 host_id = host_provider.add_host(data)40 assert len(environment_provider(host_provider).get_environments()) == 041 environment_id = environment_provider(host_provider).add_environment("an_environment")42 environment_provider(host_provider).add_host_to_environment(environment_id, host_id)43 assert len(environment_provider(host_provider).get_environments()) == 144 environment_provider(host_provider).delete_environment(environment_id)45 assert len(environment_provider(host_provider).get_environments()) == 146 environment_provider(host_provider).delete_host_from_environment(environment_id, host_id)47 environment_provider(host_provider).delete_environment(environment_id)48 host_provider.delete_host(host_id)49 assert len(environment_provider(host_provider).get_environments()) == 050 def test_add_host_to_environment(self):51 host_provider = HostProvider("")52 data = {53 'name': 'Csillamponi',54 'host': 'crane.gov',55 'username': 'Bela',56 'password': 'encrypted'57 }58 host_id = host_provider.add_host(data)59 assert len(environment_provider(host_provider).get_environments()) == 060 environment_id = environment_provider(host_provider).add_environment("an_environment")61 environment_provider(host_provider).add_host_to_environment(environment_id, host_id)62 the_environment = environment_provider(host_provider).get_environment_by_id(environment_id)63 assert the_environment.name == "an_environment"64 assert len(the_environment.hosts) == 165 assert the_environment.hosts[0].name == "Csillamponi"66 assert the_environment.hosts[0].username == "Bela"67 assert the_environment.hosts[0].password == "encrypted"68 assert the_environment.hosts[0].host == "crane.gov"69 environment_provider(host_provider).delete_host_from_environment(environment_id, host_id)70 environment_provider(host_provider).delete_environment(environment_id)71 host_provider.delete_host(host_id)72 assert len(environment_provider(host_provider).get_environments()) == 073 def test_get_hosts_for_deployment(self):74 ssh_mock = MockSSH([{'type': 'execute',75 'command': 'docker ps -a -q',76 'result': {'stdout': 'alma\nkorte\n', 'stderr': '', 'exit_code': 0}},77 {'type': 'execute',78 'command': 'docker ps -a -q',79 'result': {'stdout': 'dio\n', 'stderr': '', 'exit_code': 0}}])80 host_provider = HostProvider(ssh_mock)81 data = {82 'name': 'Csillamponi',83 'host': 'crane.gov',84 'username': 'Bela',85 'password': 'encrypted'86 }87 data2 = {88 'name': 'Csillamponi2',89 'host': 'crane2.gov',90 'username': 'Geza',91 'password': 'unencrypted'92 }93 host_id = host_provider.add_host(data)94 host_id_2 = host_provider.add_host(data2)95 assert len(environment_provider(host_provider).get_environments()) == 096 environment_id = environment_provider(host_provider).add_environment("an_environment")97 environment_provider(host_provider).add_host_to_environment(environment_id, host_id)98 environment_provider(host_provider).add_host_to_environment(environment_id, host_id_2)99 assert environment_provider(host_provider).get_hosts_for_deployment(environment_id, 3) == [2, 2, 1]100 environment_provider(host_provider).delete_host_from_environment(environment_id, host_id)101 environment_provider(host_provider).delete_host_from_environment(environment_id, host_id_2)102 environment_provider(host_provider).delete_environment(environment_id)103 host_provider.delete_host(host_id)...

Full Screen

Full Screen

test_murano_envs.py

Source:test_murano_envs.py Github

copy

Full Screen

...32 """33 resp, env = self.create_environment('test')34 self.environments.append(env)35 resp, env1 = self.get_environment_by_id(env['id'])36 resp = self.delete_environment(env['id'])37 self.environments.pop(self.environments.index(env))38 @attr(type='smoke')39 def test_get_list_environments(self):40 """41 Get list of existing environments42 Test try to get list of existing environments43 Target component: Murano44 Scenario:45 1. Send request to get list of enviroments46 """47 resp, environments = self.get_list_environments()48 @attr(type='smoke')49 def test_update_environment(self):50 """51 Update environment instance52 Test try to update environment instance53 Target component: Murano54 Scenario:55 1. Send request to create environment56 2. Send request to update enviroment instance57 3. Send request to delete environment58 """59 resp, env = self.create_environment('test')60 self.environments.append(env)61 resp, env1 = self.update_environment(env['id'], env['name'])62 resp = self.delete_environment(env['id'])63 self.environments.pop(self.environments.index(env))64 @attr(type='negative')65 def test_update_env_with_wrong_env_id(self):66 """67 Try to update environment using uncorrect env_id68 Target component: Murano69 Scenario:70 1. Send request to create environment71 2. Send request to update enviroment instance(with uncorrrect env_id)72 3. Send request to delete environment73 """74 resp, env = self.create_environment('test')75 self.environments.append(env)76 self.assertRaises(Exception, self.update_environment, None,77 env['name'])78 resp = self.delete_environment(env['id'])79 self.environments.pop(self.environments.index(env))80 @attr(type='negative')81 def test_update_env_after_begin_of_deploy(self):82 """83 Try to update environment after begin of deploy84 Target component: Murano85 Scenario:86 1. Send request to create environment87 2. Send request to create session88 3. Send request to deploy session89 4. Send request to update enviroment90 5. Send request to delete environment91 """92 resp, env = self.create_environment('test')93 self.environments.append(env)94 resp, sess = self.create_session(env['id'])95 resp = self.deploy_session(env['id'], sess['id'])96 self.assertRaises(Exception, self.update_environment, None,97 env['name'])98 resp = self.delete_environment(env['id'])99 self.environments.pop(self.environments.index(env))100 @attr(type='negative')101 def test_delete_env_by_uncorrect_env_id(self):102 """103 Try to delete environment using uncorrect env_id104 Target component: Murano105 Scenario:106 1. Send request to create environment107 2. Send request to delete environment(with uncorrrect env_id)108 3. Send request to delete environment109 """110 resp, env = self.create_environment('test')111 self.environments.append(env)112 self.assertRaises(Exception, self.delete_environment,113 None)114 resp = self.delete_environment(env['id'])115 self.environments.pop(self.environments.index(env))116 @attr(type='negative')117 def test_double_delete_environment(self):118 """119 Try to delete environment twice120 Target component: Murano121 Scenario:122 1. Send request to create environment123 2. Send request to delete environment124 3. Send request to delete environment125 """126 resp, env = self.create_environment('test')127 self.environments.append(env)128 resp = self.delete_environment(env['id'])129 self.environments.pop(self.environments.index(env))130 self.assertRaises(Exception, self.delete_environment,...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lisa automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful