Ejemplo n.º 1
0
    def stop_start_validate(self, expect_down_segments=False):
        """
        Do gpstop -i, gpstart and see if all segments come back up fine 
        """
        self.gpstart = GpStart()
        self.gpstop = GpStop()
        tinctest.logger.info("[STLRTest] Running stop_start_validate")

        tinctest.logger.info("[STLRTest]Shutting down the cluster")
        ok = self.gpstop.run_gpstop_cmd(immediate='i')
        if not expect_down_segments:
            if not ok:
                raise Exception(
                    '[STLRTest]Problem while shutting down the cluster')
            tinctest.logger.info(
                "[STLRTest]Successfully shutdown the cluster.")

        tinctest.logger.info("[STLRTest]Restarting the cluster.")
        ok = self.gpstart.run_gpstart_cmd()

        if not ok:
            raise Exception('[STLRTest]Failed to bring the cluster back up')
        tinctest.logger.info("[STLRTest]Successfully restarted the cluster.")
        if not self.anydownsegments():
            raise Exception("[STLRTest]segments were marked down")
        else:
            return (True, "All segments are up")
Ejemplo n.º 2
0
	def setUp(self):
                self.basedir = os.path.dirname(__file__)
		self.gphome = os.environ.get('GPHOME')
                self.gp=GpStart()
                self.gps=GpStop()
                self.MAX_TRY=3
                self.TIMEOUT=90
                self.MAXPARALLELSEG=60
Ejemplo n.º 3
0
 def __init__(self):
     self.gpstart = GpStart()
     self.gpstop = GpStop()
     self.config = GpConfig()
     self.port = os.getenv('PGPORT')
     self.gphome = (os.getenv('GPHOME'))
     self.base_dir = os.path.dirname(
         sys.modules[self.__class__.__module__].__file__)
Ejemplo n.º 4
0
 def __init__(self, methodName):
     self.pgport = os.environ.get('PGPORT')
     self.fileutil = Filerepe2e_Util()
     self.gpstate = Gpstate()
     self.gpprimarymirror = Gpprimarymirror()
     self.gpstart = GpStart()
     self.gpstop = GpStop()
     super(FtsTransitions,self).__init__(methodName)
Ejemplo n.º 5
0
 def __init__(self, methodName):
     self.pgport = os.environ.get('PGPORT')
     self.util = Filerepe2e_Util()
     self.gpconfig = GpConfig()
     self.config = GPDBConfig()
     self.gpr = GpRecover(self.config)
     self.dbstate = DbStateClass('run_validation', self.config)
     self.gpstart = GpStart()
     self.gpstop = GpStop()
     super(FilerepTestCase, self).__init__(methodName)
Ejemplo n.º 6
0
 def __init__(self, methodName):
     self.filereputil = Filerepe2e_Util()
     self.config = GPDBConfig()
     self.gprecover = GpRecover(self.config)
     self.gpstop = GpStop()
     self.gpstart = GpStart()
     self.gpverify = GpdbVerify(config=self.config)
     self.dbstate = DbStateClass('run_validation', self.config)
     self.port = os.getenv('PGPORT')
     super(PgtwoPhaseClass, self).__init__(methodName)
Ejemplo n.º 7
0
    def start_db(self):
        """
        @summary: Start the greenplum DB based on the options provided 
        
        @param option: represents different gpstart command options
        @return: output of the executed command as a string
        """

        gpstart = GpStart()
        gpstart.run_gpstart_cmd()
Ejemplo n.º 8
0
 def __init__(self,methodName):
     self.fileutil = Filerepe2e_Util()
     self.config = GPDBConfig()
     self.gprecover = GpRecover(self.config)
     self.gpstart = GpStart()
     self.gpstop = GpStop()
     self.gpfile = Gpfilespace(self.config)
     self.dbstate = DbStateClass('run_validation', self.config)
     self.port = os.getenv('PGPORT')
     self.base = GPDBStorageBaseTestCase()
     super(SuspendCheckpointCrashRecovery,self).__init__(methodName)
Ejemplo n.º 9
0
 def run_restart_database(self):
     '''
     @summary : Restart the database
     '''
     self.gpstart = GpStart()
     self.gpstop = GpStop()
     tinctest.logger.info("[STLRTest] Running run_restart_database")
     ok = self.gpstop.run_gpstop_cmd(immediate='i')
     tinctest.logger.info(ok)
     ok = self.gpstart.run_gpstart_cmd()
     tinctest.logger.info(ok)
Ejemplo n.º 10
0
    def __init__(self, config=None):
        if config is not None:
            self.config = config
        else:
            self.config = GPDBConfig()

        self.filereputil = Filerepe2e_Util()
        self.gprecover = GpRecover(self.config)
        self.gpstop = GpStop()
        self.gpstart = GpStart()
        self.gpverify = GpdbVerify(config=self.config)
        self.dbstate = DbStateClass('run_validation', self.config)
        self.port = os.getenv('PGPORT')
Ejemplo n.º 11
0
 def run_restart_database(self):
     '''
     @summary : Restart the database
     '''
     self.gpstart = GpStart()
     self.gpstop = GpStop()
     tinctest.logger.info("[STLRTest] Running run_restart_database")   
     ok = self.gpstop.run_gpstop_cmd(immediate = 'i')
     tinctest.logger.info(ok)
     ok = self.gpstart.run_gpstart_cmd()
     tinctest.logger.info(ok)       
     tinctest.logger.info("[STLRTest] printing gp segment configuration")
     (gp_seg_conf) = PSQL.run_sql_command("select * from gp_segment_configuration order by dbid")
     tinctest.logger.info(gp_seg_conf)
Ejemplo n.º 12
0
 def restart(self):
     # GpStop does not accept immedaite and restart both...
     GpStop().run_gpstop_cmd(immediate=True)
     GpStart().run_gpstart_cmd()