diff --git a/.travis.yml b/.travis.yml index 7aec557..29b9480 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ install: - pip install docker env: - - SCENARIO=folders - SCENARIO=lamp + - SCENARIO=extra_opts - SCENARIO=mgt - SCENARIO=multiple - SCENARIO=clients diff --git a/molecule/folders/Dockerfile.j2 b/molecule/extra_opts/Dockerfile.j2 similarity index 100% rename from molecule/folders/Dockerfile.j2 rename to molecule/extra_opts/Dockerfile.j2 diff --git a/molecule/folders/INSTALL.rst b/molecule/extra_opts/INSTALL.rst similarity index 100% rename from molecule/folders/INSTALL.rst rename to molecule/extra_opts/INSTALL.rst diff --git a/molecule/folders/molecule.yml b/molecule/extra_opts/molecule.yml similarity index 87% rename from molecule/folders/molecule.yml rename to molecule/extra_opts/molecule.yml index 4881e9e..dc1c80b 100644 --- a/molecule/folders/molecule.yml +++ b/molecule/extra_opts/molecule.yml @@ -10,7 +10,7 @@ platforms: networks: - name: ${MOLECULE_SCENARIO_NAME}-borg groups: - - folders + - extra_opts - name: ${MOLECULE_SCENARIO_NAME}-sds hostname: ${MOLECULE_SCENARIO_NAME}-sds image: debian:stretch @@ -42,10 +42,14 @@ provisioner: - "/var/cache" borgbackup_exclude: - "/var/cache/apt" + borgbackup_pre_commands: + - "dpkg --get-selections" + borgbackup_post_commands: + - "apt list" lint: name: ansible-lint scenario: - name: folders + name: extra_opts verifier: name: testinfra options: diff --git a/molecule/folders/playbook.yml b/molecule/extra_opts/playbook.yml similarity index 100% rename from molecule/folders/playbook.yml rename to molecule/extra_opts/playbook.yml diff --git a/molecule/folders/prepare.yml b/molecule/extra_opts/prepare.yml similarity index 100% rename from molecule/folders/prepare.yml rename to molecule/extra_opts/prepare.yml diff --git a/molecule/folders/restore.sh.j2 b/molecule/extra_opts/restore.sh.j2 similarity index 100% rename from molecule/folders/restore.sh.j2 rename to molecule/extra_opts/restore.sh.j2 diff --git a/molecule/folders/side_effect.yml b/molecule/extra_opts/side_effect.yml similarity index 100% rename from molecule/folders/side_effect.yml rename to molecule/extra_opts/side_effect.yml diff --git a/molecule/folders/tests b/molecule/extra_opts/tests similarity index 100% rename from molecule/folders/tests rename to molecule/extra_opts/tests diff --git a/molecule/generic_files/tests/test_client_extra_opts.py b/molecule/generic_files/tests/test_client_extra_opts.py new file mode 100644 index 0000000..28cd2d3 --- /dev/null +++ b/molecule/generic_files/tests/test_client_extra_opts.py @@ -0,0 +1,17 @@ +testinfra_hosts = ["ansible://extra_opts"] + + +def test_include_exclude(host): + script = host.file("/usr/local/bin/borg-backup") + assert script.contains("/var/cache") + assert script.contains("--exclude '/var/cache/apt'") + assert script.user == "root" + assert script.group == "root" + + +def test_pre_post_commands(host): + script = host.file("/usr/local/bin/borg-backup") + assert script.contains("dpkg --get-selection") + assert script.contains("apt list") + assert script.user == "root" + assert script.group == "root" diff --git a/molecule/generic_files/tests/test_client_folders.py b/molecule/generic_files/tests/test_client_folders.py deleted file mode 100644 index c1c692f..0000000 --- a/molecule/generic_files/tests/test_client_folders.py +++ /dev/null @@ -1,9 +0,0 @@ -testinfra_hosts = ["ansible://folders"] - - -def test_include_exclude(host): - script = host.file("/usr/local/bin/borg-backup") - assert script.contains("/var/cache") - assert script.contains("--exclude '/var/cache/apt'") - assert script.user == "root" - assert script.group == "root"