Changeset - 40b5747adcb3
[Not reviewed]
0 4 0
Branko Majic (branko) - 6 years ago 2018-05-27 20:16:32
branko@majic.rs
MAR-129: Updated backup_server role tests:

- Move the 'ss' utility out of place in order to be able to test if
sockets are
open (seehttps://github.com/philpep/testinfra/pull/320).
- Updated tests to use correct mechanism for setting-up list of
machines where the tests should be run.
4 files changed with 13 insertions and 4 deletions:
0 comments (0 inline, 0 general)
roles/common/molecule/default/prepare.yml
Show inline comments
 
@@ -23,3 +23,10 @@
 
      apt:
 
        name: net-tools
 
        state: present
 

	
 
- hosts: parameters-mandatory,parameters-optional
 
  become: true
 
  tasks:
 

	
 
  - name: Rename the ss utility (see https://github.com/philpep/testinfra/pull/320)
 
    command: "mv /bin/ss /bin/ss.bak"
roles/common/molecule/default/tests/test_default.py
Show inline comments
 
import os
 

	
 
import testinfra.utils.ansible_runner
 

	
 

	
 
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
 
    '.molecule/ansible_inventory.yml').get_hosts('all')
 
testinfra_hosts.remove("helper")
 
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts(['parameters-mandatory', 'parameters-optional'])
 

	
 

	
 
def test_pam_umask(host):
roles/common/molecule/default/tests/test_parameters_mandatory.py
Show inline comments
 
import os
 
import socket
 

	
 
import paramiko
 
@@ -6,7 +7,7 @@ import testinfra.utils.ansible_runner
 

	
 

	
 
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
 
    '.molecule/ansible_inventory.yml').get_hosts('parameters-mandatory')
 
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts(['parameters-mandatory'])
 

	
 

	
 
def test_apt_proxy(host):
roles/common/molecule/default/tests/test_parameters_optional.py
Show inline comments
 
@@ -8,7 +8,7 @@ import testinfra.utils.ansible_runner
 

	
 

	
 
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
 
    '.molecule/ansible_inventory.yml').get_hosts('parameters-optional')
 
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts(['parameters-optional'])
 

	
 

	
 
def test_apt_proxy(host):
0 comments (0 inline, 0 general)