예제 #1
0
 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)
예제 #2
0
 def testStartGpfdistInitWithInteger(self):
     mygpfdist2 = gpfdist(8080, hostname)
     mygpfdist2.start()
     self.assertTrue(mygpfdist2.is_gpfdist_connected())
     mygpfdist2.stop()
     self.assertFalse(mygpfdist2.is_gpfdist_connected())
예제 #3
0
파일: test_gpfdist.py 프로젝트: 50wu/gpdb
 def testStartGpfdistInitWithInteger(self):
     mygpfdist2 = gpfdist(8080, hostname)
     mygpfdist2.start()
     self.assertTrue(mygpfdist2.is_gpfdist_connected())
     mygpfdist2.stop()
     self.assertFalse(mygpfdist2.is_gpfdist_connected())
예제 #4
0
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()
예제 #5
0
파일: test_gpfdist.py 프로젝트: 50wu/gpdb
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):