Module Expr Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Dict Str Str Str Str Assign AttributeStore NameLoad attr Str Assign NameStore ListLoad Dict Str Str Str Call AttributeLoad NameLoad attr AttributeLoad 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 Assign AttributeStore NameLoad attr AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad 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 Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad keyword Str decorator_list Call NameLoad keyword Str keyword Str 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 Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad keyword Str decorator_list Call NameLoad keyword Str keyword Str 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 Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr With Call AttributeLoad NameLoad attr NameLoad body Expr AttributeLoad Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr attr decorator_list Call NameLoad keyword Str keyword Str 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 base64 cafe.drivers.unittest.decorators tags cloudcafe.compute.common.exceptions FileNotFoundException cloudcafe.common.tools.datagen rand_name cloudroast.compute.fixtures ComputeFixture ConfigDriveDirectoryTest N/A ComputeFixture N/A setUpClass N/A N/A cls N/A N/A N/A 
        Perform actions that setup the necessary resources for testing

        The following data is generated during this set up:
            - A name value that is a random name starting with the word 'server'
            - A dictionary of metadata with the values:
                {'user_key1': 'value1',
                 'user_key2': 'value2'}
            - If default file injection is enabled, a list of files containing
              a file with the path '/test.txt' and the contents 'This is a
              config drive test file.'

        The following resources are created during this set up:
            - A keypair with a random name starting with 'key'
            - A server with the following settings:
                - config_drive set to True
                - The keypair previously created
                - Files to be injected at server creation including the
                  '/test.txt' data previously generated
                - The metadata previously created
                - Remaining values required for creating a server will come
                  from test configuration.
         N/A N/A N/A N/A super ConfigDriveDirectoryTest cls setUpClass N/A N/A cls metadata N/A meta_key_1 meta_key_2 meta_value_1 meta_value_2 N/A N/A cls file_contents This is a config drive test file. N/A files N/A N/A path contents /test.txt N/A N/A base64 b64encode N/A cls file_contents N/A N/A cls key N/A N/A N/A N/A cls keypairs_client create_keypair N/A rand_name key entity N/A N/A N/A N/A cls resources add N/A N/A cls key name N/A N/A cls keypairs_client delete_keypair N/A N/A cls server N/A N/A N/A N/A cls server_behaviors create_active_server config_drive True key_name N/A N/A cls key name personality files metadata N/A cls metadata entity N/A N/A cls user_data_filepath N/A N/A {0}/openstack/latest/user_data format N/A N/A cls config_drive_config base_path_to_mount N/A N/A N/A N/A cls resources add N/A N/A cls server id N/A N/A cls servers_client delete_server N/A classmethod test_create_server_config_drive_openstack_directory N/A N/A self N/A N/A N/A 
        A server with config drive enabled should have 'openstack' directories

        Get a remote instance client for the server created during test set up.
        Mount the config drive on the server. Use the remote client to validate
        that the '/openstack/latest' directory and the /openstack/latest
        directory are at the base path to mount directory set during test
        configuration.

        The following assertions occur:
            - The '/openstack/latest' directory is present in the config drive
            - The '/openstack/content' directory is present in the config drive
         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 N/A N/A N/A self config_drive_behaviors mount_config_drive server N/A self server servers_config N/A self servers_config key N/A N/A self key private_key source_path N/A N/A self config_drive_config mount_source_path destination_path N/A N/A self config_drive_config base_path_to_mount N/A dir_openstack_present N/A N/A remote_client is_directory_present directory_path N/A N/A {0}/openstack/latest format N/A N/A self config_drive_config base_path_to_mount N/A N/A N/A self assertTrue dir_openstack_present msg Directory openstack is present N/A dir_openstack_content_present N/A N/A remote_client is_directory_present directory_path N/A N/A {0}/openstack/content format N/A N/A self config_drive_config base_path_to_mount N/A N/A N/A self assertTrue dir_openstack_content_present msg Directory openstack is present N/A N/A tags type smoke net yes test_create_server_config_drive_ec2_directory N/A N/A self N/A N/A N/A 
        A server with config drive enabled should have ec2 directories

        Get a remote instance client for the server created during test set up.
        Mount the config drive on the server. Use the remote client to validate
        that the '/ec2/latest' directory is at the base path to mount directory
        set during test configuration.

        The following assertions occur:
            - The '/ec2/latest' directory is present in the config drive
         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 N/A N/A N/A self config_drive_behaviors mount_config_drive server N/A self server servers_config N/A self servers_config key N/A N/A self key private_key source_path N/A N/A self config_drive_config mount_source_path destination_path N/A N/A self config_drive_config base_path_to_mount N/A dir_openstack_present N/A N/A remote_client is_directory_present directory_path N/A N/A {0}/ec2/latest format N/A N/A self config_drive_config base_path_to_mount N/A N/A N/A self assertTrue dir_openstack_present msg Directory openstack is present N/A N/A tags type smoke net yes test_create_server_config_drive_user_data_not_present N/A N/A self N/A N/A N/A 
        User data should not be present unless it was set during server creation

        Get a remote instance client for the server created during test set up.
        Mount the config drive on the server. Attempting to use the remote client
        to get the details of the config drive user data should result in a
        'FileNotFound' error.

        The following assertions occur:
            - Attempting to get the file contents of the user data file on
              the server created during set up should raise a 'FileNotFound'
              error
         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 N/A N/A N/A self config_drive_behaviors mount_config_drive server N/A self server servers_config N/A self servers_config key N/A N/A self key private_key source_path N/A N/A self config_drive_config mount_source_path destination_path N/A N/A self config_drive_config base_path_to_mount N/A N/A N/A self assertRaises FileNotFoundException N/A N/A N/A N/A N/A remote_client get_file_details file_path N/A self user_data_filepath content N/A N/A tags type smoke net yes N/A