From da580b04a1d67069b122da708a9a88a6b2a3a7b0 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Mon, 6 Mar 2017 12:33:51 +0100 Subject: [PATCH] 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. --- .../package/procedural_language/__init__.py | 17 ----- .../procedural_language/plperl/__init__.py | 0 .../procedural_language/plperl/test_plperl.py | 65 ------------------ .../procedural_language/plr/__init__.py | 0 .../procedural_language/plr/test_plr.py | 66 ------------------- 5 files changed, 148 deletions(-) delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plperl/__init__.py delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plperl/test_plperl.py delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plr/__init__.py delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plr/test_plr.py diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/__init__.py b/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/__init__.py index 70f380365b..12dec6d8fb 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/__init__.py +++ b/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/__init__.py @@ -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 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plperl/__init__.py b/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plperl/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plperl/test_plperl.py b/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plperl/test_plperl.py deleted file mode 100644 index 47de766858..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plperl/test_plperl.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/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)) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plr/__init__.py b/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plr/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plr/test_plr.py b/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plr/test_plr.py deleted file mode 100644 index b3b0532e04..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/package/procedural_language/plr/test_plr.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/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)) -- GitLab