def test_gpinitstandby_n_with_standby_stop(self): pgutil.clean_dir(self.host,self.standby_loc) self.gp.run(option = '-P %s -s %s -F pg_system:%s' % (self.standby_port, self.host, self.standby_loc)) self.standby = Standby(self.standby_loc, self.standby_port) self.standby.stop() (rc,out) = pgutil.run(command='gpinitstandby -n') self.assertTrue('Successfully started standby master' in out)
def setUp(self): # Remove standby if present. # Though the initial intention of tests was to verify # without depending on management utility scripts, # the reality after all is some other tests might have # left a standby and there is not good way other than # the gp management script to remove it. cmd_str = 'gpinitstandby -a -r' cmd = Command(name='gpinitstandby -r', cmdStr=cmd_str) tinctest.logger.info(cmd_str) cmd.run(validateAfter=False) # For each test case we create a fresh standby and start it. self.db_name = self.__class__.db_name self.standby = Standby(self.standby_datadir, self.standby_port) self.standby.stop() shutil.rmtree(self.basepath, True) try: os.makedirs(self.basepath) except OSError, e: if e.errno != 17: raise pass