提交 7b3634d0 编写于 作者: G Goutam Tadi 提交者: Goutam Tadi

gpinitsystem: Add new test for standby with FQDN_HBA

[#159742200]
Co-authored-by: NXin Zhang <xzhang@pivotal.io>
Co-authored-by: NGoutam Tadi <gtadi@pivotal.io>
Co-authored-by: NFei Yang <fyang@pivotal.io>
上级 cadd7ea4
......@@ -113,22 +113,34 @@ Feature: gpinitsystem tests
@gpinitsystem_fqdn_hba_on
Scenario: gpinitsystem should print FQDN in pg_hba.conf when FQDN_HBA=1
Given the cluster config is generated with FQDN_HBA "1"
When the user runs command "gpinitsystem -a -c ../gpAux/gpdemo/clusterConfigFile -O /tmp/output_config_file"
Then gpinitsystem should return a return code of 0
And verify that the file "/tmp/output_config_file" contains "FQDN_HBA=1"
When the user runs "gpinitsystem -a -I /tmp/output_config_file -l /tmp/"
Then gpinitsystem should return a return code of 0
And verify that the file "../gpAux/gpdemo/datadirs/qddir/demoDataDir-1/pg_hba.conf" contains FQDN only for trusted host
When generate cluster config file "/tmp/output_config_file"
Then verify that the file "/tmp/output_config_file" contains "FQDN_HBA=1"
When initialize a cluster using "/tmp/output_config_file"
Then verify that the file "../gpAux/gpdemo/datadirs/qddir/demoDataDir-1/pg_hba.conf" contains FQDN only for trusted host
And verify that the file "../gpAux/gpdemo/datadirs/dbfast1/demoDataDir0/pg_hba.conf" contains FQDN only for trusted host
@gpinitsystem_fqdn_hba
@gpinitsystem_fqdn_hba_off
Scenario: gpinitsystem should print CIDR in pg_hba.conf when FQDN_HBA=0
Given the cluster config is generated with FQDN_HBA "0"
When the user runs command "gpinitsystem -a -c ../gpAux/gpdemo/clusterConfigFile -O /tmp/output_config_file"
Then gpinitsystem should return a return code of 0
And verify that the file "/tmp/output_config_file" contains "FQDN_HBA=0"
When the user runs "gpinitsystem -a -I /tmp/output_config_file -l /tmp/"
Then gpinitsystem should return a return code of 0
And verify that the file "../gpAux/gpdemo/datadirs/qddir/demoDataDir-1/pg_hba.conf" contains CIDR only for trusted host
When generate cluster config file "/tmp/output_config_file"
Then verify that the file "/tmp/output_config_file" contains "FQDN_HBA=0"
When initialize a cluster using "/tmp/output_config_file"
Then verify that the file "../gpAux/gpdemo/datadirs/qddir/demoDataDir-1/pg_hba.conf" contains CIDR only for trusted host
And verify that the file "../gpAux/gpdemo/datadirs/dbfast1/demoDataDir0/pg_hba.conf" contains CIDR only for trusted host
@gpinitsystem_fqdn_hba
@gpinitsystem_fqdn_hba_on_with_standby
Scenario: gpinitsystem should print FQDN in pg_hba.conf for standby when FQDN_HBA=1
Given the database is running
And all the segments are running
And the segments are synchronized
And the standby is not initialized
And ensure the standby directory does not exist
And the cluster config is generated with FQDN_HBA "1"
When generate cluster config file "/tmp/output_config_file"
Then verify that the file "/tmp/output_config_file" contains "FQDN_HBA=1"
When initialize a cluster with standby using "/tmp/output_config_file"
Then verify that the file "../gpAux/gpdemo/datadirs/qddir/demoDataDir-1/pg_hba.conf" contains FQDN only for trusted host
And verify that the file "../gpAux/gpdemo/datadirs/dbfast1/demoDataDir0/pg_hba.conf" contains FQDN only for trusted host
And verify that the file "../gpAux/gpdemo/datadirs/qddir/demoDataDir-1/newstandby/pg_hba.conf" contains FQDN only for trusted host
......@@ -2228,3 +2228,23 @@ def step_impl(context, options):
raise Exception("gpstate -m output missing expected mirror info, datadir %s port %d" %(datadir, port))
else:
raise Exception("no verification for gpstate option given")
@given('ensure the standby directory does not exist')
def impl(context):
run_command(context, 'rm -rf $MASTER_DATA_DIRECTORY/newstandby')
run_command(context, 'rm -rf /tmp/gpinitsystemtest && mkdir /tmp/gpinitsystemtest')
@when('initialize a cluster with standby using "{config_file}"')
def impl(context, config_file):
run_gpcommand(context, 'gpinitsystem -a -I %s -l /tmp/ -s localhost -P 21100 -F pg_system:$MASTER_DATA_DIRECTORY/newstandby -h ../gpAux/gpdemo/hostfile' % config_file)
check_return_code(context, 0)
@when('initialize a cluster using "{config_file}"')
def impl(context, config_file):
run_gpcommand(context, 'gpinitsystem -a -I %s -l /tmp/' % config_file)
check_return_code(context, 0)
@when('generate cluster config file "{config_file}"')
def impl(context, config_file):
run_gpcommand(context, 'gpinitsystem -a -c ../gpAux/gpdemo/clusterConfigFile -O %s' % config_file)
check_return_code(context, 0)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册