Skip to content

Commit

Permalink
tests: Assert some assumptions about the default role behaviour (#34)
Browse files Browse the repository at this point in the history
Check the socket state, that cockpit's web server works, and that the
role does not create a config file.
  • Loading branch information
martinpitt authored Oct 13, 2021
1 parent 2c3bf79 commit 1daeec1
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/tests_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,37 @@
- hosts: all
roles:
- linux-system-roles.cockpit

tasks:
- name: test - socket is active # noqa 303 command-instead-of-module
command: systemctl is-active cockpit.socket
changed_when: false

- name: test - socket is enabled # noqa 303 command-instead-of-module
command: systemctl is-enabled cockpit.socket
changed_when: false

- name: test - cockpit works with TLS
get_url:
dest: /run/out
url: https://localhost:9090
validate_certs: no

- name: test - no configuration file
stat:
path: /etc/cockpit/cockpit.conf
register: result
failed_when: result.stat.exists

# cleanup

- name: test - cleanup
package:
name:
# everything else depends on one of these two, so will be removed along
- cockpit-bridge
- cockpit-ws
state: absent
tags:
- always
- tests::cleanup

0 comments on commit 1daeec1

Please sign in to comment.