mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 17:03:06 -06:00
DCD-224: Handle version override and reading any existing cached version
This commit is contained in:
@@ -6,13 +6,19 @@ driver:
|
||||
lint:
|
||||
name: yamllint
|
||||
platforms:
|
||||
- name: instance
|
||||
image: centos:7
|
||||
- name: amazon_linux2
|
||||
image: amazonlinux:2
|
||||
- name: ubuntu_lts
|
||||
image: ubuntu:bionic
|
||||
provisioner:
|
||||
name: ansible
|
||||
lint:
|
||||
name: ansible-lint
|
||||
inventory:
|
||||
links:
|
||||
group_vars: ../../../../group_vars/
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
name: flake8
|
||||
enabled: false
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
atl_product_family: "jira"
|
||||
atl_product_edition: "jira-software"
|
||||
atl_product_user: "jira"
|
||||
roles:
|
||||
- role: product_common
|
||||
- role: jira_download
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import urllib.request
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
@@ -6,9 +7,16 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
|
||||
def test_hosts_file(host):
|
||||
f = host.file('/etc/hosts')
|
||||
def test_version_downloaded(host):
|
||||
verfile = host.file('/media/atl/jira/shared/jira-software.version')
|
||||
assert verfile.exists
|
||||
|
||||
assert f.exists
|
||||
assert f.user == 'root'
|
||||
assert f.group == 'root'
|
||||
|
||||
def test_version_is_latest(host):
|
||||
verfile = host.file('/media/atl/jira/shared/jira-software.version')
|
||||
assert verfile.exists
|
||||
|
||||
upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-software/latest")
|
||||
upstream = upstream_fd.read()
|
||||
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.decode("UTF-8").strip()
|
||||
|
||||
@@ -21,3 +21,4 @@ verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
name: flake8
|
||||
enabled: false
|
||||
@@ -5,6 +5,7 @@
|
||||
atl_product_family: "jira"
|
||||
atl_product_edition: "jira-software"
|
||||
atl_product_user: "jira"
|
||||
atl_product_version: "7.13.2"
|
||||
roles:
|
||||
- role: product_common
|
||||
- role: jira_download
|
||||
@@ -11,11 +11,10 @@ def test_version_downloaded(host):
|
||||
verfile = host.file('/media/atl/jira/shared/jira-software.version')
|
||||
assert verfile.exists
|
||||
|
||||
|
||||
def test_version_is_latest(host):
|
||||
verfile = host.file('/media/atl/jira/shared/jira-software.version')
|
||||
assert verfile.exists
|
||||
|
||||
upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-software/latest")
|
||||
upstream = upstream_fd.read()
|
||||
assert verfile.content.decode("UTF-8").strip() == "7.13.2"
|
||||
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.decode("UTF-8").strip()
|
||||
Reference in New Issue
Block a user