Module Expr Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr CompareIsNot AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr If CompareNotEq Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Str attr Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num orelse Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list Call NameLoad keyword Str keyword Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr If CompareNotEq Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Str attr Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign NameStore AttributeLoad NameLoad attr If CompareNotEq Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Str attr Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr If BoolOpAnd NameLoad NameLoad body If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Raise Call NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str decorator_list Call AttributeLoad NameLoad attr CompareIn NameLoad ListLoad AttributeLoad NameLoad attr Str Call NameLoad Str Call NameLoad keyword Str keyword Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num keyword Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr CompareIsNot AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list Call NameLoad keyword Str keyword Str decorator_list Call AttributeLoad NameLoad attr CompareIn NameLoad ListLoad AttributeLoad NameLoad attr Str ClassDef bases NameLoad NameLoad body FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Str attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A 
Copyright 2015 Rackspace

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 N/A unittest cafe.drivers.unittest.decorators tags cloudcafe.common.tools.datagen rand_name cloudcafe.compute.common.types ComputeHypervisors cloudcafe.compute.config ComputeConfig cloudroast.compute.decorators requires_extension cloudroast.compute.fixtures ServerFromImageFixture N/A compute_config N/A ComputeConfig N/A hypervisor N/A N/A N/A compute_config hypervisor lower ServerRescueTests N/A object N/A test_rescue_and_unrescue_server_test N/A N/A self N/A N/A N/A 
        Verify that a server can enter and exit rescue mode

        Get a remote client for the server created during test set up. Use the
        remote client to get a list of all disks on the server. Rescue the
        server and validate that the response status code is 202 and that the
        password to access the server has changed. Wait for the server to
        achieve 'RESCUE' status. If the server is not a Windows server, get a
        remote client for the rescued server and validate that the number of
        disks on the server is equal to one plus the number of disks originally
        on the server. Unrescue the server and once it reaches 'ACTIVE' status
        get a remote client for the server and validate that the number of
        disks on the server after being rescued and unrescued is equal to the
        number of disks originally on the server.

        The following assertions occur:
            - The response status code of a rescue request is equal to 200
            - The server password is different after the server rescue request
            - If the image os_type metadata type is not windows, the number of
              disks on the rescued server should be equal to one plus the
              number of disks originally on the server
            - The response status code of an unrescue request is equal to 202
            - When the server has exited RESCUE statue the number of disks on
              the server should be equal to the number of disks originally on
              the server
         N/A remote_client N/A N/A N/A self server_behaviors get_remote_instance_client N/A self server N/A self servers_config key N/A N/A self key private_key N/A disks N/A N/A remote_client get_all_disks N/A original_num_disks N/A len N/A N/A disks keys N/A rescue_response N/A N/A N/A self rescue_client rescue N/A N/A self server id N/A changed_password N/A N/A rescue_response entity admin_pass N/A N/A N/A self assertEqual N/A rescue_response status_code 200 N/A N/A N/A self assertTrue N/A N/A N/A self server admin_pass changed_password msg The password did not change after Rescue. N/A rescue_server_response N/A N/A N/A self server_behaviors wait_for_server_status N/A N/A self server id RESCUE N/A rescue_server N/A rescue_server_response entity N/A N/A rescue_server admin_pass changed_password N/A image N/A N/A N/A N/A self images_client get_image N/A N/A N/A self server image id entity N/A N/A N/A N/A N/A N/A N/A image metadata get os_type lower windows N/A N/A remote_client N/A N/A N/A self server_behaviors get_remote_instance_client rescue_server N/A self servers_config password changed_password auth_strategy password N/A disks N/A N/A remote_client get_all_disks N/A N/A hypervisor N/A ComputeHypervisors IRONIC N/A N/A N/A N/A self assertEqual N/A len N/A N/A disks keys N/A original_num_disks 1 N/A N/A N/A N/A self assertEqual N/A len N/A N/A disks keys original_num_disks N/A unrescue_response N/A N/A N/A self rescue_client unrescue N/A N/A self server id N/A N/A N/A self assertEqual N/A unrescue_response status_code 202 N/A N/A N/A N/A self server_behaviors wait_for_server_status N/A N/A self server id ACTIVE N/A remote_client N/A N/A N/A self server_behaviors get_remote_instance_client N/A self server N/A self servers_config key N/A N/A self key private_key N/A disks N/A N/A remote_client get_all_disks N/A N/A N/A self assertEqual N/A len N/A N/A disks keys original_num_disks N/A N/A tags type smoke net yes test_rescue_with_image_change_server_test N/A N/A self N/A N/A N/A 
        A server can be rescued using a specified image id

        Verify that a server can enter and exit rescue mode when an image is
        supplied to the rescue request. This test will execute only if the
        extension is enabled. This is determined automatically. Create a server
        using the key created during test set up. Get the distro of the created
        server. Rescue the server using the alt image ref value from test
        configuration as the rescue image ref value. Wait for the server to
        reach 'RESCUE' status. Get a remote instance client for the server and
        use it to get the distro of the rescued server. Validate that if the
        distro should be different, it is different.

        The following assertions occur:
            - The response status code of a rescue request is equal to 200
            - If the image id and the alt image id in test configuration are
              different, the distro of the server before rescue and the distro
              after rescue should be different.
            - If the image id and the alt image id in test configuration are
              the same, the distro of the server before rescue and the distro
              after rescue should be the same.
            - The response status code of an unrescue request is equal to 202
         N/A server N/A N/A self create_server key_name N/A N/A self key name N/A image N/A N/A N/A N/A self images_client get_image N/A N/A N/A self server image id entity N/A N/A N/A N/A N/A N/A N/A image metadata get os_type lower windows N/A N/A remote_client N/A N/A N/A self server_behaviors get_remote_instance_client server N/A self servers_config key N/A N/A self key private_key N/A distro_before_rescue N/A N/A remote_client get_distribution_and_version N/A rescue_response N/A N/A N/A self rescue_client rescue N/A server id rescue_image_ref N/A self image_ref_alt N/A N/A N/A self assertEqual N/A rescue_response status_code 200 N/A changed_password N/A N/A rescue_response entity admin_pass N/A rescue_server_response N/A N/A N/A self server_behaviors wait_for_server_status N/A server id RESCUE N/A rescue_server N/A rescue_server_response entity N/A N/A rescue_server admin_pass changed_password N/A image_resp N/A N/A N/A self images_client get_image N/A N/A N/A self server image id N/A N/A N/A self assertEqual N/A image_resp status_code 200 N/A image N/A image_resp entity N/A N/A N/A N/A N/A N/A N/A image metadata get os_type lower windows N/A N/A remote_client N/A N/A N/A self server_behaviors get_remote_instance_client server N/A self servers_config password changed_password key N/A N/A self key private_key N/A distro_after_rescue N/A N/A remote_client get_distribution_and_version N/A N/A distro_before_rescue distro_after_rescue N/A N/A N/A N/A self image_ref N/A self image_ref_alt N/A N/A N/A N/A self assertNotEqual distro_before_rescue distro_after_rescue N/A N/A N/A N/A self assertEqual distro_before_rescue distro_after_rescue N/A N/A N/A Exception Unable to retrieve distros for rebuild check N/A unrescue_response N/A N/A N/A self rescue_client unrescue N/A server id N/A N/A N/A self assertEqual N/A unrescue_response status_code 202 N/A N/A N/A N/A self server_behaviors wait_for_server_status N/A server id ACTIVE N/A N/A N/A unittest skipIf N/A hypervisor N/A N/A ComputeHypervisors IRONIC Rescue with image change is not supported in current configuration N/A requires_extension ExtendedRescueWithImage N/A tags type smoke net yes test_rescue_and_delete_server_test N/A N/A self N/A N/A N/A 
        Verify that a server can enter a rescue mode and then be deleted.

        Rescue the server and validate that the response status code is 200
        and that the password to access the server has changed. Wait for
        the server to achieve 'RESCUE' status. Delete the
        server and verify that a rescued server can be deleted.

        The following assertions occur:
            - The response status code of a rescue request is equal to 200
            - The response status code of a delete request for rescued server
              is equal to 204
            - The rescued server is deleted.
         N/A rescue_response N/A N/A N/A self rescue_client rescue N/A N/A self server id N/A N/A N/A self assertEqual N/A rescue_response status_code 200 msg N/A N/A Rescuing server {0} failed with response code {1} format N/A N/A self server id N/A rescue_response status_code N/A changed_password N/A N/A rescue_response entity admin_pass N/A N/A N/A self assertTrue N/A N/A N/A self server admin_pass changed_password msg The password did not change after Rescue. N/A N/A N/A N/A self server_behaviors wait_for_server_status N/A N/A self server id RESCUE N/A delete_response N/A N/A N/A self servers_client delete_server N/A N/A self server id N/A N/A N/A self assertEqual 204 N/A delete_response status_code msg N/A N/A Deleting server {0} failed with response code {1} format N/A N/A self server id N/A rescue_response status_code N/A N/A N/A N/A self server_behaviors wait_for_server_to_be_deleted N/A N/A self server id N/A N/A tags type smoke net yes N/A N/A N/A unittest skipIf N/A hypervisor N/A N/A ComputeHypervisors LXC_LIBVIRT Rescue server not supported in current configuration. ServerFromImageRescueTests N/A ServerFromImageFixture ServerRescueTests N/A setUp N/A N/A self N/A N/A N/A 
        Perform actions that set up the necessary resources for testing

        The following resources are created during this set up:
            - A keypair with a random name starting with 'key'
            - A server with the following settings:
                - The keypair previously created
                - Remaining values required for creating a server will come
                  from test configuration.
         N/A N/A N/A N/A super ServerFromImageRescueTests self setUp N/A N/A self key N/A N/A N/A N/A self keypairs_client create_keypair N/A rand_name key entity N/A N/A N/A N/A self resources add N/A N/A self key name N/A N/A self keypairs_client delete_keypair N/A N/A N/A self create_server key_name N/A N/A self key name N/A flavor_response N/A N/A N/A self flavors_client get_flavor_details N/A self flavor_ref N/A N/A self flavor N/A flavor_response entity N/A N/A