summaryrefslogtreecommitdiffstats
path: root/tests/units/anta_tests/test_connectivity.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-15 20:30:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-15 20:30:44 +0000
commit4a398db99d88dd17dabc408fb2b58c610792bc1e (patch)
treee5404d6d19a4d67a9428b3d10f886717b9756352 /tests/units/anta_tests/test_connectivity.py
parentAdding upstream version 1.0.0. (diff)
downloadanta-upstream.tar.xz
anta-upstream.zip
Adding upstream version 1.1.0.upstream/1.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/units/anta_tests/test_connectivity.py')
-rw-r--r--tests/units/anta_tests/test_connectivity.py46
1 files changed, 45 insertions, 1 deletions
diff --git a/tests/units/anta_tests/test_connectivity.py b/tests/units/anta_tests/test_connectivity.py
index bd30811..beeaae6 100644
--- a/tests/units/anta_tests/test_connectivity.py
+++ b/tests/units/anta_tests/test_connectivity.py
@@ -8,7 +8,7 @@ from __future__ import annotations
from typing import Any
from anta.tests.connectivity import VerifyLLDPNeighbors, VerifyReachability
-from tests.lib.anta import test # noqa: F401; pylint: disable=W0611
+from tests.units.anta_tests import test
DATA: list[dict[str, Any]] = [
{
@@ -100,6 +100,28 @@ DATA: list[dict[str, Any]] = [
"expected": {"result": "success"},
},
{
+ "name": "success-df-bit-size",
+ "test": VerifyReachability,
+ "inputs": {"hosts": [{"destination": "10.0.0.1", "source": "Management0", "repeat": 5, "size": 1500, "df_bit": True}]},
+ "eos_data": [
+ {
+ "messages": [
+ """PING 10.0.0.1 (10.0.0.1) from 172.20.20.6 : 1472(1500) bytes of data.
+ 1480 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.085 ms
+ 1480 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.020 ms
+ 1480 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.019 ms
+ 1480 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=0.018 ms
+ 1480 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=0.017 ms
+
+ --- 10.0.0.1 ping statistics ---
+ 5 packets transmitted, 5 received, 0% packet loss, time 0ms
+ rtt min/avg/max/mdev = 0.017/0.031/0.085/0.026 ms, ipg/ewma 0.061/0.057 ms""",
+ ],
+ },
+ ],
+ "expected": {"result": "success"},
+ },
+ {
"name": "failure-ip",
"test": VerifyReachability,
"inputs": {"hosts": [{"destination": "10.0.0.11", "source": "10.0.0.5"}, {"destination": "10.0.0.2", "source": "10.0.0.5"}]},
@@ -168,6 +190,28 @@ DATA: list[dict[str, Any]] = [
"expected": {"result": "failure", "messages": ["Connectivity test failed for the following source-destination pairs: [('Management0', '10.0.0.11')]"]},
},
{
+ "name": "failure-size",
+ "test": VerifyReachability,
+ "inputs": {"hosts": [{"destination": "10.0.0.1", "source": "Management0", "repeat": 5, "size": 1501, "df_bit": True}]},
+ "eos_data": [
+ {
+ "messages": [
+ """PING 10.0.0.1 (10.0.0.1) from 172.20.20.6 : 1473(1501) bytes of data.
+ ping: local error: message too long, mtu=1500
+ ping: local error: message too long, mtu=1500
+ ping: local error: message too long, mtu=1500
+ ping: local error: message too long, mtu=1500
+ ping: local error: message too long, mtu=1500
+
+ --- 10.0.0.1 ping statistics ---
+ 5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 40ms
+ """,
+ ],
+ },
+ ],
+ "expected": {"result": "failure", "messages": ["Connectivity test failed for the following source-destination pairs: [('Management0', '10.0.0.1')]"]},
+ },
+ {
"name": "success",
"test": VerifyLLDPNeighbors,
"inputs": {