chore: align molecule tests to use get_target_hosts()

Signed-off-by: dobbi84 <davide.obbi@e4company.com>
This commit is contained in:
dobbi84 2024-10-03 12:15:55 +02:00 committed by gardar
parent 10d70f06a4
commit 02aefecad2
4 changed files with 11 additions and 13 deletions

View file

@ -9,14 +9,18 @@ galaxy_info:
versions:
- "focal"
- "jammy"
- "noble"
- name: "Debian"
versions:
- "bullseye"
- "buster"
- name: "EL"
versions:
- "8"
- "9"
- name: "Fedora"
versions:
- "39"
- "40"
galaxy_tags:
- "monitoring"
- "prometheus"

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
from testinfra_helpers import get_target_hosts
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
testinfra_hosts = get_target_hosts()
def test_service(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
from testinfra_helpers import get_target_hosts
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
testinfra_hosts = get_target_hosts()
def test_files(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
from testinfra_helpers import get_target_hosts
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
testinfra_hosts = get_target_hosts()
@pytest.mark.parametrize("files", [