import uuid


def setup(pod_obj, bucket_factory):
    """
    Setup function

     Args:
        pod_obj (Pod): A pod running the AWS CLI tools
        bucket_factory: Calling this fixture creates a new bucket(s)

    Returns:
        Tuple: Returns tuple containing the params used in this test case

    """
    bucket = bucket_factory(amount=1, interface='OC')[0].name
    object_key = "ObjKey-" + str(uuid.uuid4().hex)
    origin_dir = "/aws/objectdir"
    res_dir = "/aws/partsdir"
    full_object_path = f"s3://{bucket}"
    # Creates a 500MB file and splits it into multiple parts
    pod_obj.exec_cmd_on_pod(
        f'sh -c "mkdir {origin_dir}; mkdir {res_dir}; '
        f'dd if=/dev/urandom of={origin_dir}/{object_key} bs=1MB count=500; '
        f'split -a 1 -b 41m {origin_dir}/{object_key} {res_dir}/part"'
    )
    parts = pod_obj.exec_cmd_on_pod(f'sh -c "ls -1 {res_dir}"').split()
    return bucket, object_key, origin_dir, res_dir, full_object_path, parts