Skip to content

Commit

Permalink
gppkg: remove special Concourse task for GPHOME copying
Browse files Browse the repository at this point in the history
concourse/scripts/gppkg_behave.sh, which installs an identical copy of
GPHOME into a new location, existed for exactly one test. Modify that
test to perform its own copy-install.

(cherry picked from commit e6b40a7)
  • Loading branch information
jchampio authored and jmcatamney committed Apr 25, 2019
1 parent 1c7721b commit 9b8047d
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 90 deletions.
11 changes: 0 additions & 11 deletions concourse/pipelines/gpdb_6X_STABLE-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
## Test Sections: ['ICW', 'Replication', 'ResourceGroups', 'Interconnect', 'CLI', 'UD', 'AA', 'Extensions', 'Gpperfmon']
## ======================================================================



## ======================================================================
## __ _ _ __ ___ _ _ _ __ ___
## / _` | '__/ _ \| | | | '_ \/ __|
Expand Down Expand Up @@ -1543,7 +1541,6 @@ jobs:
<<: *ccp_gen_cluster_default_params
- task: gpinitsystem
file: ccp_src/ci/tasks/gpinitsystem.yml

- task: gpmovemirrors_concourse_cluster_tests
file: gpdb_src/concourse/tasks/run_behave.yml
image: ccp-image
Expand Down Expand Up @@ -1614,11 +1611,6 @@ jobs:
<<: *ccp_gen_cluster_default_params
- task: gpinitsystem
file: ccp_src/ci/tasks/gpinitsystem.yml

- task: setup_gppkg_second_install
file: gpdb_src/concourse/tasks/gppkg_behave.yml
params:
SECOND_BINARY_INSTALL_LOCATION: /tmp/gppkg_migrate
- task: gppkg_concourse_cluster_tests
file: gpdb_src/concourse/tasks/run_behave.yml
image: ccp-image
Expand Down Expand Up @@ -1794,7 +1786,6 @@ jobs:
<<: *ccp_gen_cluster_default_params
- task: gpinitsystem
file: ccp_src/ci/tasks/gpinitsystem.yml

- task: gpcheckcat_concourse_cluster_tests
file: gpdb_src/concourse/tasks/run_behave.yml
image: ccp-image
Expand Down Expand Up @@ -1844,7 +1835,6 @@ jobs:
<<: *ccp_gen_cluster_default_params
- task: gpinitsystem
file: ccp_src/ci/tasks/gpinitsystem.yml

- task: gprecoverseg_concourse_cluster_tests
file: gpdb_src/concourse/tasks/run_behave.yml
image: ccp-image
Expand Down Expand Up @@ -1894,7 +1884,6 @@ jobs:
<<: *ccp_gen_cluster_default_params
- task: gpinitsystem
file: ccp_src/ci/tasks/gpinitsystem.yml

- task: gpaddmirrors_concourse_cluster_tests
file: gpdb_src/concourse/tasks/run_behave.yml
image: ccp-image
Expand Down
12 changes: 1 addition & 11 deletions concourse/pipelines/templates/gpdb-tpl.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@

{% set gppkg_additional_task = "
- task: setup_gppkg_second_install
file: gpdb_src/concourse/tasks/gppkg_behave.yml
params:
SECOND_BINARY_INSTALL_LOCATION: /tmp/gppkg_migrate"
%}

{% set CLI_BEHAVE_TESTS = [
{'name': 'gpmovemirrors',
'use_concourse_cluster': true,
'additional_ccp_vars': 'number_of_nodes: 4'},
{'name': 'gpcheck',
'use_concourse_cluster': false},
{'name': 'gppkg',
'use_concourse_cluster': true,
'additional_tasks': gppkg_additional_task},
'use_concourse_cluster': true},
{'name': 'analyzedb',
'use_concourse_cluster': false},
{'name': 'gpinitsystem',
Expand Down Expand Up @@ -1776,7 +1767,6 @@ jobs:
<<: *ccp_gen_cluster_default_params
- task: gpinitsystem
file: ccp_src/ci/tasks/gpinitsystem.yml
[[ test.additional_tasks ]]
- task: [[ test.name ]]_concourse_cluster_tests
file: gpdb_src/concourse/tasks/run_behave.yml
image: ccp-image
Expand Down
40 changes: 0 additions & 40 deletions concourse/scripts/gppkg_behave.sh

This file was deleted.

28 changes: 0 additions & 28 deletions concourse/tasks/gppkg_behave.yml

This file was deleted.

1 change: 1 addition & 0 deletions gpMgmt/test/behave/mgmt_utils/gppkg.feature
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Feature: gppkg tests
Scenario: gppkg --migrate copies all packages from master to all segment hosts
Given the database is running
And the user runs "gppkg -r sample"
And a gphome copy is created at /tmp/gppkg_migrate on all hosts
When a user runs "MASTER_DATA_DIRECTORY=$MASTER_DATA_DIRECTORY gppkg -r sample" with gphome "/tmp/gppkg_migrate"
And "sample" gppkg files do not exist on any hosts
When a user runs "MASTER_DATA_DIRECTORY=$MASTER_DATA_DIRECTORY gppkg --install $(pwd)/test/behave/mgmt_utils/steps/data/sample.gppkg" with gphome "/tmp/gppkg_migrate"
Expand Down
41 changes: 41 additions & 0 deletions gpMgmt/test/behave/mgmt_utils/steps/mgmt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,47 @@ def impl(context, gppkg_name):
def impl(context, gppkg_name):
_remove_gppkg_from_host(context, gppkg_name, is_master_host=True)


@given('a gphome copy is created at {location} on all hosts')
def impl(context, location):
"""
Copies the contents of GPHOME from the local machine into a different
directory location for all hosts in the cluster.
"""
gphome = os.environ["GPHOME"]
greenplum_path = path.join(gphome, 'greenplum_path.sh')

# First replace the GPHOME envvar in greenplum_path.sh.
subprocess.check_call([
'sed',
'-i.bak', # we use this backup later
'-e', r's|^GPHOME=.*$|GPHOME={}|'.format(location),
greenplum_path,
])

try:
# Now copy all the files over.
hosts = set(get_all_hostnames_as_list(context, 'template1'))

host_opts = []
for host in hosts:
host_opts.extend(['-h', host])

subprocess.check_call([
'gpscp',
'-rv',
] + host_opts + [
os.getenv('GPHOME'),
'=:{}'.format(location),
])

finally:
# Put greenplum_path.sh back the way it was.
subprocess.check_call([
'mv', '{}.bak'.format(greenplum_path), greenplum_path
])


@then('gpAdminLogs directory has no "{expected_file}" files')
def impl(context, expected_file):
log_dir = _get_gpAdminLogs_directory()
Expand Down

0 comments on commit 9b8047d

Please sign in to comment.