subtest backup-feature-flags

# disabled for tenants as they can't enable/disable backup and restore features

new-cluster name=s1 disable-tenant
----

exec-sql
CREATE DATABASE d;
CREATE TABLE d.t (x INT);
INSERT INTO d.t VALUES (1), (2), (3);
----

# Test running backup when BACKUP feature flag is disabled.
exec-sql
SET CLUSTER SETTING feature.backup.enabled = FALSE;
----

exec-sql
BACKUP INTO 'nodelocal://1/test-root/';
----
pq: feature BACKUP was disabled by the database administrator

# Test running backup when feature flag is enabled.
exec-sql
SET CLUSTER SETTING feature.backup.enabled = TRUE;
----

exec-sql
BACKUP INTO 'nodelocal://1/test-root/';
----

exec-sql
DROP TABLE d.t;
----

# Test running restore when feature flag is disabled.
exec-sql
SET CLUSTER SETTING feature.restore.enabled = FALSE;
----

exec-sql
RESTORE TABLE d.t FROM LATEST IN 'nodelocal://1/test-root/';
----
pq: feature RESTORE was disabled by the database administrator

# Test running restore when feature flag is enabled.
exec-sql
SET CLUSTER SETTING feature.restore.enabled = TRUE;
----

exec-sql
RESTORE TABLE d.t FROM LATEST IN 'nodelocal://1/test-root/';
----

subtest end
