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')
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='******')
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')
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'])
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')
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')
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')
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')
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')
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)
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)
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')
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")
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='******')
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')
def setUpClass(self): super(PlperlMPPTestCase, self).setUpClass() gppkg = Gppkg() gppkg.gppkg_install(product_version, 'plperl')
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)
def setUpClass(self): super(PlrMPPTestCase, self).setUpClass() gppkg = Gppkg() gppkg.gppkg_install(product_version, 'plr')
def setUpClass(self): super(PostgisTestCase, self).setUpClass() gppkg = Gppkg() gppkg.gppkg_install(product_version, 'postgis')
def setUpClass(self): super(PostgisTestCase, self).setUpClass() gppkg = Gppkg() gppkg.gppkg_install(product_version, 'postgis')
def setUpClass(self): gppkg = Gppkg() gppkg.gppkg_install(product_version, 'plr') gppkg.gppkg_install(product_version, 'pljava') gppkg.gppkg_install(product_version, 'plperl')
def setUpClass(self): gppkg = Gppkg() gppkg.gppkg_install(product_version, 'plr') gppkg.gppkg_install(product_version, 'pljava') gppkg.gppkg_install(product_version, 'plperl')
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)