From c4ad2010e41438a7ea14924431a0ea745b413cb7 Mon Sep 17 00:00:00 2001 From: Ilya Kheifets Date: Thu, 12 Sep 2024 03:04:32 +0200 Subject: [PATCH] fix:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [run-int-tests] Signed-off-by: Ilya Kheifets --- .github/workflows/ci-main.yaml | 4 ++-- integration_tests/automatic_setup_compose.sh | 2 +- integration_tests/automatic_setup_microk8s.sh | 2 +- integration_tests/test_trap_integration.py | 6 ++++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-main.yaml b/.github/workflows/ci-main.yaml index 143718d88..7eedf977c 100644 --- a/.github/workflows/ci-main.yaml +++ b/.github/workflows/ci-main.yaml @@ -148,7 +148,7 @@ jobs: - name: run tests working-directory: integration_tests run: | - poetry run pytest --splunk_host="localhost" --splunk_password="changeme2" --trap_external_ip="$(hostname -I | cut -d " " -f1)" --sc4snmp_deployment="microk8s" + poetry run pytest --splunk_host="localhost" --splunk_password="changeme2" --trap_external_ip="$(hostname -I | cut -d " " -f1)" --sc4snmp_deployment="microk8s" -k "trap" test-integration-compose: name: Run integration tests in docker compose deployment @@ -181,4 +181,4 @@ jobs: - name: run tests working-directory: integration_tests run: | - poetry run pytest --splunk_host="localhost" --splunk_password="changeme2" --trap_external_ip="$(hostname -I | cut -d " " -f1)" --sc4snmp_deployment="docker-compose" + poetry run pytest --splunk_host="localhost" --splunk_password="changeme2" --trap_external_ip="$(hostname -I | cut -d " " -f1)" --sc4snmp_deployment="docker-compose" -k "trap" diff --git a/integration_tests/automatic_setup_compose.sh b/integration_tests/automatic_setup_compose.sh index 2a795e776..0bc47fcfc 100755 --- a/integration_tests/automatic_setup_compose.sh +++ b/integration_tests/automatic_setup_compose.sh @@ -44,7 +44,7 @@ deploy_poetry() { poetry install poetry add --group dev splunk-sdk poetry add --group dev splunklib - poetry add --group dev pysnmp + poetry add --group dev pysnmplib } wait_for_containers_to_be_up() { diff --git a/integration_tests/automatic_setup_microk8s.sh b/integration_tests/automatic_setup_microk8s.sh index 1102b1c3c..50bbc8e88 100755 --- a/integration_tests/automatic_setup_microk8s.sh +++ b/integration_tests/automatic_setup_microk8s.sh @@ -44,7 +44,7 @@ deploy_poetry() { poetry install poetry add --group dev splunk-sdk poetry add --group dev splunklib - poetry add --group dev pysnmp + poetry add --group dev pysnmplib } wait_for_pod_initialization() { diff --git a/integration_tests/test_trap_integration.py b/integration_tests/test_trap_integration.py index 5d887a9f2..1132d9a80 100644 --- a/integration_tests/test_trap_integration.py +++ b/integration_tests/test_trap_integration.py @@ -17,6 +17,7 @@ import time from pysnmp.hlapi import * +import pysnmp from integration_tests.splunk_test_utils import ( create_v3_secrets_compose, @@ -34,6 +35,11 @@ def send_trap(host, port, object_identity, mib_to_load, *var_binds): + try: + UdpTransportTarget((host, port)), + except Exception: + raise Exception(pysnmp.__version__) + iterator = sendNotification( SnmpEngine(), CommunityData("public", mpModel=0),