提交 c52c768e 编写于 作者: M Marbin Tan 提交者: Marbin Tan

gpperfmon: gpperfmon_install should include IPv6 localhost

If IPv6 is enabled, gpperfmon will complain that it can't connect to
the database because, gpmon does not have permission to access through
::1.

- Add behave test
上级 97a6921a
......@@ -166,6 +166,9 @@ if __name__ == '__main__':
cmd = Command("""echo "host all gpmon 127.0.0.1/28 md5" >> %s""" % pg_hba, showOutput=True)
commands.append(cmd)
cmd = Command("""echo "host all gpmon ::1/128 md5" >> %s""" % pg_hba, showOutput=True)
commands.append(cmd)
################################################
# these commands add a new line to the top of .pgpass and save a copy of old .pgpass
cmd = Command("""touch %s""" % (pg_pass))
......
......@@ -17,7 +17,8 @@ Feature: gpperfmon
Given the database "gpperfmon" does not exist
When the user runs "gpperfmon_install --port 15432 --enable --password foo"
Then gpperfmon_install should return a return code of 0
Then verify that the last line of the master postgres configuration file contains the string "gpperfmon_log_alert_level=warning"
Then verify that the last line of the file "postgresql.conf" in the master data directory contains the string "gpperfmon_log_alert_level=warning"
Then verify that the last line of the file "pg_hba.conf" in the master data directory contains the string "host all gpmon ::1/128 md5"
And verify that there is a "heap" table "database_history" in "gpperfmon"
@gpperfmon_run
......
......@@ -4213,11 +4213,11 @@ def impl(context, filename, output):
check_stdout_msg(context, output)
@then('verify that the last line of the master postgres configuration file contains the string "{output}"')
def impl(context, output):
@then('verify that the last line of the file "{filename}" in the master data directory contains the string "{output}"')
def impl(context, filename, output):
contents = ''
filename = master_data_dir + "/postgresql.conf"
with open(filename) as fr:
file_path = os.path.join(master_data_dir, filename)
with open(file_path) as fr:
for line in fr:
contents = line.strip()
pat = re.compile(output)
......@@ -4883,7 +4883,7 @@ def impl(context):
When the user runs "gpstart -a"
Then gpstart should return a return code of 0
And verify that a role "gpmon" exists in database "gpperfmon"
And verify that the last line of the master postgres configuration file contains the string "gpperfmon_log_alert_level=warning"
And verify that the last line of the file "postgresql.conf" in the master data directory contains the string "gpperfmon_log_alert_level=warning"
And verify that there is a "heap" table "database_history" in "gpperfmon"
Then wait until the process "gpmmon" is up
And wait until the process "gpsmon" is up
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册