From 0cdf5187bf1f602d4d822a89ebfbf9a9f02d65b7 Mon Sep 17 00:00:00 2001 From: Lars Getwan Date: Mon, 23 Oct 2023 11:24:26 +0200 Subject: [PATCH] Adjusted the integration tests. --- plugins/lookup/folder.py | 2 +- plugins/lookup/folders.py | 2 +- plugins/lookup/host.py | 2 +- plugins/lookup/hosts.py | 2 +- tests/integration/targets/lookup_folder/tasks/test.yml | 9 ++++++--- tests/integration/targets/lookup_folders/tasks/test.yml | 9 ++++++--- tests/integration/targets/lookup_host/tasks/test.yml | 6 ++++-- tests/integration/targets/lookup_hosts/tasks/test.yml | 6 ++++-- 8 files changed, 24 insertions(+), 14 deletions(-) diff --git a/plugins/lookup/folder.py b/plugins/lookup/folder.py index 93e3ba419..0ce29557e 100644 --- a/plugins/lookup/folder.py +++ b/plugins/lookup/folder.py @@ -77,7 +77,7 @@ def run(self, terms, variables, **kwargs): secret = self.get_option("automation_secret") validate_certs = self.get_option("validate_certs") - site_url = server_url + '/' + site + site_url = server_url + "/" + site api = CheckMKLookupAPI( site_url=site_url, diff --git a/plugins/lookup/folders.py b/plugins/lookup/folders.py index a2514b50b..41bbfe809 100644 --- a/plugins/lookup/folders.py +++ b/plugins/lookup/folders.py @@ -113,7 +113,7 @@ def run(self, terms, variables, **kwargs): secret = self.get_option("automation_secret") validate_certs = self.get_option("validate_certs") - site_url = server_url + '/' + site + site_url = server_url + "/" + site api = CheckMKLookupAPI( site_url=site_url, diff --git a/plugins/lookup/host.py b/plugins/lookup/host.py index bc185038a..5c581820b 100644 --- a/plugins/lookup/host.py +++ b/plugins/lookup/host.py @@ -84,7 +84,7 @@ def run(self, terms, variables, **kwargs): secret = self.get_option("automation_secret") validate_certs = self.get_option("validate_certs") - site_url = server_url + '/' + site + site_url = server_url + "/" + site api = CheckMKLookupAPI( site_url=site_url, diff --git a/plugins/lookup/hosts.py b/plugins/lookup/hosts.py index 8407c5a10..b84c7a539 100644 --- a/plugins/lookup/hosts.py +++ b/plugins/lookup/hosts.py @@ -82,7 +82,7 @@ def run(self, terms, variables, **kwargs): secret = self.get_option("automation_secret") validate_certs = self.get_option("validate_certs") - site_url = server_url + '/' + site + site_url = server_url + "/" + site api = CheckMKLookupAPI( site_url=site_url, diff --git a/tests/integration/targets/lookup_folder/tasks/test.yml b/tests/integration/targets/lookup_folder/tasks/test.yml index 49e97f196..1277c4961 100644 --- a/tests/integration/targets/lookup_folder/tasks/test.yml +++ b/tests/integration/targets/lookup_folder/tasks/test.yml @@ -19,7 +19,8 @@ vars: folders: "{{ lookup('checkmk.general.folders', '/', - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret) @@ -33,7 +34,8 @@ vars: extensions: "{{ lookup('checkmk.general.folder', checkmk_folder.path, - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret) @@ -47,7 +49,8 @@ vars: extensions: "{{ lookup('checkmk.general.folder', checkmk_folder.path, - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret) diff --git a/tests/integration/targets/lookup_folders/tasks/test.yml b/tests/integration/targets/lookup_folders/tasks/test.yml index 180a802eb..74deebcb1 100644 --- a/tests/integration/targets/lookup_folders/tasks/test.yml +++ b/tests/integration/targets/lookup_folders/tasks/test.yml @@ -21,7 +21,8 @@ folders: "{{ lookup('checkmk.general.folders', '/', recursive=True, - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret) @@ -35,7 +36,8 @@ loop: "{{ lookup('checkmk.general.folders', '/', recursive=True, - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret) @@ -53,7 +55,8 @@ folders: "{{ lookup('checkmk.general.folders', '/', recursive=True, - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret) diff --git a/tests/integration/targets/lookup_host/tasks/test.yml b/tests/integration/targets/lookup_host/tasks/test.yml index 90df940e3..cf28528a2 100644 --- a/tests/integration/targets/lookup_host/tasks/test.yml +++ b/tests/integration/targets/lookup_host/tasks/test.yml @@ -21,7 +21,8 @@ vars: extensions: "{{ lookup('checkmk.general.host', checkmk_host.name, - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret) @@ -35,7 +36,8 @@ vars: extensions: "{{ lookup('checkmk.general.host', checkmk_host.name, - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret) diff --git a/tests/integration/targets/lookup_hosts/tasks/test.yml b/tests/integration/targets/lookup_hosts/tasks/test.yml index 591db48f7..bfdf2f71b 100644 --- a/tests/integration/targets/lookup_hosts/tasks/test.yml +++ b/tests/integration/targets/lookup_hosts/tasks/test.yml @@ -20,7 +20,8 @@ ansible.builtin.debug: msg: "Alias of {{ item.id }} is {{ item.extensions.attributes.alias }}" loop: "{{ lookup('checkmk.general.hosts', - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret) @@ -35,7 +36,8 @@ that: "checkmk_hosts|length == hosts|length" vars: hosts: "{{ lookup('checkmk.general.hosts', - site_url=server_url + '/' + outer_item.site, + server_url=server_url, + site=outer_item.site, validate_certs=False, automation_user=automation_user, automation_secret=automation_secret)