diff --git a/internal-lab-setup-assets/Makefile b/internal-lab-setup-assets/Makefile index f42388f..f785ce2 100644 --- a/internal-lab-setup-assets/Makefile +++ b/internal-lab-setup-assets/Makefile @@ -58,8 +58,7 @@ poetry: fi test: poetry - XRD_LAB_IPS=$$(containerlab inspect --all | grep "cisco" | rev | cut -d ' ' -f8 | rev | sort -V); \ - echo "$${XRD_LAB_IPS}"; \ + XRD_LAB_IPS=$$(containerlab inspect --all | grep "cisco" | tr -d " \t\r" | rev | cut -d '│' -f2 | rev | sort -V); \ if [ -z "$${XRD_LAB_IPS}" ]; then echo "No labs found." && exit 0; fi; \ cd tester; \ echo "Installing dependencies..." && ~/.local/bin/poetry install --no-root; \ diff --git a/internal-lab-setup-assets/tester/lab-tester/lab-tester.py b/internal-lab-setup-assets/tester/lab-tester/lab-tester.py index a732432..9c2b0bb 100644 --- a/internal-lab-setup-assets/tester/lab-tester/lab-tester.py +++ b/internal-lab-setup-assets/tester/lab-tester/lab-tester.py @@ -16,18 +16,22 @@ def test_show_version(connection): output = connection.send_command("show version") - assert "Cisco IOS XR Software" in output + assert ( + "Cisco IOS XR Software" in output + ), f"Show version does not have expected string 'Cisco IOS XR Software'. Output: {output}" def test_configure_description(connection): # Note: If any description existed before, it will be blanked out connection.send_config_set(TEST_INTERFACE, f"description {TEST_DESCRIPTION}") new_desc = connection.send_command(CMD_SHOW_DESCRIPTION) - assert new_desc == f"description {TEST_DESCRIPTION}" + assert ( + new_desc == f"description {TEST_DESCRIPTION}" + ), f"'{new_desc}' on router does not match 'description {TEST_DESCRIPTION}'!" connection.send_config_set(TEST_INTERFACE, "no description") # revert -lab_ips = XRD_LAB_IPS.split(" ") +lab_ips = XRD_LAB_IPS.split() print(lab_ips) for ip in lab_ips: