Test reboot SSVM
(self)
| 859 | "sg"], |
| 860 | required_hardware="true") |
| 861 | def test_07_reboot_ssvm(self): |
| 862 | """Test reboot SSVM |
| 863 | """ |
| 864 | # Validate the following |
| 865 | # 1. The SSVM should go to stop and return to Running state |
| 866 | # 2. SSVM's public-ip and private-ip must remain the same |
| 867 | # before and after reboot |
| 868 | # 3. The cloud process should still be running within the SSVM |
| 869 | |
| 870 | list_ssvm_response = list_ssvms( |
| 871 | self.apiclient, |
| 872 | systemvmtype='secondarystoragevm', |
| 873 | state='Running', |
| 874 | zoneid=self.zone.id |
| 875 | ) |
| 876 | |
| 877 | self.assertEqual( |
| 878 | isinstance(list_ssvm_response, list), |
| 879 | True, |
| 880 | "Check list response returns a valid list" |
| 881 | ) |
| 882 | |
| 883 | ssvm_response = list_ssvm_response[0] |
| 884 | |
| 885 | hosts = list_hosts( |
| 886 | self.apiclient, |
| 887 | id=ssvm_response.hostid |
| 888 | ) |
| 889 | self.assertEqual( |
| 890 | isinstance(hosts, list), |
| 891 | True, |
| 892 | "Check list response returns a valid list" |
| 893 | ) |
| 894 | |
| 895 | # Store the public & private IP values before reboot |
| 896 | old_public_ip = ssvm_response.publicip |
| 897 | old_private_ip = ssvm_response.privateip |
| 898 | |
| 899 | self.debug("Rebooting SSVM: %s" % ssvm_response.id) |
| 900 | cmd = rebootSystemVm.rebootSystemVmCmd() |
| 901 | cmd.id = ssvm_response.id |
| 902 | self.apiclient.rebootSystemVm(cmd) |
| 903 | |
| 904 | ssvm_response = self.checkForRunningSystemVM(ssvm_response) |
| 905 | self.debug("SSVM State: %s" % ssvm_response.state) |
| 906 | self.assertEqual( |
| 907 | 'Running', |
| 908 | str(ssvm_response.state), |
| 909 | "Check whether CPVM is running or not" |
| 910 | ) |
| 911 | |
| 912 | self.assertEqual( |
| 913 | ssvm_response.publicip, |
| 914 | old_public_ip, |
| 915 | "Check Public IP after reboot with that of before reboot" |
| 916 | ) |
| 917 | |
| 918 | # Private IP Address of System VMs are allowed to change after reboot - CLOUDSTACK-7745 |
nothing calls this directly
no test coverage detected