Test reboot CPVM
(self)
| 934 | "sg"], |
| 935 | required_hardware="true") |
| 936 | def test_08_reboot_cpvm(self): |
| 937 | """Test reboot CPVM |
| 938 | """ |
| 939 | # Validate the following |
| 940 | # 1. The CPVM should go to stop and return to Running state |
| 941 | # 2. CPVM's public-ip and private-ip must remain |
| 942 | # the same before and after reboot |
| 943 | # 3. the cloud process should still be running within the CPVM |
| 944 | |
| 945 | list_cpvm_response = list_ssvms( |
| 946 | self.apiclient, |
| 947 | systemvmtype='consoleproxy', |
| 948 | state='Running', |
| 949 | zoneid=self.zone.id |
| 950 | ) |
| 951 | self.assertEqual( |
| 952 | isinstance(list_cpvm_response, list), |
| 953 | True, |
| 954 | "Check list response returns a valid list" |
| 955 | ) |
| 956 | cpvm_response = list_cpvm_response[0] |
| 957 | |
| 958 | hosts = list_hosts( |
| 959 | self.apiclient, |
| 960 | id=cpvm_response.hostid |
| 961 | ) |
| 962 | self.assertEqual( |
| 963 | isinstance(hosts, list), |
| 964 | True, |
| 965 | "Check list response returns a valid list" |
| 966 | ) |
| 967 | |
| 968 | # Store the public & private IP values before reboot |
| 969 | old_public_ip = cpvm_response.publicip |
| 970 | old_private_ip = cpvm_response.privateip |
| 971 | |
| 972 | self.debug("Rebooting CPVM: %s" % cpvm_response.id) |
| 973 | |
| 974 | cmd = rebootSystemVm.rebootSystemVmCmd() |
| 975 | cmd.id = cpvm_response.id |
| 976 | self.apiclient.rebootSystemVm(cmd) |
| 977 | |
| 978 | cpvm_response = self.checkForRunningSystemVM(cpvm_response) |
| 979 | self.debug("CPVM state: %s" % cpvm_response.state) |
| 980 | self.assertEqual( |
| 981 | 'Running', |
| 982 | str(cpvm_response.state), |
| 983 | "Check whether CPVM is running or not" |
| 984 | ) |
| 985 | |
| 986 | self.assertEqual( |
| 987 | cpvm_response.publicip, |
| 988 | old_public_ip, |
| 989 | "Check Public IP after reboot with that of before reboot" |
| 990 | ) |
| 991 | |
| 992 | # Private IP Address of System VMs are allowed to change after reboot - CLOUDSTACK-7745 |
| 993 |
nothing calls this directly
no test coverage detected