Fix up tests.

This commit is contained in:
Ben Kochie 2018-06-24 15:11:21 +02:00 committed by Ben Kochie
parent 08e82da1a4
commit 363d01b976
4 changed files with 27 additions and 28 deletions

View File

@ -26,5 +26,5 @@ minio_access_key: ""
minio_secret_key: ""
# Switches to disable minio server and/or minio client installation
skip_server: False
skip_client: False
skip_server: false
skip_client: false

View File

@ -12,6 +12,18 @@ def AnsibleDefaults(Ansible):
return yaml.load(stream)
@pytest.mark.parametrize("dirs", [
"/minio-test"
])
def test_directories(host, dirs):
d = host.file(dirs)
assert d.is_directory
assert d.exists
assert d.user == AnsibleDefaults['minio_user']
assert d.group == AnsibleDefaults['minio_group']
assert oct(d.mode) == '0750'
@pytest.mark.parametrize('minio_bin_var', [
'minio_server_bin',
'minio_client_bin',
@ -25,18 +37,6 @@ def test_minio_installed(File, AnsibleDefaults, minio_bin_var):
assert oct(f.mode) == '0755'
@pytest.mark.parametrize("dirs", [
"/test-minio"
])
def test_directories(host, dirs):
d = host.file(dirs)
assert d.is_directory
assert d.exists
assert d.user == AnsibleDefaults['minio_user']
assert d.group == AnsibleDefaults['minio_group']
assert oct(d.mode) == '0750'
def test_minio_service(Service):
s = Service('minio')

View File

@ -6,8 +6,8 @@
# add the python sni support to legacy python installations
- include: python_sni.yml
when: ansible_os_family == 'Debian'
and ansible_python_version | version_compare('2.6.0', '>=')
and ansible_python_version | version_compare('2.7.9', '<')
and ansible_python_version is version_compare('2.6.0', '>=')
and ansible_python_version is version_compare('2.7.9', '<')
# install additional ansible dependencies
- name: install ansible support packages

View File

@ -1,5 +1,15 @@
---
- name: create data storage directories
file:
path: "{{ item }}"
state: directory
owner: "{{ minio_user }}"
group: "{{ minio_group }}"
mode: 0750
when: minio_server_make_datadirs
with_items: "{{ minio_server_datadirs }}"
- name: download minio server
get_url:
url: "{{ minio_server_download_url }}"
@ -27,19 +37,8 @@
mode: 0750
when: ansible_service_mgr != "systemd"
- name: create data storage directories
file:
path: "{{ item }}"
state: directory
recurse: true
owner: "{{ minio_user }}"
group: "{{ minio_group }}"
mode: 0750
when: minio_server_make_datadirs
with_items: "{{ minio_server_datadirs }}"
- name: enable and start the minio service
service:
name: minio
state: started
enabled: yes
enabled: true