DCD-484: Add ability to install from the tarball rather than the installer.

This commit is contained in:
Steve Smith
2019-07-11 12:42:28 +10:00
parent 26d2e4cbd4
commit 94a16a6731
8 changed files with 127 additions and 17 deletions

View File

@@ -0,0 +1,28 @@
import os
from six.moves import urllib
import testinfra.utils.ansible_runner
import json
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_version_file_is_latest(host):
verfile = host.file('/media/atl/jira/shared/jira-core.version')
assert verfile.exists
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/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/jira/versions/latest")
upstream_json = json.load(upstream_fd)
upstream = upstream_json['version']
installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'.bin')
assert installer.exists
assert installer.user == 'root'