From 2d8358580336a83be156e54ece4e44d05b14549a Mon Sep 17 00:00:00 2001 From: Varun Arbatti Date: Thu, 29 Aug 2019 12:50:52 +1000 Subject: [PATCH] DCD-621: fixes installer tests - Test should assert for full file name for installer. Previously, tests were missing checking for -x64 installer suffix --- .../molecule/bitbucket_latest/tests/test_default.py | 8 +++++--- .../molecule/confluence_latest/tests/test_default.py | 2 +- .../molecule/default/tests/test_default.py | 2 +- .../molecule/jira_software_latest/tests/test_default.py | 2 +- .../molecule/jira_version_latest/tests/test_default.py | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py index 7157e10..55c71c6 100644 --- a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py +++ b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py @@ -24,17 +24,19 @@ def test_version_file_is_latest(host): verfile = host.file('/media/atl/bitbucket/shared/bitbucket.version') assert verfile.exists - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest") + upstream_fd = urllib.request.urlopen( + "https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest") upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] assert verfile.content.decode("UTF-8").strip() == upstream.strip() def test_latest_is_downloaded(host): - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest") + upstream_fd = urllib.request.urlopen( + "https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest") upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/bitbucket.'+upstream+'.bin') + installer = host.file('/opt/atlassian/tmp/bitbucket.' + upstream + '-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/confluence_latest/tests/test_default.py b/roles/product_install/molecule/confluence_latest/tests/test_default.py index 72a5adf..47245a4 100644 --- a/roles/product_install/molecule/confluence_latest/tests/test_default.py +++ b/roles/product_install/molecule/confluence_latest/tests/test_default.py @@ -35,6 +35,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/confluence.'+upstream+'.bin') + installer = host.file('/opt/atlassian/tmp/confluence.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/default/tests/test_default.py b/roles/product_install/molecule/default/tests/test_default.py index 18c41a2..70839b9 100644 --- a/roles/product_install/molecule/default/tests/test_default.py +++ b/roles/product_install/molecule/default/tests/test_default.py @@ -23,6 +23,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'.bin') + installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/jira_software_latest/tests/test_default.py b/roles/product_install/molecule/jira_software_latest/tests/test_default.py index ff6fa8b..63451c8 100644 --- a/roles/product_install/molecule/jira_software_latest/tests/test_default.py +++ b/roles/product_install/molecule/jira_software_latest/tests/test_default.py @@ -35,6 +35,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/jira-software.'+upstream+'.bin') + installer = host.file('/opt/atlassian/tmp/jira-software.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/jira_version_latest/tests/test_default.py b/roles/product_install/molecule/jira_version_latest/tests/test_default.py index 18c41a2..70839b9 100644 --- a/roles/product_install/molecule/jira_version_latest/tests/test_default.py +++ b/roles/product_install/molecule/jira_version_latest/tests/test_default.py @@ -23,6 +23,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'.bin') + installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root'