Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fa41461

Browse files
committed
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.
1 parent 43588f5 commit fa41461

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/bin/pg_basebackup/t/020_pg_receivewal.pl

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use warnings;
33
use TestLib;
44
use PostgresNode;
5-
use Test::More tests => 14;
5+
use Test::More tests => 17;
66

77
program_help_ok('pg_receivewal');
88
program_version_ok('pg_receivewal');
@@ -30,8 +30,12 @@
3030
$primary->command_ok(
3131
[ 'pg_receivewal', '--slot', $slot_name, '--create-slot' ],
3232
'creating a replication slot');
33+
my $slot = $primary->slot($slot_name);
34+
is($slot->{'slot_type'}, 'physical', 'physical replication slot was created');
35+
is($slot->{'restart_lsn'}, '', 'restart LSN of new slot is null');
3336
$primary->command_ok([ 'pg_receivewal', '--slot', $slot_name, '--drop-slot' ],
3437
'dropping a replication slot');
38+
is($primary->slot($slot_name)->{'slot_type'}, '', 'replication slot was removed');
3539

3640
# Generate some WAL. Use --synchronous at the same time to add more
3741
# code coverage. Switch to the next segment first so that subsequent

0 commit comments

Comments
 (0)