提交 4d06873f 编写于 作者: J Jacob Champion 提交者: Mark Sliva

gpconfig: consolidate test cases

There are no "edge cases". This change requires us to correctly escape
the search pattern for all cases, which is desirable anyway.
Co-authored-by: NMark Sliva <msliva@pivotal.io>
上级 9f5b4005
...@@ -21,32 +21,32 @@ Feature: gpconfig integration tests ...@@ -21,32 +21,32 @@ Feature: gpconfig integration tests
# set same value on master and segments # set same value on master and segments
When the user runs "gpconfig -c <guc> -v <value>" When the user runs "gpconfig -c <guc> -v <value>"
Then gpconfig should return a return code of 0 Then gpconfig should return a return code of 0
And verify that the last line of the file "postgresql.conf" in the master data directory contains the string "<guc>=<file_value>" And verify that the last line of the file "postgresql.conf" in the master data directory contains the string "<guc>=<file_value>" escaped
And verify that the last line of the file "postgresql.conf" in each segment data directory contains the string "<guc>=<file_value>" And verify that the last line of the file "postgresql.conf" in each segment data directory contains the string "<guc>=<file_value>"
# set value on master only, leaving segments the same # set value on master only, leaving segments the same
When the user runs "gpconfig -c <guc> -v <value_master_only> --masteronly " When the user runs "gpconfig -c <guc> -v <value_master_only> --masteronly "
Then gpconfig should return a return code of 0 Then gpconfig should return a return code of 0
And verify that the last line of the file "postgresql.conf" in the master data directory contains the string "<guc>=<file_value_master_only>" And verify that the last line of the file "postgresql.conf" in the master data directory contains the string "<guc>=<file_value_master_only>" escaped
And verify that the last line of the file "postgresql.conf" in each segment data directory contains the string "<guc>=<file_value>" And verify that the last line of the file "postgresql.conf" in each segment data directory contains the string "<guc>=<file_value>"
# set value on master with a different value from the segments # set value on master with a different value from the segments
When the user runs "gpconfig -c <guc> -v <value> -m <value_master>" When the user runs "gpconfig -c <guc> -v <value> -m <value_master>"
Then gpconfig should return a return code of 0 Then gpconfig should return a return code of 0
And verify that the last line of the file "postgresql.conf" in the master data directory contains the string "<guc>=<file_value_master>" And verify that the last line of the file "postgresql.conf" in the master data directory contains the string "<guc>=<file_value_master>" escaped
And verify that the last line of the file "postgresql.conf" in each segment data directory contains the string "<guc>=<file_value>" And verify that the last line of the file "postgresql.conf" in each segment data directory contains the string "<guc>=<file_value>"
# now make sure the last changes took full effect as seen by gpconfig # now make sure the last changes took full effect as seen by gpconfig
When the user runs "gpconfig -s <guc> --file" When the user runs "gpconfig -s <guc> --file"
Then gpconfig should return a return code of 0 Then gpconfig should return a return code of 0
And gpconfig should print "Master[\s]*value: <file_value_master>" to stdout And gpconfig should print "Master value: <file_value_master>" escaped to stdout
And gpconfig should print "Segment[\s]*value: <file_value>" to stdout And gpconfig should print "Segment value: <file_value>" escaped to stdout
When the user runs "gpconfig -s <guc> --file-compare" When the user runs "gpconfig -s <guc> --file-compare"
Then gpconfig should return a return code of 0 Then gpconfig should return a return code of 0
And gpconfig should print "GUCS ARE OUT OF SYNC" to stdout And gpconfig should print "GUCS ARE OUT OF SYNC" to stdout
And gpconfig should print "value: <seed_value> \| file: <file_value_master>" to stdout And gpconfig should print "value: <seed_value> | file: <file_value_master>" escaped to stdout
And gpconfig should print "value: <seed_value> \| file: <file_value>" to stdout And gpconfig should print "value: <seed_value> | file: <file_value>" escaped to stdout
When the user runs "gpstop -ar" When the user runs "gpstop -ar"
Then gpstop should return a return code of 0 Then gpstop should return a return code of 0
...@@ -60,8 +60,8 @@ Feature: gpconfig integration tests ...@@ -60,8 +60,8 @@ Feature: gpconfig integration tests
When the user runs "gpconfig -s <guc>" When the user runs "gpconfig -s <guc>"
Then gpconfig should return a return code of 0 Then gpconfig should return a return code of 0
And gpconfig should print "Master[\s]*value: <live_value_master>" to stdout And gpconfig should print "Master value: <live_value_master>" escaped to stdout
And gpconfig should print "Segment[\s]*value: <live_value>" to stdout And gpconfig should print "Segment value: <live_value>" escaped to stdout
# test for each type documented for gpconfig # test for each type documented for gpconfig
Examples: Examples:
...@@ -73,41 +73,7 @@ Feature: gpconfig integration tests ...@@ -73,41 +73,7 @@ Feature: gpconfig integration tests
| application_name | string | xxxxxx | bodhi | 'bodhi' | bodhi | lucy | 'lucy' | bengie | 'bengie' | bengie | | application_name | string | xxxxxx | bodhi | 'bodhi' | bodhi | lucy | 'lucy' | bengie | 'bengie' | bengie |
| application_name | string | yyyyyy | 'bod hi' | 'bod hi' | bod hi | 'lu cy' | 'lu cy' | 'ben gie' | 'ben gie' | ben gie | | application_name | string | yyyyyy | 'bod hi' | 'bod hi' | bod hi | 'lu cy' | 'lu cy' | 'ben gie' | 'ben gie' | ben gie |
| application_name | string | zzzzzz | '' | '' | | '' | '' | '' | '' | | | application_name | string | zzzzzz | '' | '' | | '' | '' | '' | '' | |
| application_name | string | boo | "'\''" | '\\''' | \' | "'\''" | '\\''' | "'\''" | '\\''' | \' |
@concourse_cluster
@demo_cluster
Scenario Outline: gpconfig edge cases for type: <type>
Given the user runs "gpstop -ar"
And gpstop should return a return code of 0
And the gpconfig context is setup
And the user runs "gpconfig -c <guc> -v <seed_value>"
And gpconfig should return a return code of 0
# set same value on master and segments
When the user runs "gpconfig -c <guc> -v <value>"
Then gpconfig should return a return code of 0
And verify that the last line of the file "postgresql.conf" in the master data directory contains the string "<guc>=<file_value>" escaped
And verify that the last line of the file "postgresql.conf" in each segment data directory contains the string "<guc>=<file_value>"
# now make sure the last changes took full effect as seen by gpconfig
When the user runs "gpconfig -s <guc> --file"
Then gpconfig should return a return code of 0
And gpconfig should print "Master value: <file_value>" escaped to stdout
And gpconfig should print "Segment value: <file_value>" escaped to stdout
When the user runs "gpstop -ar"
And gpstop should return a return code of 0
When the user runs "gpconfig -s <guc>"
Then gpconfig should return a return code of 0
And gpconfig should print "Master value: <live_value>" escaped to stdout
And gpconfig should print "Segment value: <live_value>" escaped to stdout
# NOTE: <value> is a command-line value
Examples:
| guc | type | seed_value | value | file_value | live_value |
| application_name | string | boo | "'\''" | '\\''' | \' |
#| application_name | string | boo | 'C:\\home\\fun' | 'C:\\home\\fun' | 'C:\\home\\fun' |
@concourse_cluster @concourse_cluster
@demo_cluster @demo_cluster
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册