Test stop CPVM
(self)
| 795 | "sg"], |
| 796 | required_hardware="true") |
| 797 | def test_06_stop_cpvm(self): |
| 798 | """Test stop CPVM |
| 799 | """ |
| 800 | |
| 801 | # Validate the following |
| 802 | # 1. The CPVM should go to stop state |
| 803 | # 2. After a brief delay of say one minute, the SSVM should be |
| 804 | # restarted once again and return to Running state with previous |
| 805 | # two test cases still passing |
| 806 | # 3. If either of the two above steps fail the test is a failure |
| 807 | |
| 808 | list_cpvm_response = list_ssvms( |
| 809 | self.apiclient, |
| 810 | systemvmtype='consoleproxy', |
| 811 | state='Running', |
| 812 | zoneid=self.zone.id |
| 813 | ) |
| 814 | self.assertEqual( |
| 815 | isinstance(list_cpvm_response, list), |
| 816 | True, |
| 817 | "Check list response returns a valid list" |
| 818 | ) |
| 819 | cpvm = list_cpvm_response[0] |
| 820 | |
| 821 | hosts = list_hosts( |
| 822 | self.apiclient, |
| 823 | id=cpvm.hostid |
| 824 | ) |
| 825 | self.assertEqual( |
| 826 | isinstance(hosts, list), |
| 827 | True, |
| 828 | "Check list response returns a valid list" |
| 829 | ) |
| 830 | |
| 831 | self.debug("Stopping CPVM: %s" % cpvm.id) |
| 832 | cmd = stopSystemVm.stopSystemVmCmd() |
| 833 | cmd.id = cpvm.id |
| 834 | self.apiclient.stopSystemVm(cmd) |
| 835 | |
| 836 | cpvm_response = self.checkForRunningSystemVM(cpvm) |
| 837 | self.debug("CPVM state after debug: %s" % cpvm_response.state) |
| 838 | |
| 839 | self.assertEqual( |
| 840 | cpvm_response.state, |
| 841 | 'Running', |
| 842 | "Check whether CPVM is running or not" |
| 843 | ) |
| 844 | |
| 845 | # Wait for the agent to be up |
| 846 | self.waitForSystemVMAgent(cpvm_response.name) |
| 847 | |
| 848 | # Call above tests to ensure CPVM is properly running |
| 849 | self.test_02_list_cpvm_vm() |
| 850 | |
| 851 | self.test_04_cpvm_internals() |
| 852 | |
| 853 | @attr( |
| 854 | tags=[ |
nothing calls this directly
no test coverage detected