mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
DCD-224: Fix up some tests after refactoring.
This commit is contained in:
@@ -9,3 +9,4 @@ rules:
|
|||||||
level: error
|
level: error
|
||||||
line-length: disable
|
line-length: disable
|
||||||
truthy: disable
|
truthy: disable
|
||||||
|
trailing-spaces: false
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
|
vars:
|
||||||
|
ansible_ec2_instance_id: "NONE"
|
||||||
roles:
|
roles:
|
||||||
- role: aws_common
|
- role: aws_common
|
||||||
|
|||||||
@@ -11,4 +11,3 @@
|
|||||||
- name: Use EC2 instance ID for cluster node ID
|
- name: Use EC2 instance ID for cluster node ID
|
||||||
set_fact:
|
set_fact:
|
||||||
atl_cluster_node_id: "{{ ansible_ec2_instance_id }}"
|
atl_cluster_node_id: "{{ ansible_ec2_instance_id }}"
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
vars:
|
vars:
|
||||||
atl_product_user: "testuser"
|
atl_product_user: "testuser"
|
||||||
atl_product_home: "/opt/atlassian/product"
|
atl_product_home: "/opt/atlassian/product"
|
||||||
|
atl_product_installation_base: "/opt/atlassian/product/install"
|
||||||
atl_installer_temp: "/opt/atlassian/temp"
|
atl_installer_temp: "/opt/atlassian/temp"
|
||||||
atl_product_home_shared: "/media/atl/jira/shared"
|
atl_product_home_shared: "/media/atl/jira/shared"
|
||||||
|
atl_product_shared_plugins: "/media/atl/jira/shared/plugins/"
|
||||||
roles:
|
roles:
|
||||||
- role: linux_common
|
- role: linux_common
|
||||||
- role: product_common
|
- role: product_common
|
||||||
|
|||||||
@@ -8,33 +8,33 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||||
|
|
||||||
def test_version_downloaded(host):
|
def test_version_downloaded(host):
|
||||||
verfile = host.file('/media/atl/confluence/shared/confluence.version')
|
verfile = host.file('/media/atl/stash/shared/bitbucket.version')
|
||||||
assert verfile.exists
|
assert verfile.exists
|
||||||
|
|
||||||
def test_symlink_created(host):
|
def test_symlink_created(host):
|
||||||
target = host.file('/opt/atlassian/confluence/current')
|
target = host.file('/opt/atlassian/bitbucket/current')
|
||||||
assert target.exists
|
assert target.exists
|
||||||
assert target.is_symlink
|
assert target.is_symlink
|
||||||
|
|
||||||
def test_unpacked(host):
|
def test_unpacked(host):
|
||||||
verfile = host.file('/opt/atlassian/confluence/current/bin/catalina.sh')
|
verfile = host.file('/opt/atlassian/bitbucket/current/bin/start-bitbucket.sh')
|
||||||
assert verfile.exists
|
assert verfile.exists
|
||||||
|
|
||||||
def test_version_file_is_latest(host):
|
def test_version_file_is_latest(host):
|
||||||
verfile = host.file('/media/atl/confluence/shared/confluence.version')
|
verfile = host.file('/media/atl/stash/shared/bitbucket.version')
|
||||||
assert verfile.exists
|
assert verfile.exists
|
||||||
|
|
||||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/versions/latest")
|
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest")
|
||||||
upstream_json = json.load(upstream_fd)
|
upstream_json = json.load(upstream_fd)
|
||||||
upstream = upstream_json['version']
|
upstream = upstream_json['version']
|
||||||
|
|
||||||
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
|
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
|
||||||
|
|
||||||
def test_latest_is_downloaded(host):
|
def test_latest_is_downloaded(host):
|
||||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/versions/latest")
|
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest")
|
||||||
upstream_json = json.load(upstream_fd)
|
upstream_json = json.load(upstream_fd)
|
||||||
upstream = upstream_json['version']
|
upstream = upstream_json['version']
|
||||||
|
|
||||||
installer = host.file('/opt/atlassian/tmp/confluence.'+upstream+'.tar.gz')
|
installer = host.file('/opt/atlassian/tmp/bitbucket.'+upstream+'.tar.gz')
|
||||||
assert installer.exists
|
assert installer.exists
|
||||||
assert installer.user == 'root'
|
assert installer.user == 'root'
|
||||||
|
|||||||
Reference in New Issue
Block a user