From 3a2e8e86d180b8d584df259929fbf60bdf371752 Mon Sep 17 00:00:00 2001 From: Stephane Armanet <stephanearmanet@esss.lu.se> Date: Thu, 13 Sep 2018 08:57:58 +0200 Subject: [PATCH] add lab route and vbox molecule test plateforme --- molecule/default/molecule.yml | 12 ++++++++++-- molecule/default/prepare.yml | 1 + molecule/default/tests/test_default.py | 10 ++++++++++ roles/requirements.yml | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 5b9c631..90728bd 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -18,7 +18,15 @@ verifier: lint: name: flake8 driver: - name: docker + name: vagrant + provider: + name: virtualbox platforms: - name: ics-ans-gpn-config-default - image: registry.esss.lu.se/ics-docker/centos-systemd:7 + box: centos/7 + memory: 512 + cpus: 1 + instance_raw_config_args: + - "vbguest.auto_update = false" + groups: + - default_group diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index fef089e..708896b 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -2,6 +2,7 @@ - name: Prepare hosts: all gather_facts: false + become: true tasks: - name: create /etc/samba directory file: diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py index c7a5ee4..b691864 100644 --- a/molecule/default/tests/test_default.py +++ b/molecule/default/tests/test_default.py @@ -8,3 +8,13 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def test_samba_interfaces(host): file = host.file("/etc/samba/interfaces.conf") assert file.contains("interfaces = eth0") + + +def test_route_interfaces(host): + file = host.file("/etc/sysconfig/network-scripts/route-eth0") + assert file.contains("172.30.0.0") + + +def test_route_exist(host): + cmd = host.run("/usr/sbin/ip route list") + assert "172.30.0.0" in cmd.stdout diff --git a/roles/requirements.yml b/roles/requirements.yml index 1ded9c2..37ac7d8 100644 --- a/roles/requirements.yml +++ b/roles/requirements.yml @@ -3,4 +3,4 @@ version: v0.1.0 - src: git+https://gitlab.esss.lu.se/ics-ansible-galaxy/ics-ans-role-lab-route.git - version: v0.1.1 + version: v0.1.2 -- GitLab