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)
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)
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)
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)
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)