From fa41461205ae4eb417045825583c3209e5a4f339 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 26 Sep 2017 16:41:20 -0400 Subject: [PATCH] Add some more pg_receivewal tests Add some more tests for the --create-slot and --drop-slot options, verifying that the right kind of slot was created and that the slot was dropped. While working on an unrelated patch for pg_basebackup, some of this was temporarily broken without any tests noticing. --- src/bin/pg_basebackup/t/020_pg_receivewal.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/pg_basebackup/t/020_pg_receivewal.pl b/src/bin/pg_basebackup/t/020_pg_receivewal.pl index 101a36466d..f9f7bf75ab 100644 --- a/src/bin/pg_basebackup/t/020_pg_receivewal.pl +++ b/src/bin/pg_basebackup/t/020_pg_receivewal.pl @@ -2,7 +2,7 @@ use strict; use warnings; use TestLib; use PostgresNode; -use Test::More tests => 14; +use Test::More tests => 17; program_help_ok('pg_receivewal'); program_version_ok('pg_receivewal'); @@ -30,8 +30,12 @@ my $slot_name = 'test'; $primary->command_ok( [ 'pg_receivewal', '--slot', $slot_name, '--create-slot' ], 'creating a replication slot'); +my $slot = $primary->slot($slot_name); +is($slot->{'slot_type'}, 'physical', 'physical replication slot was created'); +is($slot->{'restart_lsn'}, '', 'restart LSN of new slot is null'); $primary->command_ok([ 'pg_receivewal', '--slot', $slot_name, '--drop-slot' ], 'dropping a replication slot'); +is($primary->slot($slot_name)->{'slot_type'}, '', 'replication slot was removed'); # Generate some WAL. Use --synchronous at the same time to add more # code coverage. Switch to the next segment first so that subsequent -- 2.49.0