Skip to content

Commit

Permalink
fix: node_exporter - Add test for ProtectHome
Browse files Browse the repository at this point in the history
Add a tmpfs mount to the node_exporter testing to make sure ProtectHome
is changed.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed May 10, 2023
1 parent 27bd8f8 commit f9abfe7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ rules:

ignore: |
changelogs/.plugin-cache.yaml
changelogs/changelog.yaml
6 changes: 6 additions & 0 deletions molecule-requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
collections:
- name: https://github.com/ansible-collections/ansible.posix.git
type: git
- name: https://github.com/ansible-collections/community.docker.git
type: git
14 changes: 14 additions & 0 deletions roles/node_exporter/molecule/alternative/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,17 @@
csr_path: "/tmp/tls.csr"
privatekey_path: "/tmp/tls.key"
provider: selfsigned

- name: Create test mount directory
ansible.builtin.file:
path: /home/test
state: directory
owner: root
group: root
mode: 0755

- name: Mount test filesystem
ansible.posix.mount:
path: /home/test
src: tmpfs
fstype: tmpfs
8 changes: 4 additions & 4 deletions tests/integration/molecule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ fi
# Install ansible version specific requirements
if [ "$(printf '%s\n' "2.12" "$ansible_version" | sort -V | head -n1)" = "2.12" ]; then
python -m pip install molecule molecule-plugins[docker]
ansible-galaxy collection install git+https://github.com/ansible-collections/community.docker.git
ansible-galaxy collection install -r "$collection_root/requirements.yml"
ansible-galaxy collection install -r "${collection_root}/molecule-requirements.yml"
ansible-galaxy collection install -r "${collection_root}/requirements.yml"
elif [ "$(printf '%s\n' "2.10" "$ansible_version" | sort -V | head -n1)" = "2.10" ]; then
python -m pip install molecule molecule-docker
ansible-galaxy collection install git+https://github.com/ansible-collections/community.docker.git
ansible-galaxy collection install -r "$collection_root/requirements.yml"
ansible-galaxy collection install -r "${collection_root}/molecule-requirements.yml"
ansible-galaxy collection install -r "${collection_root}/requirements.yml"
else
python -m pip install molecule molecule-docker
req_dir=$(mktemp -d)
Expand Down

0 comments on commit f9abfe7

Please sign in to comment.