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

Method test_05_stop_ssvm

test/integration/smoke/test_ssvm.py:734–787  ·  view source on GitHub ↗

Test stop SSVM

(self)

Source from the content-addressed store, hash-verified

732 "sg"],
733 required_hardware="true")
734 def test_05_stop_ssvm(self):
735 """Test stop SSVM
736 """
737
738 # Validate the following
739 # 1. The SSVM should go to stop state
740 # 2. After a brief delay of say one minute, the SSVM should be
741 # restarted once again and return to Running state with previous two
742 # test cases still passing
743 # 3. If either of the two above steps fail the test is a failure
744
745 list_ssvm_response = list_ssvms(
746 self.apiclient,
747 systemvmtype='secondarystoragevm',
748 state='Running',
749 zoneid=self.zone.id
750 )
751 self.assertEqual(
752 isinstance(list_ssvm_response, list),
753 True,
754 "Check list response returns a valid list"
755 )
756 ssvm = list_ssvm_response[0]
757
758 hosts = list_hosts(
759 self.apiclient,
760 id=ssvm.hostid
761 )
762 self.assertEqual(
763 isinstance(hosts, list),
764 True,
765 "Check list response returns a valid list"
766 )
767
768 self.debug("Stopping SSVM: %s" % ssvm.id)
769 cmd = stopSystemVm.stopSystemVmCmd()
770 cmd.id = ssvm.id
771 self.apiclient.stopSystemVm(cmd)
772
773 ssvm_response = self.checkForRunningSystemVM(ssvm)
774 self.debug("SSVM state after debug: %s" % ssvm_response.state)
775 self.assertEqual(
776 ssvm_response.state,
777 'Running',
778 "Check whether SSVM is running or not"
779 )
780
781 # Wait for the agent to be up
782 self.waitForSystemVMAgent(ssvm_response.name)
783
784 # Call above tests to ensure SSVM is properly running
785 self.test_01_list_sec_storage_vm()
786
787 self.test_03_ssvm_internals()
788
789 @attr(
790 tags=[

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected