コード例 #1
0
ファイル: test_mapreduce.py プロジェクト: HaozhouWang/gpdb
    def setUpClass(self):
        super(MapreduceMPPTestCase, self).setUpClass()
        gppkg = Gppkg()
        gppkg.gppkg_install(product_version, 'plperl')
        setup_command = "create language plperl;"
        PSQL.run_sql_command(setup_command, dbname = os.environ.get('PGDATABASE'))

        "compile functions.c and build functions.so"
        makeLog = local_path('testBuildSOLog.out')
        cmdMake = 'cd '+local_path('c_functions') + ' && make clean && make'
        res = {'rc': 0, 'stdout' : '', 'stderr': ''}
        run_shell_command(cmdMake, 'compile functions.c', res)
        file = open(makeLog, 'w')
        file.write(res['stdout'])
        file.close()
        if res['rc']:
            raise Exception('a problem occurred while creating the so files ')
        so_dir = local_path('c_functions')
        sharedObj = local_path('c_functions/functions.so')
        # if not os.path.isfile(sharedObj):
            #raise gptest.GPTestError('so files does not exist')

        # For multinode cluster, need to copy shared object tabfunc_gppc_demo.so to all primary segments
        if gpdbconfig.is_multinode():
            res = {'rc':0, 'stderr':'', 'stdout':''}
            hosts = gpdbconfig.get_hosts(segments=True)
            scp_cmd = 'gpscp  -h ' +' -h '.join(map(str,hosts)) +' '+ sharedObj + ' =:%s' % so_dir
            run_shell_command(scp_cmd)
            if res['rc']:
                raise Exception('Could not copy shared object to primary segment')
コード例 #2
0
    def setUpClass(cls):
        """
        Checking if plperl package installed, otherwise install the package
        """
        super(MDTSQLTestCase, cls).setUpClass()
        mdt.pre_process_sql()
        mdt.pre_process_ans()
        mdt.setup_gpfdist()

        cmd = 'gpssh --version'
        res = {'rc': 0, 'stderr': '', 'stdout': ''}
        run_shell_command(cmd, 'check product version', res)
        gppkg = Gppkg()
        product_version = res['stdout']
        gppkg.gppkg_install(product_version, 'plperl')

        setup_user = '******'
        setup_db = 'create database mdt_db;'
        setup_sql = local_path('sql/setup/setup.sql')
        setup_output = local_path('output/setup/setup.out')
        PSQL.run_sql_command(sql_cmd=setup_user,
                             dbname=os.environ.get('PGDATABASE'))
        PSQL.run_sql_command(sql_cmd=setup_db,
                             dbname=os.environ.get('PGDATABASE'),
                             username='******')
        PSQL.run_sql_file(sql_file=setup_sql,
                          out_file=setup_output,
                          dbname='mdt_db',
                          username='******')
コード例 #3
0
ファイル: test_mapreduce.py プロジェクト: HaozhouWang/gpdb
    def setUpClass(self):
        super(MapreduceMPPTestCase, self).setUpClass()
        gppkg = Gppkg()
        gppkg.gppkg_install(product_version, 'plperl')
        setup_command = "create language plperl;"
        PSQL.run_sql_command(setup_command,
                             dbname=os.environ.get('PGDATABASE'))

        "compile functions.c and build functions.so"
        makeLog = local_path('testBuildSOLog.out')
        cmdMake = 'cd ' + local_path('c_functions') + ' && make clean && make'
        res = {'rc': 0, 'stdout': '', 'stderr': ''}
        run_shell_command(cmdMake, 'compile functions.c', res)
        file = open(makeLog, 'w')
        file.write(res['stdout'])
        file.close()
        if res['rc']:
            raise Exception('a problem occurred while creating the so files ')
        so_dir = local_path('c_functions')
        sharedObj = local_path('c_functions/functions.so')
        # if not os.path.isfile(sharedObj):
        #raise gptest.GPTestError('so files does not exist')

        # For multinode cluster, need to copy shared object tabfunc_gppc_demo.so to all primary segments
        if gpdbconfig.is_multinode():
            res = {'rc': 0, 'stderr': '', 'stdout': ''}
            hosts = gpdbconfig.get_hosts(segments=True)
            scp_cmd = 'gpscp  -h ' + ' -h '.join(map(
                str, hosts)) + ' ' + sharedObj + ' =:%s' % so_dir
            run_shell_command(scp_cmd)
            if res['rc']:
                raise Exception(
                    'Could not copy shared object to primary segment')
コード例 #4
0
    def setUpClass(self):
        super(PgcryptoScenarioTestCase, self).setUpClass()
        gppkg = Gppkg()
        gppkg.gppkg_install(product_version, 'pgcrypto')

        res = {'rc': 0, 'stdout' : '', 'stderr': ''}
        run_shell_command(". $GPHOME/greenplum_path.sh; psql -d %s -f $GPHOME/share/postgresql/contrib/pgcrypto.sql" % os.environ.get('PGDATABASE'), 'pgcrypto: setup', res)
        tinctest.logger.info('result from installing pgcrypto %s' % res['stdout'])
コード例 #5
0
ファイル: test_plpgsql.py プロジェクト: zlyswjtu/gpdb
 def install_plperl(self):
     """
     @summary: Installs plperl gppkg and creates plperl language in database if it doesn't exist
     
     """
     gppkg = Gppkg()
     gppkg.gppkg_install(product_version, 'plperl')
     if self.pl.language_in_db('plperl') == False:
         self.pl.create_language_in_db('plperl')
コード例 #6
0
 def setUpClass(self):
     """
     @summary: check if current OS is supported for gppkg.  If not, test is skipped.
     
     """
     cmd = 'gpssh --version'
     res = {'rc': 0, 'stderr': '', 'stdout': ''}
     run_shell_command(cmd, 'check product version', res)
     gppkg = Gppkg()
     product_version = res['stdout']
     gppkg.gppkg_install(product_version, 'pgcrypto')
コード例 #7
0
 def setUpClass(cls):
     """
     Checking if plperl package installed, otherwise install the package
     """
     super(SubtLimitTestCase, cls).setUpClass()
     cmd = 'gpssh --version'
     res = {'rc':0, 'stderr':'', 'stdout':''}
     run_shell_command (cmd, 'check product version', res)
     gppkg = Gppkg()
     product_version = res['stdout']
     gppkg.gppkg_install(product_version, 'plperl')
コード例 #8
0
 def setUpClass(cls):
     """
     Checking if plperl package installed, otherwise install the package
     """
     super(SubtLimitTestCase, cls).setUpClass()
     cmd = 'gpssh --version'
     res = {'rc': 0, 'stderr': '', 'stdout': ''}
     run_shell_command(cmd, 'check product version', res)
     gppkg = Gppkg()
     product_version = res['stdout']
     gppkg.gppkg_install(product_version, 'plperl')
コード例 #9
0
ファイル: test_install.py プロジェクト: PengJi/gpdb-comments
 def setUpClass(self):
     """
     @summary: check if current OS is supported for gppkg.  If not, test is skipped.
     
     """
     cmd = 'gpssh --version'
     res = {'rc':0, 'stderr':'', 'stdout':''}
     run_shell_command (cmd, 'check product version', res)
     gppkg = Gppkg()
     product_version = res['stdout']
     gppkg.gppkg_install(product_version, 'pgcrypto')
コード例 #10
0
 def test_install_should_fail(self):
     """@product_version gpdb: [4.3.5.0 -]"""
     "Old package on the new database which is above the version of 4.3.5.0 should fail"
     gppkg = Gppkg()
     build_type = None
     if os.environ.get("BUILD_TYPE"):
         build_type = os.environ["BUILD_TYPE"]
     os.environ["BUILD_TYPE"] = 'rc'
     with self.assertRaisesRegexp(Exception, 'Failed to install'):
         gppkg.gppkg_install(product_version='4.3.4.0', gppkg=pkgname)
     if build_type is not None:
         os.environ["BUILD_TYPE"] = build_type
     existed, _ = gppkg.check_pkg_exists(pkgname)
     self.assertFalse(existed)
コード例 #11
0
ファイル: test_compatibility.py プロジェクト: kaknikhil/gpdb
 def test_install_should_fail(self):
     """@product_version gpdb: [4.3.5.0 -]"""
     "Old package on the new database which is above the version of 4.3.5.0 should fail"
     gppkg = Gppkg()
     build_type = None
     if os.environ.get("BUILD_TYPE"):
         build_type = os.environ["BUILD_TYPE"]
     os.environ["BUILD_TYPE"] = "rc"
     with self.assertRaisesRegexp(Exception, "Failed to install"):
         gppkg.gppkg_install(product_version="4.3.4.0", gppkg=pkgname)
     if build_type is not None:
         os.environ["BUILD_TYPE"] = build_type
     existed, _ = gppkg.check_pkg_exists(pkgname)
     self.assertFalse(existed)
コード例 #12
0
ファイル: test_gppc.py プロジェクト: HaozhouWang/gpdb
    def setUpClass(cls):
        super(GppcTestCase, cls).setUpClass()
        """
        compile gppc_test.c and install the gppc_test.so
        """
        gpccutil.pre_process()
        cmd = 'gpssh --version'
        res = {'rc':0, 'stderr':'', 'stdout':''}
        run_shell_command (cmd, 'check product version', res)
        gppkg = Gppkg()
        product_version = res['stdout']
        result = gppkg.gppkg_install(product_version, 'libgppc')
        #makeLog = loal_path('test00MakeLog.out')
        if result:
            cmdMakeInstall = 'cd '+local_path('data')+' && make clean && make CPPFLAGS=-D_GNU_SOURCE && make install'
            res = {'rc':0, 'stderr':'', 'stdout':''}
            run_shell_command (cmdMakeInstall, 'compile gppc_test.c', res)

            # Current make file works for linux, but not for Solaris or OSX.
            # If compilation fails or installation fails, force system quit: os._exit(1)
            if res['rc']:
                os._exit(1) # This will exit the test including the next test suites
            sharedObj = local_path('data/gppc_test.so')
            if not os.path.isfile(sharedObj):
                os._exit(1)

            # For multinode cluster, need to copy shared object tabfunc_gppc_demo.so to all primary segments
            res = {'rc':0, 'stderr':'', 'stdout':''}
            hosts = gpdbconfig.get_hosts(segments=True)
            scp_cmd = 'gpscp  -h ' +' -h '.join(map(str,hosts)) +' '+ sharedObj + ' =:%s' % LIBDIR
            run_shell_command(scp_cmd, 'scp share object to all segment', res)
            tinctest.logger.info('scp shared object result %s' % res['stdout'])
            if res['rc']:
                raise Excpetion('Could not copy shared object to primary segment')
コード例 #13
0
    def setUpClass(cls):
        super(EtablefuncGppcTestCase, cls).setUpClass()
        """
        compile tablefunc_gppc_demo.c and install the tablefunc_gppc_demo.so
        """
        gppkg = Gppkg()
        gpccutil.pre_process(product_version)
        result = gppkg.gppkg_install(product_version, "libgppc")
        # makeLog = loal_path('test00MakeLog.out')
        if result:
            cmdMakeInstall = (
                "cd " + local_path("data") + " && make clean && make CPPFLAGS=-D_GNU_SOURCE && make install"
            )
            res = {"rc": 0, "stderr": "", "stdout": ""}
            run_shell_command(cmdMakeInstall, "compile tablefunc_gppc_demo.c", res)

            # Current make file works for linux, but not for Solaris or OSX.
            # If compilation fails or installation fails, force system quit: os._exit(1)
            if res["rc"]:
                os._exit(1)  # This will exit the test including the next test suites
            sharedObj = "%s/tabfunc_gppc_demo.so" % (LIBDIR)
            if not os.path.isfile(sharedObj):
                os._exit(1)

            # For multinode cluster, need to copy shared object tabfunc_gppc_demo.so to all primary segments
            if gpdbconfig.is_multinode():
                res = {"rc": 0, "stderr": "", "stdout": ""}
                hosts = gpdbconfig.get_hosts(segments=True)
                scp_cmd = "gpscp  -h " + " -h ".join(map(str, hosts)) + " " + sharedObj + " =:%s" % LIBDIR
                run_shell_command(scp_cmd)
                if res["rc"]:
                    raise Excpetion("Could not copy shared object to primary segment")
コード例 #14
0
ファイル: test_mdt.py プロジェクト: 50wu/gpdb
    def setUpClass(cls):
        """
        Checking if plperl package installed, otherwise install the package
        """
        super(MDTSQLTestCase, cls).setUpClass()
        mdt.pre_process_sql()
        mdt.pre_process_ans()
        mdt.setup_gpfdist()

        cmd = 'gpssh --version'
        res = {'rc':0, 'stderr':'', 'stdout':''}
        run_shell_command(cmd, 'check product version', res)
        gppkg = Gppkg()
        product_version = res['stdout']
        gppkg.gppkg_install(product_version, 'plperl')

        setup_user = '******'
        setup_db = 'create database mdt_db;'
        setup_sql = local_path('sql/setup/setup.sql')
        setup_output = local_path('output/setup/setup.out')
        PSQL.run_sql_command(sql_cmd=setup_user, dbname=os.environ.get('PGDATABASE'))
        PSQL.run_sql_command(sql_cmd=setup_db, dbname=os.environ.get('PGDATABASE'), username='******')
        PSQL.run_sql_file(sql_file = setup_sql, out_file=setup_output, dbname='mdt_db', username='******')
コード例 #15
0
    def setUpClass(cls):
        super(GppcTestCase, cls).setUpClass()
        """
        compile gppc_test.c and install the gppc_test.so
        """
        gpccutil.pre_process()
        cmd = 'gpssh --version'
        res = {'rc': 0, 'stderr': '', 'stdout': ''}
        run_shell_command(cmd, 'check product version', res)
        gppkg = Gppkg()
        product_version = res['stdout']
        result = gppkg.gppkg_install(product_version, 'libgppc')
        #makeLog = loal_path('test00MakeLog.out')
        if result:
            cmdMakeInstall = 'cd ' + local_path(
                'data'
            ) + ' && make clean && make CPPFLAGS=-D_GNU_SOURCE && make install'
            res = {'rc': 0, 'stderr': '', 'stdout': ''}
            run_shell_command(cmdMakeInstall, 'compile gppc_test.c', res)

            # Current make file works for linux, but not for Solaris or OSX.
            # If compilation fails or installation fails, force system quit: os._exit(1)
            if res['rc']:
                os._exit(
                    1
                )  # This will exit the test including the next test suites
            sharedObj = local_path('data/gppc_test.so')
            if not os.path.isfile(sharedObj):
                os._exit(1)

            # For multinode cluster, need to copy shared object tabfunc_gppc_demo.so to all primary segments
            res = {'rc': 0, 'stderr': '', 'stdout': ''}
            hosts = gpdbconfig.get_hosts(segments=True)
            scp_cmd = 'gpscp  -h ' + ' -h '.join(map(
                str, hosts)) + ' ' + sharedObj + ' =:%s' % LIBDIR
            run_shell_command(scp_cmd, 'scp share object to all segment', res)
            tinctest.logger.info('scp shared object result %s' % res['stdout'])
            if res['rc']:
                raise Excpetion(
                    'Could not copy shared object to primary segment')
コード例 #16
0
ファイル: test_plperl.py プロジェクト: HaozhouWang/gpdb
 def setUpClass(self):
     super(PlperlMPPTestCase, self).setUpClass()
     gppkg = Gppkg()
     gppkg.gppkg_install(product_version, 'plperl')
コード例 #17
0
ファイル: test_spi.py プロジェクト: stefanieqiang/gpdb-1
 def setUpClass(self):
     super(SpiMPPTestCase, self).setUpClass()
     gppkg = Gppkg()
     gppkg.gppkg_install(product_version, 'plperl')
     setup_file = local_path('setup.sql')
     PSQL.run_sql_file(setup_file)
コード例 #18
0
 def setUpClass(self):
     super(PlrMPPTestCase, self).setUpClass()
     gppkg = Gppkg()
     gppkg.gppkg_install(product_version, 'plr')
コード例 #19
0
ファイル: test_postgis.py プロジェクト: 50wu/gpdb
 def setUpClass(self):
     super(PostgisTestCase, self).setUpClass()
     gppkg = Gppkg()
     gppkg.gppkg_install(product_version, 'postgis')
コード例 #20
0
 def setUpClass(self):
     super(PostgisTestCase, self).setUpClass()
     gppkg = Gppkg()
     gppkg.gppkg_install(product_version, 'postgis')
コード例 #21
0
ファイル: test_language.py プロジェクト: LJoNe/gpdb
 def setUpClass(self):
     gppkg = Gppkg()
     gppkg.gppkg_install(product_version, 'plr')
     gppkg.gppkg_install(product_version, 'pljava')
     gppkg.gppkg_install(product_version, 'plperl')
コード例 #22
0
ファイル: test_language.py プロジェクト: yezhiweicmss/gpdb
 def setUpClass(self):
     gppkg = Gppkg()
     gppkg.gppkg_install(product_version, 'plr')
     gppkg.gppkg_install(product_version, 'pljava')
     gppkg.gppkg_install(product_version, 'plperl')
コード例 #23
0
ファイル: test_spi.py プロジェクト: kaknikhil/gpdb
 def setUpClass(self):
     super(SpiMPPTestCase, self).setUpClass()
     gppkg = Gppkg()
     gppkg.gppkg_install(product_version, "plperl")
     setup_file = local_path("setup.sql")
     PSQL.run_sql_file(setup_file)