aboutsummaryrefslogtreecommitdiffhomepage
path: root/molecule
diff options
context:
space:
mode:
Diffstat (limited to 'molecule')
-rw-r--r--molecule/features/INSTALL.rst15
-rw-r--r--molecule/features/converge.yml7
-rw-r--r--molecule/features/host_vars/instance-features.yml11
-rw-r--r--molecule/features/molecule.yml21
-rw-r--r--molecule/features/prepare.yml19
-rw-r--r--molecule/features/verify.yml40
6 files changed, 113 insertions, 0 deletions
diff --git a/molecule/features/INSTALL.rst b/molecule/features/INSTALL.rst
new file mode 100644
index 0000000..c615318
--- /dev/null
+++ b/molecule/features/INSTALL.rst
@@ -0,0 +1,15 @@
1*******
2Delegated driver installation guide
3*******
4
5Requirements
6============
7
8This driver is delegated to the developer. Up to the developer to implement
9requirements.
10
11Install
12=======
13
14This driver is delegated to the developer. Up to the developer to implement
15requirements.
diff --git a/molecule/features/converge.yml b/molecule/features/converge.yml
new file mode 100644
index 0000000..37f6dea
--- /dev/null
+++ b/molecule/features/converge.yml
@@ -0,0 +1,7 @@
1---
2- name: Converge
3 hosts: all
4 tasks:
5 - name: "Include netdata-straight"
6 include_role:
7 name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
diff --git a/molecule/features/host_vars/instance-features.yml b/molecule/features/host_vars/instance-features.yml
new file mode 100644
index 0000000..fe33d25
--- /dev/null
+++ b/molecule/features/host_vars/instance-features.yml
@@ -0,0 +1,11 @@
1netdata_installer: kickstart-static64
2netdata_extra_config:
3 - name: test user
4 extra_groups:
5 - fakegroup
6 read_files:
7 - /etc/fakefile.conf
8 pip_dependencies:
9 - test-pip-install
10 apt_dependencies:
11 - hxtools
diff --git a/molecule/features/molecule.yml b/molecule/features/molecule.yml
new file mode 100644
index 0000000..ae3d948
--- /dev/null
+++ b/molecule/features/molecule.yml
@@ -0,0 +1,21 @@
1---
2dependency:
3 name: galaxy
4driver:
5 name: docker
6platforms:
7 - name: instance-features
8 image: jrei/systemd-ubuntu:20.04
9 privileged: true
10 command: /lib/systemd/systemd
11 tmpfs:
12 - /run
13 volumes:
14 - /sys/fs/cgroup:/sys/fs/cgroup:ro
15provisioner:
16 name: ansible
17 inventory:
18 links:
19 host_vars: host_vars/
20verifier:
21 name: ansible
diff --git a/molecule/features/prepare.yml b/molecule/features/prepare.yml
new file mode 100644
index 0000000..b4e8439
--- /dev/null
+++ b/molecule/features/prepare.yml
@@ -0,0 +1,19 @@
1- name: Prepare
2 hosts: all
3 tasks:
4 - name: Update apt cache
5 apt:
6 update_cache: yes
7 become: true
8 when: ansible_os_family == 'Debian'
9 - name: Create fakegroup
10 group:
11 name: fakegroup
12 state: present
13 - name: Create fake conf file
14 copy:
15 content: "Test file"
16 dest: /etc/fakefile.conf
17 owner: root
18 group: root
19 mode: 0600
diff --git a/molecule/features/verify.yml b/molecule/features/verify.yml
new file mode 100644
index 0000000..9f64471
--- /dev/null
+++ b/molecule/features/verify.yml
@@ -0,0 +1,40 @@
1---
2# This is an example playbook to execute Ansible tests.
3- name: Verify
4 hosts: all
5 gather_facts: false
6 tasks:
7 - name: Get netdata groups
8 command: id -Gzn
9 register: netdata_groups_st
10 become: true
11 become_user: netdata
12 changed_when: false
13
14 - name: Check file access
15 stat:
16 path: /etc/fakefile.conf
17 become: yes
18 become_user: netdata
19 register: netdata_stat_st
20
21 - name: Check pip package
22 command: test-pip-install
23 become: yes
24 become_user: netdata
25 changed_when: false
26
27 - name: Check apt package
28 command: rot13
29 args:
30 stdin: test
31 changed_when: false
32
33 - name: Asserts config was applied
34 assert:
35 that:
36 - "'fakegroup' in group_array"
37 - netdata_can_read
38 vars:
39 group_array: "{{ netdata_groups_st.stdout.split('\0') | reject('eq','') | list }}"
40 netdata_can_read: "{{ netdata_stat_st.stat.readable }}"