Exemple #1
0
    def test_upload_file_to_folder(self, container, containers_steps_ui):
        """**Scenario:** Verify that one can upload file to folder.

        **Setup:**

        #. Create container using UI

        **Steps:**

        #. Create folder using UI
        #. Upload file to folder
        #. Delete file from folder
        #. Delete folder

        **Teardown:**

        #. Delete container using UI
        """
        with containers_steps_ui.get_container(container.name):
            folder_name = next(utils.generate_ids('folder'))
            containers_steps_ui.create_folder(folder_name)

            with containers_steps_ui.get_folder(folder_name):
                file_path = next(utils.generate_files())
                file_name = containers_steps_ui.upload_file(file_path)
                containers_steps_ui.delete_file(file_name)

            containers_steps_ui.delete_folder(folder_name)
Exemple #2
0
    def test_upload_file_to_container(self, container, containers_steps):
        """Verify that one can upload file to container."""
        with containers_steps.get_container(container.name):
            file_path = next(utils.generate_files())

            file_name = containers_steps.upload_file(file_path)
            containers_steps.delete_file(file_name)
Exemple #3
0
    def test_upload_file_to_folder(self, container, containers_steps):
        """Verify that one can upload file to folder."""
        with containers_steps.get_container(container.name):
            folder_name = next(utils.generate_ids('folder'))
            containers_steps.create_folder(folder_name)

            with containers_steps.get_folder(folder_name):
                file_path = next(utils.generate_files())
                file_name = containers_steps.upload_file(file_path)
                containers_steps.delete_file(file_name)

            containers_steps.delete_folder(folder_name)
Exemple #4
0
def test_upload_big_object(container_steps):
    """**Scenario:** Upload big object to Object Storage.

    **Setup:**

    #. Create container
    #. Create object
    #. Upload big object to container
    #. Check that this object presents into the container

    **Teardown:**

    #. Delete container
    #. Delete object
    """
    content_big_file = next(utils.generate_files(size=10**10))
    container_name, object_name = utils.generate_ids(count=2)
    container_steps.create(name=container_name)
    container_steps.put_object(container_name=container_name,
                               object_name=object_name,
                               content=content_big_file)
    container_steps.check_object_presence(container_name=container_name,
                                          object_name=object_name)
Exemple #5
0
 def test_create_image_from_local_file(self, create_image):
     """Verify that user can create image from local file."""
     image_name = next(utils.generate_ids(length=20))
     image_file = next(utils.generate_files(postfix='.qcow2'))
     create_image(image_name, image_file=image_file)
Exemple #6
0
def test_restart_all_glance_services(cirros_image,
                                     flavor,
                                     keypair,
                                     net_subnet_router,
                                     security_group,
                                     server,
                                     get_ssh_proxy_cmd,
                                     glance_steps,
                                     os_faults_steps,
                                     server_steps):
    """**Scenario:** Check that glance works after restarting services.

    **Setup:**

    #. Create cirros image
    #. Create flavor
    #. Create keypair
    #. Create network with subnet and router
    #. Create security group
    #. Create server_1

    **Steps:**

    #. Check that ping from server_1 to 8.8.8.8 is successful
    #. Create image_1 and check its content
    #. Restart glance services
    #. Wait for glance service availability
    #. Check that image_1 is in images list and its content is expected as well
    #. Create image_2 and check its content
    #. Create server_2 and check ping to 8.8.8.8 from it

    **Teardown:**

    #. Delete images
    #. Delete servers
    #. Delete security group
    #. Delete network, subnet, router
    #. Delete keypair
    #. Delete flavor
    #. Delete cirros image
    """
    proxy_cmd = get_ssh_proxy_cmd(server)
    with server_steps.get_server_ssh(
            server, proxy_cmd=proxy_cmd) as server_ssh:
        server_steps.check_ping_for_ip(config.GOOGLE_DNS_IP, server_ssh,
                                       timeout=config.PING_CALL_TIMEOUT)

    file_path_1 = next(utils.generate_files())
    image_1 = glance_steps.create_images(image_path=file_path_1)[0]
    glance_steps.check_image_data_corresponds_to_source(image_1, file_path_1)

    os_faults_steps.restart_services(config.GLANCE_SERVICES)
    glance_steps.check_glance_service_available()

    glance_steps.check_image_presence(image_1)
    glance_steps.check_image_data_corresponds_to_source(image_1, file_path_1)

    file_path_2 = next(utils.generate_files())
    image_2 = glance_steps.create_images(image_path=file_path_2)[0]
    glance_steps.check_image_data_corresponds_to_source(image_2, file_path_2)

    server_2 = server_steps.create_servers(image=cirros_image,
                                           flavor=flavor,
                                           networks=[net_subnet_router[0]],
                                           keypair=keypair,
                                           security_groups=[security_group],
                                           username=config.CIRROS_USERNAME)[0]
    proxy_cmd = get_ssh_proxy_cmd(server_2)
    with server_steps.get_server_ssh(
            server_2, proxy_cmd=proxy_cmd) as server_ssh:
        server_steps.check_ping_for_ip(config.GOOGLE_DNS_IP, server_ssh,
                                       timeout=config.PING_CALL_TIMEOUT)