add failure test

This commit is contained in:
Nim Wijetunga 2023-02-24 15:42:29 -08:00
parent c8b7cff10c
commit 836ec1a908
1 changed files with 7 additions and 0 deletions

View File

@ -64,6 +64,13 @@ def get_cluster_connection_str(cluster_file_path):
@enable_logging() @enable_logging()
def metacluster_create(logger, cluster_file, name, tenant_id_prefix): def metacluster_create(logger, cluster_file, name, tenant_id_prefix):
# creating a metacluster with optional tenant mode should fail
rc, out, err = run_fdbcli_command(cluster_file, "configure tenant_mode=optional_experimental")
if rc != 0:
raise Exception(err)
rc, out, err = run_fdbcli_command(cluster_file, "metacluster create_experimental", name, str(tenant_id_prefix))
if "ERROR" not in out:
raise Exception("Metacluster creation should have failed")
# set the tenant mode to disabled for the metacluster otherwise creation will fail # set the tenant mode to disabled for the metacluster otherwise creation will fail
rc, out, err = run_fdbcli_command(cluster_file, "configure tenant_mode=disabled") rc, out, err = run_fdbcli_command(cluster_file, "configure tenant_mode=disabled")
logger.debug('Metacluster tenant mode set to disabled') logger.debug('Metacluster tenant mode set to disabled')