diff --git a/tests/drone.yml b/tests/drone.yml new file mode 100644 index 0000000..a2af985 --- /dev/null +++ b/tests/drone.yml @@ -0,0 +1,87 @@ +--- +- hosts: localhost + connection: local + gather_facts: no + + tasks: + - name: wait for nextcloud (pull image and install) + get_url: + url: http://nextcloud21 + dest: /tmp/test + register: status + until: status.failed == false + delay: 5 + retries: 50 + + - name: test + block: + ########### prepair + - name: Download ansible.svg from wikipedia + get_url: + url: https://de.wikipedia.org/wiki/Ansible#/media/Datei:Ansible_logo.svg + dest: /tmp/ansible.svg + + ########### test + - name: upload file on nextcloud + markuman.nextcloud.file: + mode: put + src: /tmp/ansible.svg + dest: ansible.svg + ssl_mode: http + register: out_state + + - name: state must be changed + assert: + that: + - out_state is changed + + - name: GET file from nextcloud + markuman.nextcloud.file: + mode: get + src: ansible.svg + dest: /tmp/tmp.svg + ssl_mode: http + register: out_state + + - name: state must be changed + assert: + that: + - out_state is changed + + - name: OK fetch file from nextcloud + markuman.nextcloud.file: + mode: get + src: ansible.svg + dest: /tmp/ansible.svg + overwritten: different + ssl_mode: http + register: out_state + + - name: state must not be changed + assert: + that: + - out_state is not changed + + - name: delete file on nextcloud + markuman.nextcloud.file: + mode: delete + src: ansible.svg + ssl_mode: http + register: out_state + + - name: state must be changed + assert: + that: + - out_state is changed + + - name: immutable delete file on nextcloud + markuman.nextcloud.file: + mode: delete + src: ansible.svg + ssl_mode: http + register: out_state + + - name: state must not be changed + assert: + that: + - out_state is not changed