|
10 | 10 | use Fcntl qw(:seek);
|
11 | 11 | use PostgreSQL::Test::Cluster;
|
12 | 12 | use PostgreSQL::Test::Utils;
|
13 |
| -use Test::More tests => 113; |
| 13 | +use Test::More tests => 115; |
14 | 14 |
|
15 | 15 | program_help_ok('pg_basebackup');
|
16 | 16 | program_version_ok('pg_basebackup');
|
|
630 | 630 | # Check ZLIB compression if available.
|
631 | 631 | SKIP:
|
632 | 632 | {
|
633 |
| - skip "postgres was not built with ZLIB support", 3 |
| 633 | + skip "postgres was not built with ZLIB support", 5 |
634 | 634 | if (!check_pg_config("#define HAVE_LIBZ 1"));
|
635 | 635 |
|
636 | 636 | $node->command_ok(
|
|
641 | 641 | '--format', 't'
|
642 | 642 | ],
|
643 | 643 | 'pg_basebackup with --compress');
|
| 644 | + $node->command_ok( |
| 645 | + [ |
| 646 | + 'pg_basebackup', '-D', |
| 647 | + "$tempdir/backup_gzip2", '--gzip', |
| 648 | + '--no-sync', '--format', |
| 649 | + 't' |
| 650 | + ], |
| 651 | + 'pg_basebackup with --gzip'); |
644 | 652 |
|
645 | 653 | # Verify that the stored files are generated with their expected
|
646 | 654 | # names.
|
647 | 655 | my @zlib_files = glob "$tempdir/backup_gzip/*.tar.gz";
|
648 | 656 | is(scalar(@zlib_files), 2,
|
649 |
| - "two files created with gzip (base.tar.gz and pg_wal.tar.gz)"); |
| 657 | + "two files created with --compress (base.tar.gz and pg_wal.tar.gz)"); |
| 658 | + my @zlib_files2 = glob "$tempdir/backup_gzip2/*.tar.gz"; |
| 659 | + is(scalar(@zlib_files2), 2, |
| 660 | + "two files created with --gzip (base.tar.gz and pg_wal.tar.gz)"); |
650 | 661 |
|
651 | 662 | # Check the integrity of the files generated.
|
652 | 663 | my $gzip = $ENV{GZIP_PROGRAM};
|
|
655 | 666 | || $gzip eq ''
|
656 | 667 | || system_log($gzip, '--version') != 0);
|
657 | 668 |
|
658 |
| - my $gzip_is_valid = system_log($gzip, '--test', @zlib_files); |
| 669 | + my $gzip_is_valid = |
| 670 | + system_log($gzip, '--test', @zlib_files, @zlib_files2); |
659 | 671 | is($gzip_is_valid, 0, "gzip verified the integrity of compressed data");
|
660 | 672 | rmtree("$tempdir/backup_gzip");
|
| 673 | + rmtree("$tempdir/backup_gzip2"); |
661 | 674 | }
|
0 commit comments