Add test for pgxc_ctl minimal config
authorPallavi Sontakke <[email protected]>
Wed, 30 Mar 2016 07:04:11 +0000 (12:34 +0530)
committerPallavi Sontakke <[email protected]>
Wed, 30 Mar 2016 07:04:11 +0000 (12:34 +0530)
Add some more cleanup to TAP tests.

contrib/pgxc_ctl/t/005_pgxc_ctl_minimal.pl [new file with mode: 0755]
contrib/pgxc_ctl/t/010_pgxc_ctl.pl

diff --git a/contrib/pgxc_ctl/t/005_pgxc_ctl_minimal.pl b/contrib/pgxc_ctl/t/005_pgxc_ctl_minimal.pl
new file mode 100755 (executable)
index 0000000..fc0804c
--- /dev/null
@@ -0,0 +1,31 @@
+use strict;
+use warnings;
+use Cwd;
+use Config;
+use TestLib;
+use Test::More tests => 6;
+
+program_help_ok('pgxc_ctl');
+program_version_ok('pgxc_ctl');
+
+my $dataDirRoot="~/DATA/pgxl/nodes/";
+my $pgxcCtlRoot="~/pgxc_ctl/";
+
+
+system_or_bail 'pgxc_ctl', 'clean', 'all' ;
+#delete related dirs for cleanup
+my $result = system("rm -rf $dataDirRoot");
+my $result = system("rm -rf $pgxcCtlRoot");
+
+system_or_bail 'pgxc_ctl', 'prepare', 'minimal' ;
+
+system_or_bail 'pgxc_ctl', 'init', 'all' ;
+
+system_or_bail 'pgxc_ctl', 'monitor', 'all' ;
+
+#add cleanup
+system_or_bail 'pgxc_ctl', 'clean', 'all' ;
+
+#delete related dirs for cleanup
+my $result = system("rm -rf $dataDirRoot");
+my $result = system("rm -rf $pgxcCtlRoot");
index de186759c38e95720e8eae0886a69229a6bac95b..ebdaa2af2bb3dbd5e669c9ff269fcd99d7785431 100755 (executable)
@@ -16,6 +16,12 @@ my $DN1_HOST = "localhost";
 my $DN2_HOST = "localhost";
 my $DN3_HOST = "localhost";
 my $dataDirRoot="~/DATA/pgxl/nodes";
+my $pgxcCtlRoot="~/pgxc_ctl/";
+
+system_or_bail 'pgxc_ctl', 'clean', 'all' ;
+#delete related dirs for cleanup
+my $result = system("rm -rf $dataDirRoot");
+my $result = system("rm -rf $pgxcCtlRoot");
 
 system_or_bail 'pgxc_ctl', 'prepare', 'config', 'empty' ;
 
@@ -58,3 +64,6 @@ system_or_bail 'pgxc_ctl', 'monitor', 'all' ;
 system_or_bail 'pgxc_ctl', 'clean', 'all' ;
 
 
+#delete related dirs for cleanup
+my $result = system("rm -rf $dataDirRoot");
+my $result = system("rm -rf $pgxcCtlRoot");