提交 aa758051 编写于 作者: K Kalen Krempely 提交者: Kalen Krempely

gpactivatestandby: add tablespace test

Co-authored-by: NJacob Champion <pchampion@pivotal.io>
上级 a6bb6e3e
......@@ -60,3 +60,17 @@ Feature: gpactivatestandby
Then the user runs command "gpstate -m" from standby master
And verify gpstate with options "-m" output is correct
And clean up and revert back to original master
Scenario: tablespaces work
Given the database is running
And the standby is not initialized
And a tablespace is created with data
When the user runs gpinitstandby with options " "
Then gpinitstandby should return a return code of 0
And verify the standby master entries in catalog
When the master goes down
And the user runs gpactivatestandby with options " "
Then gpactivatestandby should return a return code of 0
And verify the standby master is now acting as master
And the tablespace is valid on the standby master
And clean up and revert back to original master
......@@ -42,13 +42,14 @@ class Tablespace:
shutil.rmtree(self.path)
def verify(self):
def verify(self, hostname=None, port=0):
"""
Verify tablespace functionality by ensuring the tablespace can be
written to, read from, and the initial data is still correctly
distributed.
"""
with dbconn.connect(dbconn.DbURL(dbname=self.dbname)) as conn:
url = dbconn.DbURL(hostname=hostname, port=port, dbname=self.dbname)
with dbconn.connect(url) as conn:
db = pg.DB(conn)
data = db.query("SELECT gp_segment_id, i FROM tbl").getresult()
......@@ -154,6 +155,11 @@ def impl(context):
context.tablespaces["outerspace"].verify()
@then('the tablespace is valid on the standby master')
def impl(context):
context.tablespaces["outerspace"].verify(context.standby_hostname, context.standby_port)
@then('the other tablespace is valid')
def impl(context):
context.tablespaces["myspace"].verify()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册