These should be expanded, but are better than nothing.
REGRESSCHECKS= \
init \
+ preseed \
$(REGRESSINIT) \
+ preseed_check \
supervisordb \
upgrade \
identifier \
include = 'bdr_regress_common.conf'
+bdrtest.origdb = 'postgres'
bdrtest.readdb1 = 'regression'
bdrtest.readdb2 = 'postgres'
bdrtest.writedb1 = 'regression'
bdr.node1_dsn = 'dbname=regression'
bdr.node1_local_dbname = 'postgres'
+bdrtest.origdb = 'regression'
bdrtest.readdb1 = 'postgres'
bdrtest.readdb2 = 'postgres'
bdrtest.writedb1 = 'regression'
--- /dev/null
+/*
+ * Tests to ensure that objects/data that exists pre-clone is successfully
+ * cloned. The results are checked, after the clone, in preseed_check.sql.
+ */
+-- Unfortunately the cloned DB currently isn't the same between bdr and udr
+SELECT current_setting('bdrtest.origdb') AS origdb
+\gset
+\c :origdb
+DO $DO$BEGIN
+IF bdr.bdr_variant() = 'BDR' THEN
+ SET default_sequenceam = local;
+END IF;
+END; $DO$;
+CREATE SEQUENCE some_local_seq;
+CREATE TABLE some_local_tbl(id serial primary key, key text unique not null, data text);
+INSERT INTO some_local_tbl(key, data) VALUES('key1', 'data1');
+INSERT INTO some_local_tbl(key, data) VALUES('key2', NULL);
+INSERT INTO some_local_tbl(key, data) VALUES('key3', 'data3');
--- /dev/null
+-- Verify data from preseed.sql has correctly been cloned
+\c regression
+\d some_local_tbl
+ Table "public.some_local_tbl"
+ Column | Type | Modifiers
+--------+---------+-------------------------------------------------------------
+ id | integer | not null default nextval('some_local_tbl_id_seq'::regclass)
+ key | text | not null
+ data | text |
+Indexes:
+ "some_local_tbl_pkey" PRIMARY KEY, btree (id)
+ "some_local_tbl_key_key" UNIQUE CONSTRAINT, btree (key)
+Triggers:
+ truncate_trigger AFTER TRUNCATE ON some_local_tbl FOR EACH STATEMENT EXECUTE PROCEDURE bdr.queue_truncate()
+
+SELECT * FROM some_local_tbl ORDER BY id;
+ id | key | data
+----+------+-------
+ 1 | key1 | data1
+ 2 | key2 |
+ 3 | key3 | data3
+(3 rows)
+
+\c postgres
+\d some_local_tbl
+ Table "public.some_local_tbl"
+ Column | Type | Modifiers
+--------+---------+-------------------------------------------------------------
+ id | integer | not null default nextval('some_local_tbl_id_seq'::regclass)
+ key | text | not null
+ data | text |
+Indexes:
+ "some_local_tbl_pkey" PRIMARY KEY, btree (id)
+ "some_local_tbl_key_key" UNIQUE CONSTRAINT, btree (key)
+Triggers:
+ truncate_trigger AFTER TRUNCATE ON some_local_tbl FOR EACH STATEMENT EXECUTE PROCEDURE bdr.queue_truncate()
+
+SELECT * FROM some_local_tbl ORDER BY id;
+ id | key | data
+----+------+-------
+ 1 | key1 | data1
+ 2 | key2 |
+ 3 | key3 | data3
+(3 rows)
+
--- /dev/null
+/*
+ * Tests to ensure that objects/data that exists pre-clone is successfully
+ * cloned. The results are checked, after the clone, in preseed_check.sql.
+ */
+
+-- Unfortunately the cloned DB currently isn't the same between bdr and udr
+SELECT current_setting('bdrtest.origdb') AS origdb
+\gset
+\c :origdb
+
+DO $DO$BEGIN
+IF bdr.bdr_variant() = 'BDR' THEN
+ SET default_sequenceam = local;
+END IF;
+END; $DO$;
+
+CREATE SEQUENCE some_local_seq;
+CREATE TABLE some_local_tbl(id serial primary key, key text unique not null, data text);
+INSERT INTO some_local_tbl(key, data) VALUES('key1', 'data1');
+INSERT INTO some_local_tbl(key, data) VALUES('key2', NULL);
+INSERT INTO some_local_tbl(key, data) VALUES('key3', 'data3');
--- /dev/null
+-- Verify data from preseed.sql has correctly been cloned
+\c regression
+\d some_local_tbl
+SELECT * FROM some_local_tbl ORDER BY id;
+
+\c postgres
+\d some_local_tbl
+SELECT * FROM some_local_tbl ORDER BY id;