Merged in ITPLT-4737-remove-remaining-marketplace-v2-api-calls (pull request #239)

ITPLT-4737 Migrate remaining Marketplace tests to v3

Approved-by: Geoff Jacobs
This commit is contained in:
Lee Goolsbee
2026-09-09 16:52:34 +00:00
9 changed files with 289 additions and 209 deletions

View File

@@ -1,43 +0,0 @@
import os
import urllib.request
import json
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_version_downloaded(host):
verfile = host.file('/media/atl/confluence/shared/confluence.version')
assert verfile.exists
def test_symlink_created(host):
target = host.file('/opt/atlassian/confluence/current')
assert target.exists
assert target.is_symlink
def test_unpacked(host):
verfile = host.file('/opt/atlassian/confluence/current/bin/catalina.sh')
assert verfile.exists
def test_version_file_is_latest(host):
verfile = host.file('/media/atl/confluence/shared/confluence.version')
assert verfile.exists
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/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/confluence/versions/latest")
upstream_json = json.load(upstream_fd)
upstream = upstream_json['version']
installer = host.file('/opt/atlassian/tmp/confluence.'+upstream+'.tar.gz')
assert installer.exists
assert installer.user == 'root'
https://product-downloads.atlassian.com/software/bitbucket/downloads/atlassian-bitbucket-6.2.0.tar.gz
https://product-downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-6.2.0.tar.gz

View File

@@ -1,55 +1,65 @@
import json
import os
from six.moves import urllib
import json
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
MARKETPLACE_LATEST_VERSION_URL = (
"https://marketplace.atlassian.com/rest/3/parent-software/bitbucket/versions"
"?state=ACTIVE&limit=1")
def get_latest_version():
req = urllib.request.Request(MARKETPLACE_LATEST_VERSION_URL)
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
try:
upstream_json = json.load(upstream_fd)
finally:
upstream_fd.close()
return upstream_json['versions'][0]['versionNumber']
latest_version = get_latest_version()
def test_version_downloaded(host):
verfile = host.file('/media/atl/bitbucket/shared/bitbucket.version')
assert verfile.exists
def test_symlink_created(host):
target = host.file('/opt/atlassian/bitbucket/current')
assert target.exists
assert target.is_symlink
def test_unpacked(host):
verfile = host.file('/opt/atlassian/bitbucket/current/bin/start-bitbucket.sh')
assert verfile.exists
def test_version_file_is_latest(host):
verfile = host.file('/media/atl/bitbucket/shared/bitbucket.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == latest_version.strip()
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/bitbucket/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
def test_latest_is_downloaded(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/bitbucket/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
installer = host.file('/media/atl/downloads/bitbucket.' + upstream + '-x64.bin')
installer = host.file(
'/media/atl/downloads/bitbucket.' + latest_version + '-x64.bin')
assert installer.exists
assert installer.user == 'root'
def test_completed_lockfile(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/bitbucket/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
lockfile = host.file('/media/atl/downloads/bitbucket.' + upstream + '-x64.bin_completed')
def test_completed_lockfile(host):
lockfile = host.file(
'/media/atl/downloads/bitbucket.'
+ latest_version
+ '-x64.bin_completed')
assert lockfile.exists
assert lockfile.user == 'root'

View File

@@ -1,55 +1,67 @@
import json
import os
from six.moves import urllib
import json
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
MARKETPLACE_LATEST_VERSION_URL = (
"https://marketplace.atlassian.com/rest/3/parent-software/confluence/versions"
"?state=ACTIVE&limit=1")
def get_latest_version():
req = urllib.request.Request(MARKETPLACE_LATEST_VERSION_URL)
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
try:
upstream_json = json.load(upstream_fd)
finally:
upstream_fd.close()
return upstream_json['versions'][0]['versionNumber']
latest_version = get_latest_version()
def test_version_downloaded(host):
verfile = host.file('/media/atl/confluence/shared-home/confluence.version')
verfile = host.file(
'/media/atl/confluence/shared-home/confluence.version')
assert verfile.exists
def test_symlink_created(host):
target = host.file('/opt/atlassian/confluence/current')
assert target.exists
assert target.is_symlink
def test_unpacked(host):
verfile = host.file('/opt/atlassian/confluence/current/bin/catalina.sh')
assert verfile.exists
def test_version_file_is_latest(host):
verfile = host.file('/media/atl/confluence/shared-home/confluence.version')
verfile = host.file(
'/media/atl/confluence/shared-home/confluence.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == latest_version.strip()
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/confluence/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
def test_latest_is_downloaded(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/confluence/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
installer = host.file('/media/atl/downloads/confluence.'+upstream+'-x64.bin')
installer = host.file(
'/media/atl/downloads/confluence.' + latest_version + '-x64.bin')
assert installer.exists
assert installer.user == 'root'
def test_completed_lockfile(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/confluence/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
lockfile = host.file('/media/atl/downloads/confluence.'+upstream+'-x64.bin_completed')
def test_completed_lockfile(host):
lockfile = host.file(
'/media/atl/downloads/confluence.'
+ latest_version
+ '-x64.bin_completed')
assert lockfile.exists
assert lockfile.user == 'root'

View File

@@ -1,55 +1,65 @@
import json
import os
from six.moves import urllib
import json
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
MARKETPLACE_LATEST_VERSION_URL = (
"https://marketplace.atlassian.com/rest/3/parent-software/crowd/versions"
"?state=ACTIVE&limit=1")
def get_latest_version():
req = urllib.request.Request(MARKETPLACE_LATEST_VERSION_URL)
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
try:
upstream_json = json.load(upstream_fd)
finally:
upstream_fd.close()
return upstream_json['versions'][0]['versionNumber']
latest_version = get_latest_version()
def test_version_downloaded(host):
verfile = host.file('/media/atl/crowd/shared/crowd.version')
assert verfile.exists
def test_symlink_created(host):
target = host.file('/opt/atlassian/crowd/current')
assert target.exists
assert target.is_symlink
def test_unpacked(host):
verfile = host.file('/opt/atlassian/crowd/current/start_crowd.sh')
assert verfile.exists
def test_version_file_is_latest(host):
verfile = host.file('/media/atl/crowd/shared/crowd.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == latest_version.strip()
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/crowd/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
def test_latest_is_downloaded(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/crowd/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
installer = host.file('/media/atl/downloads/crowd.' + upstream + '.tar.gz')
installer = host.file(
'/media/atl/downloads/crowd.' + latest_version + '.tar.gz')
assert installer.exists
assert installer.user == 'root'
def test_completed_lockfile(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/crowd/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
lockfile = host.file('/media/atl/downloads/crowd.' + upstream + '.tar.gz_completed')
def test_completed_lockfile(host):
lockfile = host.file(
'/media/atl/downloads/crowd.'
+ latest_version
+ '.tar.gz_completed')
assert lockfile.exists
assert lockfile.user == 'root'

View File

@@ -1,47 +1,55 @@
import json
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')
MARKETPLACE_LATEST_VERSION_URL = (
"https://marketplace.atlassian.com/rest/3/parent-software/jira/versions"
"?state=ACTIVE&limit=1")
def get_latest_version():
req = urllib.request.Request(MARKETPLACE_LATEST_VERSION_URL)
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
try:
upstream_json = json.load(upstream_fd)
finally:
upstream_fd.close()
return upstream_json['versions'][0]['versionNumber']
latest_version = get_latest_version()
def test_version_file_is_latest(host):
verfile = host.file('/media/atl/jira/shared/jira-core.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == latest_version.strip()
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
def test_latest_is_downloaded(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
installer = host.file('/media/atl/downloads/jira-core.'+upstream+'-x64.bin')
installer = host.file(
'/media/atl/downloads/jira-core.' + latest_version + '-x64.bin')
assert installer.exists
assert installer.user == 'root'
def test_completed_lockfile(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
lockfile = host.file('/media/atl/downloads/jira-core.'+upstream+'-x64.bin_completed')
def test_completed_lockfile(host):
lockfile = host.file(
'/media/atl/downloads/jira-core.'
+ latest_version
+ '-x64.bin_completed')
assert lockfile.exists
assert lockfile.user == 'root'
def test_servicedesk_not_installed(host):
plugins = host.file('/media/atl/jira/shared/plugins/installed-plugins')
assert (not plugins.exists) or (len(list(filter(lambda p: 'servicedesk' in p, jars))) == 0)
assert (not plugins.exists) or all(
'servicedesk' not in plugin for plugin in plugins.listdir())

View File

@@ -1,55 +1,68 @@
import json
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')
MARKETPLACE_LATEST_VERSION_URL = (
"https://marketplace.atlassian.com/rest/3/parent-software/jira/versions"
"?state=ACTIVE&limit=1")
def get_latest_version():
req = urllib.request.Request(MARKETPLACE_LATEST_VERSION_URL)
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
try:
upstream_json = json.load(upstream_fd)
finally:
upstream_fd.close()
return upstream_json['versions'][0]['versionNumber']
latest_version = get_latest_version()
def test_version_downloaded(host):
verfile = host.file('/media/atl/jira/shared/jira-software.version')
assert verfile.exists
def test_symlink_created(host):
target = host.file('/opt/atlassian/jira-software/current')
assert target.exists
assert target.is_symlink
def test_unpacked(host):
verfile = host.file('/opt/atlassian/jira-software/current/bin/catalina.sh')
verfile = host.file(
'/opt/atlassian/jira-software/current/bin/catalina.sh')
assert verfile.exists
def test_version_file_is_latest(host):
verfile = host.file('/media/atl/jira/shared/jira-software.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == latest_version.strip()
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
def test_latest_is_downloaded(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
installer = host.file('/media/atl/downloads/jira-software.'+upstream+'-x64.bin')
installer = host.file(
'/media/atl/downloads/jira-software.'
+ latest_version
+ '-x64.bin')
assert installer.exists
assert installer.user == 'root'
def test_completed_lockfile(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
lockfile = host.file('/media/atl/downloads/jira-software.'+upstream+'-x64.bin_completed')
def test_completed_lockfile(host):
lockfile = host.file(
'/media/atl/downloads/jira-software.'
+ latest_version
+ '-x64.bin_completed')
assert lockfile.exists
assert lockfile.user == 'root'

View File

@@ -1,43 +1,49 @@
import json
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')
MARKETPLACE_LATEST_VERSION_URL = (
"https://marketplace.atlassian.com/rest/3/parent-software/jira/versions"
"?state=ACTIVE&limit=1")
def get_latest_version():
req = urllib.request.Request(MARKETPLACE_LATEST_VERSION_URL)
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
try:
upstream_json = json.load(upstream_fd)
finally:
upstream_fd.close()
return upstream_json['versions'][0]['versionNumber']
latest_version = get_latest_version()
def test_version_file_is_latest(host):
verfile = host.file('/media/atl/jira/shared/jira-core.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == latest_version.strip()
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
def test_latest_is_downloaded(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
installer = host.file('/media/atl/downloads/jira-core.'+upstream+'.tar.gz')
installer = host.file(
'/media/atl/downloads/jira-core.' + latest_version + '.tar.gz')
assert installer.exists
assert installer.user == 'root'
def test_completed_lockfile(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
lockfile = host.file('/media/atl/downloads/jira-core.'+upstream+'.tar.gz_completed')
def test_completed_lockfile(host):
lockfile = host.file(
'/media/atl/downloads/jira-core.'
+ latest_version
+ '.tar.gz_completed')
assert lockfile.exists
assert lockfile.user == 'root'

View File

@@ -1,43 +1,49 @@
import json
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')
MARKETPLACE_LATEST_VERSION_URL = (
"https://marketplace.atlassian.com/rest/3/parent-software/jira/versions"
"?state=ACTIVE&limit=1")
def get_latest_version():
req = urllib.request.Request(MARKETPLACE_LATEST_VERSION_URL)
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
try:
upstream_json = json.load(upstream_fd)
finally:
upstream_fd.close()
return upstream_json['versions'][0]['versionNumber']
latest_version = get_latest_version()
def test_version_file_is_latest(host):
verfile = host.file('/media/atl/jira/shared/jira-core.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == latest_version.strip()
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
def test_latest_is_downloaded(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
installer = host.file('/media/atl/downloads/jira-core.'+upstream+'-x64.bin')
installer = host.file(
'/media/atl/downloads/jira-core.' + latest_version + '-x64.bin')
assert installer.exists
assert installer.user == 'root'
def test_completed_lockfile(host):
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions")
req.add_header('User-Agent', 'ansible-httpget')
upstream_fd = urllib.request.urlopen(req)
upstream_json = json.load(upstream_fd)
upstream = upstream_json['_embedded']['versions'][0]['name']
lockfile = host.file('/media/atl/downloads/jira-core.'+upstream+'-x64.bin_completed')
def test_completed_lockfile(host):
lockfile = host.file(
'/media/atl/downloads/jira-core.'
+ latest_version
+ '-x64.bin_completed')
assert lockfile.exists
assert lockfile.user == 'root'

View File

@@ -4,41 +4,99 @@ from six.moves import urllib
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def get_latest():
req = urllib.request.Request("https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions/latest")
MARKETPLACE_API_BASE_URL = "https://marketplace.atlassian.com/rest/3"
JSM_APP_KEY = "com.atlassian.servicedesk.application"
JSM_HOSTING_PREFERENCE = ("datacenter", "server")
def get_json(url):
req = urllib.request.Request(url)
req.add_header('User-Agent', 'ansible-httpget')
data = urllib.request.urlopen(req)
meta = json.loads(data.read().decode("UTF-8"))
return meta['name']
try:
return json.loads(data.read().decode("UTF-8"))
finally:
data.close()
def get_json_if_available(url):
try:
return get_json(url)
except urllib.error.HTTPError as error:
if error.code == 404:
return None
raise
def get_latest():
app_software_ids = []
for hosting in JSM_HOSTING_PREFERENCE:
app_software = get_json_if_available(
MARKETPLACE_API_BASE_URL
+ "/app-software/app-key/"
+ JSM_APP_KEY
+ "?hosting="
+ hosting)
if app_software is None:
continue
if not isinstance(app_software, list):
app_software = [app_software]
app_software_ids.extend(
item['appSoftwareId']
for item in app_software
if item.get('appSoftwareId') and item.get('archived') is False)
for app_software_id in dict.fromkeys(app_software_ids):
version_info = get_json_if_available(
MARKETPLACE_API_BASE_URL
+ "/app-software/"
+ app_software_id
+ "/versions?parentSoftwareId=jira&state=ACTIVE&limit=1")
if version_info and version_info.get('versions'):
return version_info['versions'][0]['versionNumber']
raise AssertionError(
"Marketplace returned no active JSM version for app key " + JSM_APP_KEY)
sd = get_latest()
def test_version_is_correct(host):
verfile = host.file('/media/atl/jira/shared/jira-servicedesk.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == sd
def test_is_downloaded(host):
installer = host.file('/media/atl/downloads/servicedesk.'+sd+'-x64.bin')
assert installer.exists
assert installer.user == 'root'
def test_completed_lockfile(host):
lockfile = host.file('/media/atl/downloads/servicedesk.'+sd+'-x64.bin_completed')
assert lockfile.exists
assert lockfile.user == 'root'
def test_is_unpacked(host):
installer = host.file('/opt/atlassian/jira-servicedesk/'+sd)
assert installer.exists
assert installer.is_directory
assert installer.user == 'jira'
def test_plugin_is_present(host):
installer = host.file('/opt/atlassian/jira-servicedesk/current/atlassian-jira/WEB-INF/application-installation/jira-servicedesk-application/jira-servicedesk-application-'+sd+'.jar')
installer = host.file(
'/opt/atlassian/jira-servicedesk/current/atlassian-jira/WEB-INF/'
'application-installation/jira-servicedesk-application/'
'jira-servicedesk-application-' + sd + '.jar')
assert installer.exists
assert installer.user == 'jira'