예제 #1
0
파일: test_platform.py 프로젝트: 50wu/gpdb
 def check_platform(platform):
     return lambda self: self.checkTrue(gpplatform.get_info() == platform)
예제 #2
0
파일: test_platform.py 프로젝트: 50wu/gpdb
 def test_platform_get_info(self):
     platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"]
     for platform in platforms:
         check = gpplatform.get_info() == platform
         if check:
             self.assertTrue(check)
예제 #3
0
    The logic here is equivalent to the step "(int) (x - y)" where x and y are
    32-bit unsigned int variables in TransactionIdPrecedes() in transam.c.
    """
    diff = x - y
    if diff >= 2**31:
        ret = x
    elif diff > 0:
        ret = y
    elif diff > -2**31:
        ret = x
    else:  # diff <= -2**31
        ret = y
    return ret


@unittest.skipIf(gpplatform.get_info() == "SOL",
                 "Skipping Solaris, cannot compile xidhelper.so")
class XidlimitsTests(MPPTestCase):
    """
    
    @description Xidlimits Tests
    @created 2013-02-12 00:00:00
    @modified 2013-02-12 00:00:00
    @tags vacuum xidlimits echo
    @gucs gp_create_table_random_default_distribution=off
    """
    # Constants identifying the limit to exceed.
    WARN_LIMIT = 0
    STOP_LIMIT = 1
    WRAP_LIMIT = 2
예제 #4
0
파일: test_platform.py 프로젝트: 50wu/gpdb
import unittest2 as unittest
import tinctest.lib.gpplatform as gpplatform

platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"]

class PlatformTestCase(unittest.TestCase):
    def test_platform_get_info(self):
        platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"]
        for platform in platforms:
            check = gpplatform.get_info() == platform
            if check:
                self.assertTrue(check)

    def checkTrue(self, check):
        if check:
            self.assertTrue(check)
        else:
            self.assertFalse(check)

for platform in platforms:
    def check_platform(platform):
        return lambda self: self.checkTrue(gpplatform.get_info() == platform)
    setattr(PlatformTestCase, "test_platform%r_%s" % 
            (platform, gpplatform.get_info() == platform), check_platform(platform))
예제 #5
0
    Returns the xid that precedes the other.  Analogous to the standard min().
    The logic here is equivalent to the step "(int) (x - y)" where x and y are
    32-bit unsigned int variables in TransactionIdPrecedes() in transam.c.
    """
    diff = x - y
    if diff >= 2**31:
        ret = x
    elif diff > 0:
        ret = y
    elif diff > -2**31:
        ret = x
    else: # diff <= -2**31
        ret = y
    return ret

@unittest.skipIf(gpplatform.get_info()=="SOL", "Skipping Solaris, cannot compile xidhelper.so")
class XidlimitsTests(MPPTestCase):
    """
    
    @description Xidlimits Tests
    @created 2013-02-12 00:00:00
    @modified 2013-02-12 00:00:00
    @tags vacuum xidlimits echo
    @gucs gp_create_table_random_default_distribution=off
    """
    # Constants identifying the limit to exceed.
    WARN_LIMIT = 0
    STOP_LIMIT = 1
    WRAP_LIMIT = 2

    def setUp(self):
예제 #6
0
    Returns the xid that precedes the other.  Analogous to the standard min().
    The logic here is equivalent to the step "(int) (x - y)" where x and y are
    32-bit unsigned int variables in TransactionIdPrecedes() in transam.c.
    """
    diff = x - y
    if diff >= 2**31:
        ret = x
    elif diff > 0:
        ret = y
    elif diff > -2**31:
        ret = x
    else: # diff <= -2**31
        ret = y
    return ret

@unittest.skipIf(gpplatform.get_info()=="SOL", "Skipping Solaris, cannot compile xidhelper.so")
class XidlimitsTests(MPPTestCase):
    """
    
    @description Xidlimits Tests
    @created 2013-02-12 00:00:00
    @modified 2013-02-12 00:00:00
    @tags vacuum xidlimits echo
    @gucs gp_create_table_random_default_distribution=off
    """
    # Constants identifying the limit to exceed.
    WARN_LIMIT = 0
    STOP_LIMIT = 1
    WRAP_LIMIT = 2

    def setUp(self):
예제 #7
0
 def test_platform_get_info(self):
     platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"]
     for platform in platforms:
         check = gpplatform.get_info() == platform
         if check:
             self.assertTrue(check)
예제 #8
0
 def check_platform(platform):
     return lambda self: self.checkTrue(gpplatform.get_info() == platform)
예제 #9
0
import unittest2 as unittest
import tinctest.lib.gpplatform as gpplatform

platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"]


class PlatformTestCase(unittest.TestCase):
    def test_platform_get_info(self):
        platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"]
        for platform in platforms:
            check = gpplatform.get_info() == platform
            if check:
                self.assertTrue(check)

    def checkTrue(self, check):
        if check:
            self.assertTrue(check)
        else:
            self.assertFalse(check)


for platform in platforms:

    def check_platform(platform):
        return lambda self: self.checkTrue(gpplatform.get_info() == platform)

    setattr(
        PlatformTestCase,
        "test_platform%r_%s" % (platform, gpplatform.get_info() == platform),
        check_platform(platform))