def setUp(self): super(GPExpandTestCase, self).setUp() # Doing this in setUp to not impact test construction. self.hosts = get_gpexpand_hosts() #initial config has master on HOST1 and segments on HOST2 and HOST3. #If we choose to add only segments ie self.number_of_expansion_hosts == 0, in the interview process we say use HOST1 and HOST2 #if we choose to add expansion hosts ,ie self.number_of_expansion_hosts == 2, in the interview process we say use HOST3 and HOST4 if self.number_of_expansion_hosts == 0: self.expansion_host_list = "%s , %s" % (self.hosts[1], self.hosts[2]) elif self.number_of_expansion_hosts == 2: self.expansion_host_list = "%s , %s" % (self.hosts[3], self.hosts[4]) if self.gpinitsystem: self._do_gpinitsystem() if self.standby_enabled: self._do_gpinitstandby() if self.use_filespaces: tinctest.logger.info("Setting filespaces") mdd = os.path.join(self.testcase_master_dir, 'gpseg-1') self.org_mdd = os.environ.get("MASTER_DATA_DIRECTORY") os.environ["MASTER_DATA_DIRECTORY"] = mdd gpfs = Gpfilespace() gpfs.create_filespace('expand_filespace') res = {'rc': 0, 'stdout': '', 'stderr': ''} cmdStr = "export MASTER_DATA_DIRECTORY=%s; gpfilespace --movetransfilespace expand_filespace" % ( mdd) run_shell_command(cmdStr, 'create segment dirs', res) if res['rc'] > 0: raise GpExpandTestCaseException("Failed to movetransfilespace") cmdStr = "export MASTER_DATA_DIRECTORY=%s; gpfilespace --movetempfilespace expand_filespace" % ( mdd) run_shell_command(cmdStr, 'create segment dirs', res) if res['rc'] > 0: raise GpExpandTestCaseException("Failed to movetempfilespace") tinctest.logger.info("Performing setup tasks") self._setup_gpexpand()
def method_setup(self): tinctest.logger.info("Performing setup tasks") gpfs=Gpfilespace() gpfs.create_filespace('filerep_fs_a') gpfs.create_filespace('filerep_fs_b') gpfs.create_filespace('filerep_fs_c') gpfs.create_filespace('filerep_fs_z') gpfs.create_filespace('sync1_fs_1') # Set max_resource_queues to 100 cmd = 'gpconfig -c max_resource_queues -v 100 ' ok = run_shell_command(cmd) if not ok: raise Exception('Failure during setting the max_resource_queues value to 100 using gpconfig tool') #Restart the cluster self.gpstop.run_gpstop_cmd(immediate = 'i') ok = self.gpstart.run_gpstart_cmd() if not ok: raise Exception('Failure during restarting the cluster') return True
def __init__(self, methodName): self.gpfile = Gpfilespace() self.filereputil = Filerepe2e_Util() super(PgtwoPhaseTestCase, self).__init__(methodName)