Skip to content

Commit

Permalink
Add gpcrondump behave test for -t and --table-file to ignore pg_temp_%
Browse files Browse the repository at this point in the history
* We should ignore pg_temp_% during backup even if the user specifies
  the table. There is a potential error if we try to backup pg_temp_%,
  so we will prevent it.
  • Loading branch information
Chibin committed Jul 28, 2016
1 parent 8d26668 commit 28bff27
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions gpMgmt/bin/gppylib/test/behave/mgmt_utils/backup.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3514,6 +3514,28 @@ Feature: Validate command line arguments
And verify that the "dump" file in " " dir does not contain "pg_temp"
And the user runs command "dropdb bkdb"
@ignore_pg_temp
Scenario: pg_temp should be ignored from gpcrondump --table_file option and -t option when given
Given the test is initialized
And there is a "ao" table "public.foo4" in "bkdb" with data
# NOTE: pg_temp does not exist in the database at all. We are just valiating that we can still
# do a backup given that the user tries to backup a temporary table
# --table-file option ignore pg_temp
And there is a table-file "/tmp/table_file_foo4" with tables "public.foo4, pg_temp_1337.foo4"
When the user runs "gpcrondump -a --table-file /tmp/table_file_foo4 -x bkdb"
Then gpcrondump should return a return code of 0
And the timestamp from gpcrondump is stored
When the user runs gpdbrestore with the stored timestamp
Then gpdbrestore should return a return code of 0
And verify that there are "2190" tuples in "bkdb" for table "public.foo4"
# -t option ignore pg_temp
When the user runs "gpcrondump -a -t public.foo4 -t pg_temp_1337.foo4 -x bkdb"
Then gpcrondump should return a return code of 0
And the timestamp from gpcrondump is stored
When the user runs gpdbrestore with the stored timestamp
Then gpdbrestore should return a return code of 0
And verify that there are "2190" tuples in "bkdb" for table "public.foo4"
# THIS SHOULD BE THE LAST TEST
@backupfire
Expand Down

0 comments on commit 28bff27

Please sign in to comment.