Beispiel #1
0
def init(create_pool_disk_images):
    # Shorten the reconcile periods and cache period to speed up the tests.
    Deployer.start_with_args(
        [
            "-j",
            "-m=2",
            "-w=10s",
            "--reconcile-idle-period=500ms",
            "--reconcile-period=500ms",
            "--cache-period=1s",
        ]
    )

    # Create pools
    ApiClient.pools_api().put_node_pool(
        MAYASTOR_1,
        POOL1_UUID,
        CreatePoolBody(["aio:///host/tmp/{}".format(POOL_DISK1)]),
    )
    ApiClient.pools_api().put_node_pool(
        MAYASTOR_2,
        POOL2_UUID,
        CreatePoolBody(["aio:///host/tmp/{}".format(POOL_DISK2)]),
    )

    # Create and publish a volume on node 1
    request = CreateVolumeBody(VolumePolicy(False), NUM_VOLUME_REPLICAS, VOLUME_SIZE)
    ApiClient.volumes_api().put_volume(VOLUME_UUID, request)
    ApiClient.volumes_api().put_volume_target(VOLUME_UUID, MAYASTOR_1, Protocol("nvmf"))

    yield
    Deployer.stop()
def init():
    Deployer.start(num_mayastors=NUM_MAYASTORS)
    ApiClient.pools_api().put_node_pool(
        NODE_1_NAME,
        POOL_1_UUID,
        CreatePoolBody(
            ["malloc:///disk?size_mb=50"],
            labels={
                "pool1-specific-key": "pool1-specific-value",
                "openebs.io/created-by": "msp-operator",
            },
        ),
    )
    ApiClient.pools_api().put_node_pool(
        NODE_2_NAME,
        POOL_2_UUID,
        CreatePoolBody(
            ["malloc:///disk?size_mb=50"],
            labels={
                "pool2-specific-key": "pool2-specific-value",
                "openebs.io/created-by": "msp-operator",
            },
        ),
    )
    yield
    Deployer.stop()
def init():
    Deployer.start(1)
    ApiClient.pools_api().put_node_pool(
        NODE_NAME, POOL_UUID, CreatePoolBody(["malloc:///disk?size_mb=50"]))
    ApiClient.volumes_api().put_volume(
        VOLUME_UUID, CreateVolumeBody(VolumePolicy(False), 1, VOLUME_SIZE))
    yield
    Deployer.stop()
def init_parameterised_deployer():
    # Shorten the reconcile periods and cache period to speed up the tests.
    Deployer.start_with_args([
        "-j",
        f"-m={NUM_MAYASTORS}",
        "-w=10s",
        "--reconcile-idle-period=1s",
        "--reconcile-period=1s",
        "--cache-period=1s",
    ])
    init_resources()
    yield
    Deployer.stop()
Beispiel #5
0
def init():
    Deployer.start(2)
    ApiClient.pools_api().put_node_pool(
        NODE1_NAME, POOL1_UUID, CreatePoolBody(["malloc:///disk?size_mb=50"])
    )
    ApiClient.pools_api().put_node_pool(
        NODE2_NAME, POOL2_UUID, CreatePoolBody(["malloc:///disk?size_mb=50"])
    )
    ApiClient.volumes_api().put_volume(
        VOLUME_UUID, CreateVolumeBody(VolumePolicy(False), 2, 10485761)
    )
    yield
    Deployer.stop()
Beispiel #6
0
def background():
    Deployer.start_with_args([
        "-j",
        "-m=3",
        "-w=10s",
        "--cache-period=1s",
        "--mayastor-env=NEXUS_NVMF_ANA_ENABLE=1,NEXUS_NVMF_RESV_ENABLE=1",
        "--agents-env=TEST_NEXUS_NVMF_ANA_ENABLE=1",
    ])
    ApiClient.pools_api().put_node_pool(
        POOL_NODE, POOL_UUID, CreatePoolBody(["malloc:///disk?size_mb=100"]))
    ApiClient.volumes_api().put_volume(
        VOLUME_UUID, CreateVolumeBody(VolumePolicy(False), 1, VOLUME_SIZE))
    volume = ApiClient.volumes_api().put_volume_target(VOLUME_UUID,
                                                       TARGET_NODE_1,
                                                       Protocol("nvmf"))
    yield volume
    Deployer.stop()
def init(create_pool_disk_images):
    # Shorten the reconcile periods and cache period to speed up the tests.
    Deployer.start_with_args([
        "-j",
        "-m=2",
        "-w=10s",
        "--reconcile-idle-period=500ms",
        "--reconcile-period=500ms",
        "--cache-period=1s",
    ])

    # Create pools
    ApiClient.pools_api().put_node_pool(
        MAYASTOR_2,
        POOL2_UUID,
        CreatePoolBody([f"aio:///host/tmp/{POOL_DISK2}"],
                       labels={"node": MAYASTOR_2}),
    )

    yield
    Deployer.stop()
def init():
    Deployer.start(num_mayastors=NUM_MAYASTORS)
    init_resources()
    yield
    Deployer.stop()
Beispiel #9
0
def setup():
    Deployer.start(1)
    subprocess.run(["sudo", "chmod", "go+rw", "/var/tmp/csi.sock"], check=True)
    yield
    Deployer.stop()
def init():
    Deployer.start(1)
    ApiClient.pools_api().put_node_pool(
        NODE_NAME, POOL_UUID, CreatePoolBody(["malloc:///disk?size_mb=50"]))
    yield
    Deployer.stop()