Ejemplo n.º 1
0
    def _generate_gpinit_config_files(self):
        transforms = {'%PORT_BASE%': self.port_base,
                      '%MASTER_HOST%': self.hosts[0], # First item in self.hosts
                      '%HOSTFILE%': self.testcase_hosts_file,
                      '%MASTER_PORT%': self.master_port,
                      '%MASTER_DATA_DIR%': self.testcase_master_dir,
                      '%DATA_DIR%': (self.testcase_primary_dir + ' ') * self.number_of_segments
                      }

        if self.mirror_enabled:
            transforms['%MIRROR_DIR%'] = (self.testcase_mirror_dir + ' ') * self.number_of_segments
            transforms['%MIRROR_PORT_BASE%'] = self.mirror_port_base
            transforms['%REP_PORT_BASE%'] = self.rep_port_base
            transforms['%MIRROR_REP_PORT_BASE%'] = self.mirror_rep_port_base

        # First generate host file based on number_of_hosts
        with open(self.testcase_hosts_file, 'w') as f:
            for host in self.hosts[1:self.number_of_hosts+1]:
                f.write(host + '\n')

        if self.mirror_enabled:
            TINCSystem.substitute_strings_in_file(self.gpinitconfig_mirror_template,
                                                  self.testcase_init_file,
                                                  transforms)
        else:
            TINCSystem.substitute_strings_in_file(self.gpinitconfig_template,
                                                  self.testcase_init_file,
                                                  transforms)
Ejemplo n.º 2
0
    def _generate_gpinit_config_files(self):
        transforms = {
            '%SEG_PREFIX%':
            self.seg_prefix,
            '%PORT_BASE%':
            self.port_base,
            '%MASTER_HOST%':
            self.master_host,  # First item in self.hosts
            '%HOSTFILE%':
            self.host_file,
            '%MASTER_PORT%':
            self.master_port,
            '%MASTER_DATA_DIR%':
            os.path.dirname(self.mdd),
            '%DATA_DIR%': (os.path.dirname(self.primary_data_dir) + ' ') *
            self.number_of_segments_per_host
        }

        # First generate host file based on number_of_hosts
        with open(self.host_file, 'w') as f:
            for host in self.hosts:
                f.write(host + '\n')
        TINCSystem.substitute_strings_in_file(self.gpinitconfig_template,
                                              self.gpinitconfig_file,
                                              transforms)
Ejemplo n.º 3
0
    def generate_config_file(self, greenplum_path_file, pgport, cc_install_dir,
                             port, mdd):
        configFile_template = local_path(
            "../gpdb/tests/utilities/commandcenter/configs/config_template.txt"
        )
        configFile = local_path(
            "../gpdb/tests/utilities/commandcenter/configs/config.txt")
        cc_source = cc_install_dir + "/gpcc_path.sh"
        transforms = {
            '%pgport%': pgport,
            '%source%': greenplum_path_file,
            '%instance_name%': cc_install_dir,
            '%port%': port,
            '%mdd%': mdd,
            '%cc_source%': cc_source
        }
        cmd_str = 'chmod 777 %s; chmod 777 %s;' % (configFile_template,
                                                   configFile)
        tinctest.logger.info(cmd_str)
        cmd = Command(name='chmod',
                      cmdStr=cmd_str,
                      ctxt=REMOTE,
                      remoteHost='localhost')

        cmd.run()

        TINCSystem.substitute_strings_in_file(configFile_template, configFile,
                                              transforms)
Ejemplo n.º 4
0
    def _generate_gpinit_config_files(self):
        transforms = {'%SEG_PREFIX%': self.seg_prefix,
                      '%PORT_BASE%': self.port_base,
                      '%MASTER_HOST%': self.master_host, # First item in self.hosts
                      '%HOSTFILE%': self.host_file,
                      '%MASTER_PORT%': self.master_port,
                      '%MASTER_DATA_DIR%': os.path.dirname(self.mdd),
                      '%DATA_DIR%': (os.path.dirname(self.primary_data_dir) + ' ') * self.number_of_segments_per_host 
                      }

        # First generate host file based on number_of_hosts
        with open(self.host_file, 'w') as f:
            for host in self.hosts:
                f.write(host + '\n')
        TINCSystem.substitute_strings_in_file(self.gpinitconfig_template,
                                              self.gpinitconfig_file,
                                              transforms)
Ejemplo n.º 5
0
                def generate_config_file(self,greenplum_path_file,pgport,cc_install_dir,port,mdd):
                        configFile_template = local_path("../gpdb/tests/utilities/commandcenter/configs/config_template.txt")
                        configFile = local_path("../gpdb/tests/utilities/commandcenter/configs/config.txt")
                        cc_source = cc_install_dir + "/gpcc_path.sh"
                        transforms = {'%pgport%': pgport,
                              '%source%': greenplum_path_file,
                              '%instance_name%': cc_install_dir,
                              '%port%': port,
                              '%mdd%': mdd,
                              '%cc_source%': cc_source 
                              }
                        cmd_str = 'chmod 777 %s; chmod 777 %s;'% (configFile_template ,configFile)
                        tinctest.logger.info(cmd_str)
                        cmd = Command (name = 'chmod',
                                   cmdStr = cmd_str,
                                   ctxt = REMOTE, remoteHost = 'localhost')

                        cmd.run()                        
			                                 
                        TINCSystem.substitute_strings_in_file(configFile_template,
                                                          configFile,
                                                          transforms)