예제 #1
0
def test_replica1_storage_pvc():
    content = {
        "metadata": {
            "name": STORAGE_POOL_NAME
        },
        "spec": {
            "type": REPLICA_1,
            "storage": [{
                "pvc": PVC_1
            }]
        }
    }
    assert (to_storage_yaml(content) == REPLICA1_PVC_OUTPUT)
예제 #2
0
def test_replica1_storage_device():
    content = {
        "metadata": {
            "name": STORAGE_POOL_NAME
        },
        "spec": {
            "type": REPLICA_1,
            "storage": [{
                "node": NODE_1,
                "device": DEVICE_1
            }]
        }
    }
    assert (to_storage_yaml(content) == REPLICA1_DEVICE_OUTPUT)
예제 #3
0
def test_replica1_storage_path():
    content = {
        "metadata": {
            "name": STORAGE_POOL_NAME
        },
        "spec": {
            "type": REPLICA_1,
            "storage": [{
                "node": NODE_1,
                "path": PATH_1
            }]
        }
    }
    assert (to_storage_yaml(content) == REPLICA1_PATH_OUTPUT)
예제 #4
0
def test_external_storage():
    content = {
        "metadata": {
            "name": STORAGE_POOL_NAME
        },
        "spec": {
            "type": EXTERNAL,
            "details": {
                "gluster_hosts": EXTERNAL_HOSTS,
                "gluster_volname": EXTERNAL_VOLNAME,
                "gluster_options": EXTERNAL_OPTIONS
            }
        }
    }
    assert (to_storage_yaml(content) == EXTERNAL_OUTPUT)
예제 #5
0
def test_replica2_storage_pvc():
    content = {
        "metadata": {
            "name": STORAGE_POOL_NAME
        },
        "spec": {
            "type": REPLICA_2,
            "storage": [{
                "pvc": PVC_1
            }, {
                "pvc": PVC_2
            }],
            "tiebreaker": {
                "node": "tie-breaker.kadalu.io",
                "port": 24007,
                "path": "/mnt"
            }
        }
    }
    assert (to_storage_yaml(content) == REPLICA2_PVC_OUTPUT)