def start_gpfdist_process(self, data_dir): # start gpfdist process: # we have seen cases where the gfdist process don't start on particular port, # due to connection bind error or due to "FATAL cannot create socket on port 8080" # this occurs in spite of checking netstat for used ports at the beginning # so as a hack, we keep on trying different ports until gpfdist is started gpfdist_process_started = False while not gpfdist_process_started: gpfdist_process = gpfdist(self.gpfdistport, self.fqdn) try: gpfdist_process.start(options=' -d %s' %data_dir) except GpfdistError as message: tinctest.logger.warn("Couldn't setup gpfdist on port %s"%self.gpfdistport) gpfdist_process_started = False self.gpfdistport = str(int(self.gpfdistport) + 1) else: gpfdist_process_started = True tinctest.logger.info("Started gpfdist on port %s"%self.gpfdistport)
def testStartGpfdistInitWithInteger(self): mygpfdist2 = gpfdist(8080, hostname) mygpfdist2.start() self.assertTrue(mygpfdist2.is_gpfdist_connected()) mygpfdist2.stop() self.assertFalse(mygpfdist2.is_gpfdist_connected())
import socket import unittest2 as unittest from tinctest.lib.gpfdist import gpfdist hostname = socket.gethostname() mygpfdist = gpfdist("8080", hostname) class GpfdistTestCase(unittest.TestCase): def testStartGpfdist(self): mygpfdist.start("") self.assertTrue(mygpfdist.is_gpfdist_connected()) mygpfdist.stop() self.assertFalse(mygpfdist.is_gpfdist_connected()) def testCheckGpfdistNotStarted(self): self.assertFalse(mygpfdist.is_gpfdist_connected()) def testByPassCheck(self): mygpfdist.start(raise_assert=False) self.assertTrue(mygpfdist.is_gpfdist_connected()) mygpfdist.stop() self.assertFalse(mygpfdist.is_gpfdist_connected()) def testStartGpfdistWithString(self): mygpfdist.start(port="8080") self.assertTrue(mygpfdist.is_gpfdist_connected()) mygpfdist.stop()
import socket import unittest2 as unittest from tinctest.lib.gpfdist import gpfdist hostname = socket.gethostname() mygpfdist = gpfdist("8080", hostname) class GpfdistTestCase(unittest.TestCase): def testStartGpfdist(self): mygpfdist.start("") self.assertTrue(mygpfdist.is_gpfdist_connected()) mygpfdist.stop() self.assertFalse(mygpfdist.is_gpfdist_connected()) def testCheckGpfdistNotStarted(self): self.assertFalse(mygpfdist.is_gpfdist_connected()) def testByPassCheck(self): mygpfdist.start(raise_assert=False) self.assertTrue(mygpfdist.is_gpfdist_connected()) mygpfdist.stop() self.assertFalse(mygpfdist.is_gpfdist_connected()) def testStartGpfdistWithString(self): mygpfdist.start(port="8080") self.assertTrue(mygpfdist.is_gpfdist_connected()) mygpfdist.stop() def testStartGpfdistWithInteger(self):