提交 da580b04 编写于 作者: D Daniel Gustafsson

Remove PL/Perl and PL/R gppkg tests

Installing PL languages via gppkg without doing anything to check
the validity and functionality of the actual installation isn't
terribly exciting, and on top of that it's also already tested in
package/language.
上级 b4068cb5
......@@ -83,20 +83,3 @@ class ProceduralLanguage:
return False
else:
return True
def drop_lanaguage_from_db(self, language_name, dbname=os.environ.get('PGDATABASE', 'gptest')):
"""
@summary: Drops a procedural language from a given database
@param language_name: The name of the procedural language to drop, e.g. plperl
@param dbname: Optional. The name of the database. If not speciried, uses PGDATABASE if defined in environment or gptest if not.
@return: list - (True, output of sql) if language is dropped, (False, output of sql) otherwise
@raise Exception: If sql returns an error
"""
sql = 'drop language if exists %s cascade' % language_name
result = PSQL.run_sql_command(sql_cmd = sql, flags = '-q -t', dbname=dbname)
tinctest.logger.info("Running command - %s" % sql)
if 'error' in result.lower():
return False
else:
return True
#!/usr/bin/env python
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@summary: Test class for installing plperl language in a given GPDB system
"""
from mpp.gpdb.tests.package.procedural_language import ProceduralLanguage
from mpp.lib.gppkg.gppkg import Gppkg
from mpp.models import MPPTestCase
from tinctest.lib import run_shell_command
cmd = 'gpssh --version'
res = {'rc':0, 'stderr':'', 'stdout':''}
run_shell_command (cmd, 'check product version', res)
product_version = res['stdout'].split('gpssh version ')[1].split(' build ')[0]
class PlperlMPPTestCase(MPPTestCase):
def __init__(self, methodName):
self.pl = ProceduralLanguage()
self.language = 'plperl'
super(PlperlMPPTestCase, self).__init__(methodName)
@classmethod
def setUpClass(self):
super(PlperlMPPTestCase, self).setUpClass()
gppkg = Gppkg()
gppkg.gppkg_install(product_version, 'plperl')
def setUp(self):
"""
@summary: Overrides setUp for gptest to check if current OS is supported for gppkg. If not, test is skipped.
"""
if self.pl.gppkg_os.find('rhel') < 0 and self.pl.gppkg_os.find('suse') < 0:
self.skipTest('TEST SKIPPED: plperl is only supported on RHEL and SuSE. Skipping test.')
def tearDown(self):
pass
def test_install_Plperl(self):
"""Install plperl"""
if self.pl.language_in_db(self.language) == True:
self.pl.drop_lanaguage_from_db(self.language)
self.assertTrue(self.pl.create_language_in_db(self.language))
def test_uninstall_Plperl(self):
"""uninstall plperl language"""
if self.pl.language_in_db(self.language) == False:
self.pl.create_language_in_db(self.language)
self.assertTrue(self.pl.drop_lanaguage_from_db(self.language))
#!/usr/bin/env python
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@summary: Test class for installing plr language in a given GPDB system
"""
from mpp.gpdb.tests.package.procedural_language import ProceduralLanguage
from mpp.lib.gppkg.gppkg import Gppkg
from mpp.models import MPPTestCase
from tinctest.lib import run_shell_command
cmd = 'gpssh --version'
res = {'rc':0, 'stderr':'', 'stdout':''}
run_shell_command (cmd, 'check product version', res)
product_version = res['stdout'].split('gpssh version ')[1].split(' build ')[0]
class PlrMPPTestCase(MPPTestCase):
def __init__(self, methodName):
self.pl = ProceduralLanguage()
self.language = 'plr'
super(PlrMPPTestCase, self).__init__(methodName)
@classmethod
def setUpClass(self):
super(PlrMPPTestCase, self).setUpClass()
gppkg = Gppkg()
gppkg.gppkg_install(product_version, 'plr')
def setUp(self):
"""
@summary: Overrides setUp for gptest to check if current OS is supported for gppkg. If not, test is skipped.
"""
if self.pl.gppkg_os.find('rhel') < 0 and self.pl.gppkg_os.find('suse') < 0:
self.skipTest('TEST SKIPPED: plr is only supported on RHEL and SuSE. Skipping test.')
def tearDown(self):
pass
def test_install_Plr(self):
"""Install plr"""
if self.pl.language_in_db(self.language) == True:
self.pl.drop_lanaguage_from_db(self.language)
self.assertTrue(self.pl.create_language_in_db(self.language))
def test_uninstall_Plr(self):
"""uninstall plr language"""
if self.pl.language_in_db(self.language) == False:
self.pl.create_language_in_db(self.language)
self.assertTrue(self.pl.drop_lanaguage_from_db(self.language))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册