summaryrefslogtreecommitdiffstats
path: root/tests/units/anta_tests/test_stun.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/anta_tests/test_stun.py')
-rw-r--r--tests/units/anta_tests/test_stun.py34
1 files changed, 15 insertions, 19 deletions
diff --git a/tests/units/anta_tests/test_stun.py b/tests/units/anta_tests/test_stun.py
index 005ae35..2383483 100644
--- a/tests/units/anta_tests/test_stun.py
+++ b/tests/units/anta_tests/test_stun.py
@@ -7,13 +7,13 @@ from __future__ import annotations
from typing import Any
-from anta.tests.stun import VerifyStunClient, VerifyStunServer
+from anta.tests.stun import VerifyStunClientTranslation, VerifyStunServer
from tests.units.anta_tests import test
DATA: list[dict[str, Any]] = [
{
"name": "success",
- "test": VerifyStunClient,
+ "test": VerifyStunClientTranslation,
"eos_data": [
{
"bindings": {
@@ -60,7 +60,7 @@ DATA: list[dict[str, Any]] = [
},
{
"name": "failure-incorrect-public-ip",
- "test": VerifyStunClient,
+ "test": VerifyStunClientTranslation,
"eos_data": [
{
"bindings": {
@@ -88,14 +88,14 @@ DATA: list[dict[str, Any]] = [
"expected": {
"result": "failure",
"messages": [
- "For STUN source `100.64.3.2:4500`:\nExpected `192.164.3.2` as the public ip, but found `192.64.3.2` instead.",
- "For STUN source `172.18.3.2:4500`:\nExpected `192.118.3.2` as the public ip, but found `192.18.3.2` instead.",
+ "Client 100.64.3.2 Port: 4500 - Incorrect public-facing address - Expected: 192.164.3.2 Actual: 192.64.3.2",
+ "Client 172.18.3.2 Port: 4500 - Incorrect public-facing address - Expected: 192.118.3.2 Actual: 192.18.3.2",
],
},
},
{
"name": "failure-no-client",
- "test": VerifyStunClient,
+ "test": VerifyStunClientTranslation,
"eos_data": [
{"bindings": {}},
{"bindings": {}},
@@ -108,12 +108,12 @@ DATA: list[dict[str, Any]] = [
},
"expected": {
"result": "failure",
- "messages": ["STUN client transaction for source `100.64.3.2:4500` is not found.", "STUN client transaction for source `172.18.3.2:4500` is not found."],
+ "messages": ["Client 100.64.3.2 Port: 4500 - STUN client translation not found.", "Client 172.18.3.2 Port: 4500 - STUN client translation not found."],
},
},
{
"name": "failure-incorrect-public-port",
- "test": VerifyStunClient,
+ "test": VerifyStunClientTranslation,
"eos_data": [
{"bindings": {}},
{
@@ -134,16 +134,15 @@ DATA: list[dict[str, Any]] = [
"expected": {
"result": "failure",
"messages": [
- "STUN client transaction for source `100.64.3.2:4500` is not found.",
- "For STUN source `172.18.3.2:4500`:\n"
- "Expected `192.118.3.2` as the public ip, but found `192.18.3.2` instead.\n"
- "Expected `6006` as the public port, but found `4800` instead.",
+ "Client 100.64.3.2 Port: 4500 - STUN client translation not found.",
+ "Client 172.18.3.2 Port: 4500 - Incorrect public-facing address - Expected: 192.118.3.2 Actual: 192.18.3.2",
+ "Client 172.18.3.2 Port: 4500 - Incorrect public-facing port - Expected: 6006 Actual: 4800",
],
},
},
{
"name": "failure-all-type",
- "test": VerifyStunClient,
+ "test": VerifyStunClientTranslation,
"eos_data": [
{"bindings": {}},
{
@@ -164,12 +163,9 @@ DATA: list[dict[str, Any]] = [
"expected": {
"result": "failure",
"messages": [
- "STUN client transaction for source `100.64.3.2:4500` is not found.",
- "For STUN source `172.18.4.2:4800`:\n"
- "Expected `172.18.4.2` as the source ip, but found `172.18.3.2` instead.\n"
- "Expected `4800` as the source port, but found `4500` instead.\n"
- "Expected `192.118.3.2` as the public ip, but found `192.18.3.2` instead.\n"
- "Expected `6006` as the public port, but found `4800` instead.",
+ "Client 100.64.3.2 Port: 4500 - STUN client translation not found.",
+ "Client 172.18.4.2 Port: 4800 - Incorrect public-facing address - Expected: 192.118.3.2 Actual: 192.18.3.2",
+ "Client 172.18.4.2 Port: 4800 - Incorrect public-facing port - Expected: 6006 Actual: 4800",
],
},
},