Ejemplo n.º 1
0
 def detail_volume(self, volume_base_url, volume_id):
     # Detail the volume
     specific_volume_url = urljoin(volume_base_url, "%s/" % volume_id)
     volume_get_resp = self.api_client.get(specific_volume_url)
     # Validate the output
     self.assertEqual(volume_get_resp.status_code, status.HTTP_200_OK)
     verify_expected_output(self, volume_get_resp.data, self.expected_output)
Ejemplo n.º 2
0
 def detail_step_os(self, instance_id):
     # Detail the instance
     os_instance_url = urljoin(os_base_instance_url, "%s/" % instance_id)
     instance_get_resp = self.api_client.get(os_instance_url)
     # Validate the output
     self.assertEqual(instance_get_resp.status_code, status.HTTP_200_OK)
     verify_expected_output(self, instance_get_resp.data, self.expected_output)
Ejemplo n.º 3
0
 def detail_volume(self, volume_base_url, volume_id):
     #Detail the volume
     specific_volume_url = urljoin(volume_base_url, '%s/' % volume_id)
     volume_get_resp = self.api_client.get(specific_volume_url)
     #Validate the output
     self.assertEqual(volume_get_resp.status_code, status.HTTP_200_OK)
     verify_expected_output(self, volume_get_resp.data,
                            self.expected_output)
Ejemplo n.º 4
0
 def test_oauth_token(self):
     """
     Explicitly call auth and test that tokens can be created.
     """
     self.oauth_api_client = OAuthTokenAPIClient()
     self.oauth_api_client.login(oauth_user='******')
     verify_expected_output(self, self.oauth_api_client.token, self.expected_output)
     self.oauth_api_client.logout()
Ejemplo n.º 5
0
 def detail_step_os(self, instance_id):
     #Detail the instance
     os_instance_url = urljoin(os_base_instance_url, '%s/' % instance_id)
     instance_get_resp = self.api_client.get(os_instance_url)
     #Validate the output
     self.assertEqual(instance_get_resp.status_code, status.HTTP_200_OK)
     verify_expected_output(self, instance_get_resp.data,
                            self.expected_output)
Ejemplo n.º 6
0
 def test_api_token(self):
     """
     Explicitly call auth and test that tokens can be created.
     """
     self.api_client = TokenAPIClient()
     self.api_client.login(username=settings.TEST_RUNNER_USER, password=settings.TEST_RUNNER_PASS)
     verify_expected_output(self, self.api_client.token, self.expected_output)
     self.api_client.logout()
Ejemplo n.º 7
0
 def test_api_token(self):
     """
     Explicitly call auth and test that tokens can be created.
     """
     self.api_client = TokenAPIClient()
     self.api_client.login(
             username=settings.TEST_RUNNER_USER,
             password=settings.TEST_RUNNER_PASS)
     verify_expected_output(self, self.api_client.token, self.expected_output)
     self.api_client.logout()
Ejemplo n.º 8
0
 def create_volume(self, volume_base_url, post_data):
     # Create the volume
     volume_launch_resp = self.api_client.post(volume_base_url, post_data, format="json")
     # Validate the output
     if volume_launch_resp.status_code != status.HTTP_201_CREATED:
         logger.info(volume_launch_resp)
     self.assertEqual(volume_launch_resp.status_code, status.HTTP_201_CREATED)
     self.assertIsNotNone(volume_launch_resp.data)
     verify_expected_output(self, volume_launch_resp.data, self.expected_output)
     volume_id = volume_launch_resp.data["alias"]
     return volume_id
Ejemplo n.º 9
0
 def test_openstack_machine(self):
     """
     Testing machines must be done in order
     * Create the machine
     * Detail the machine
     * Delete the machine
     """
     list_machine_resp = self.api_client.get(self.os_machine_url)
     self.assertEqual(list_machine_resp.status_code, status.HTTP_200_OK)
     if not list_machine_resp.data:
         return
     for machine in list_machine_resp.data:
         verify_expected_output(self, machine, self.expected_output)
Ejemplo n.º 10
0
 def test_openstack_machine(self):
     """
     Testing machines must be done in order
     * Create the machine
     * Detail the machine
     * Delete the machine
     """
     list_machine_resp = self.api_client.get(self.os_machine_url)
     self.assertEqual(list_machine_resp.status_code, status.HTTP_200_OK)
     if not list_machine_resp.data:
         return
     for machine in list_machine_resp.data:
         verify_expected_output(self, machine, self.expected_output)
Ejemplo n.º 11
0
 def create_volume(self, volume_base_url, post_data):
     #Create the volume
     volume_launch_resp = self.api_client.post(volume_base_url, post_data,
                                               format='json')
     #Validate the output
     if volume_launch_resp.status_code != status.HTTP_201_CREATED:
         logger.info(volume_launch_resp)
     self.assertEqual(volume_launch_resp.status_code, status.HTTP_201_CREATED)
     self.assertIsNotNone(volume_launch_resp.data)
     verify_expected_output(self, volume_launch_resp.data,
                            self.expected_output)
     volume_id = volume_launch_resp.data['alias']
     return volume_id
Ejemplo n.º 12
0
 def test_euca_machine(self):
     """
     Testing machines must be done in order
     * Create the machine
     * Detail the machine
     * Delete the machine
     # Wait for machine to deploy and
     # Ensure: SSH, VNC, Shellinabox, Deploy access
     """
     list_machine_resp = self.api_client.get(self.euca_machine_url)
     self.assertEqual(list_machine_resp.status_code, status.HTTP_200_OK)
     if not list_machine_resp.data:
         return
     for machine in list_machine_resp.data:
         verify_expected_output(self, machine, self.expected_output)
Ejemplo n.º 13
0
 def test_euca_machine(self):
     """
     Testing machines must be done in order
     * Create the machine
     * Detail the machine
     * Delete the machine
     # Wait for machine to deploy and
     # Ensure: SSH, VNC, Shellinabox, Deploy access
     """
     list_machine_resp = self.api_client.get(self.euca_machine_url)
     self.assertEqual(list_machine_resp.status_code, status.HTTP_200_OK)
     if not list_machine_resp.data:
         return
     for machine in list_machine_resp.data:
         verify_expected_output(self, machine, self.expected_output)
Ejemplo n.º 14
0
 def test_token_output(self):
     """
     Explicitly call auth and test that tokens can be created.
     """
     verify_expected_output(self, self.api_client.token, self.expected_output)
Ejemplo n.º 15
0
 def test_token_output(self):
     """
     Explicitly call auth and test that tokens can be created.
     """
     verify_expected_output(self, self.api_client.token,
                            self.expected_output)