Browse Source

Rename scenario to extra_opts indicating flexible use

master
Dieter Verhelst 2 years ago
parent
commit
3237335b6d

+ 1
- 1
.travis.yml View File

@@ -15,8 +15,8 @@ install:
15 15
   - pip install docker
16 16
 
17 17
 env:
18
-  - SCENARIO=folders
19 18
   - SCENARIO=lamp
19
+  - SCENARIO=extra_opts
20 20
   - SCENARIO=mgt
21 21
   - SCENARIO=multiple
22 22
   - SCENARIO=clients

molecule/folders/Dockerfile.j2 → molecule/extra_opts/Dockerfile.j2 View File


molecule/folders/INSTALL.rst → molecule/extra_opts/INSTALL.rst View File


molecule/folders/molecule.yml → molecule/extra_opts/molecule.yml View File

@@ -10,7 +10,7 @@ platforms:
10 10
     networks:
11 11
       - name: ${MOLECULE_SCENARIO_NAME}-borg
12 12
     groups:
13
-      - folders
13
+      - extra_opts
14 14
   - name: ${MOLECULE_SCENARIO_NAME}-sds
15 15
     hostname: ${MOLECULE_SCENARIO_NAME}-sds
16 16
     image: debian:stretch
@@ -42,10 +42,14 @@ provisioner:
42 42
           - "/var/cache"
43 43
         borgbackup_exclude:
44 44
           - "/var/cache/apt"
45
+        borgbackup_pre_commands:
46
+          - "dpkg --get-selections"
47
+        borgbackup_post_commands:
48
+          - "apt list"
45 49
   lint:
46 50
     name: ansible-lint
47 51
 scenario:
48
-  name: folders
52
+  name: extra_opts
49 53
 verifier:
50 54
   name: testinfra
51 55
   options:

molecule/folders/playbook.yml → molecule/extra_opts/playbook.yml View File


molecule/folders/prepare.yml → molecule/extra_opts/prepare.yml View File


molecule/folders/restore.sh.j2 → molecule/extra_opts/restore.sh.j2 View File


molecule/folders/side_effect.yml → molecule/extra_opts/side_effect.yml View File


molecule/folders/tests → molecule/extra_opts/tests View File


+ 17
- 0
molecule/generic_files/tests/test_client_extra_opts.py View File

@@ -0,0 +1,17 @@
1
+testinfra_hosts = ["ansible://extra_opts"]
2
+
3
+
4
+def test_include_exclude(host):
5
+    script = host.file("/usr/local/bin/borg-backup")
6
+    assert script.contains("/var/cache")
7
+    assert script.contains("--exclude '/var/cache/apt'")
8
+    assert script.user == "root"
9
+    assert script.group == "root"
10
+
11
+
12
+def test_pre_post_commands(host):
13
+    script = host.file("/usr/local/bin/borg-backup")
14
+    assert script.contains("dpkg --get-selection")
15
+    assert script.contains("apt list")
16
+    assert script.user == "root"
17
+    assert script.group == "root"

+ 0
- 9
molecule/generic_files/tests/test_client_folders.py View File

@@ -1,9 +0,0 @@
1
-testinfra_hosts = ["ansible://folders"]
2
-
3
-
4
-def test_include_exclude(host):
5
-    script = host.file("/usr/local/bin/borg-backup")
6
-    assert script.contains("/var/cache")
7
-    assert script.contains("--exclude '/var/cache/apt'")
8
-    assert script.user == "root"
9
-    assert script.group == "root"

Loading…
Cancel
Save