summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsongyanchao <[email protected]>2024-01-26 10:14:32 +0000
committersongyanchao <[email protected]>2024-02-01 03:29:48 +0000
commit4fca0b4b7d825ba1bdd3c2f048a0bd27fadfa449 (patch)
tree2c77cd309dbbfad9e2c88f61df89a7eb8838289f /test
parent1c40c75d6989b26d3dc8e323dde9c03af94c1bd4 (diff)
🎈 perf: Optimize of classifier rule fields.
Optimize of classifier rule fields.
Diffstat (limited to 'test')
-rw-r--r--test/ptf_test/bfd_test.py5
-rw-r--r--test/ptf_test/bond_test.py2
-rw-r--r--test/ptf_test/bridge_test.py2
-rw-r--r--test/ptf_test/classifier_test.py131
-rw-r--r--test/ptf_test/endpoint_dev_test.py2
-rw-r--r--test/ptf_test/etherfabric_test.py30
-rw-r--r--test/ptf_test/health_check_test.py2
-rw-r--r--test/ptf_test/load_balance_test.py7
-rw-r--r--test/ptf_test/mrzcpd.py7
-rw-r--r--test/ptf_test/msgpack_test.py21
-rw-r--r--test/ptf_test/tera_test.py46
-rw-r--r--test/ptf_test/vwire_test.py23
12 files changed, 148 insertions, 130 deletions
diff --git a/test/ptf_test/bfd_test.py b/test/ptf_test/bfd_test.py
index 06ec56f..97db79e 100644
--- a/test/ptf_test/bfd_test.py
+++ b/test/ptf_test/bfd_test.py
@@ -39,7 +39,10 @@ nohuge = 1
mem = 65535
[keepalive]
-check_spinlock = 1
+check_spinlock=1
+
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0 = tunnat, 64
diff --git a/test/ptf_test/bond_test.py b/test/ptf_test/bond_test.py
index 8a3d822..aed4e17 100644
--- a/test/ptf_test/bond_test.py
+++ b/test/ptf_test/bond_test.py
@@ -66,6 +66,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat,64
ctrlzone1=vsys,64
diff --git a/test/ptf_test/bridge_test.py b/test/ptf_test/bridge_test.py
index bf1dfff..5bcc480 100644
--- a/test/ptf_test/bridge_test.py
+++ b/test/ptf_test/bridge_test.py
@@ -60,6 +60,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
diff --git a/test/ptf_test/classifier_test.py b/test/ptf_test/classifier_test.py
index 82e525c..47d3dd4 100644
--- a/test/ptf_test/classifier_test.py
+++ b/test/ptf_test/classifier_test.py
@@ -67,6 +67,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -130,89 +132,81 @@ dynamic_conf_base = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
+ruleset_type=0
dst_ip_addr_v4=172.17.2.100
dst_ip_mask_v4=32
-action=nf_steering
+action=2
priority=1
-category=0
sid=1000
vwire_id=0
[classifier_rule:1]
rule_id=2
-ruleset_type=classifier
+ruleset_type=0
dst_ip_addr_v4=172.17.2.101
dst_ip_mask_v4=32
-action=nf_steering
+action=2
priority=1
-category=0
sid=1001
vwire_id=0
[classifier_rule:2]
rule_id=3
-ruleset_type=classifier
+ruleset_type=0
src_ip_addr_v4=172.17.2.102
src_ip_mask_v4=32
-action=nf_steering
+action=2
priority=1
-category=0
sid=1002
vwire_id=0
[classifier_rule:3]
rule_id=4
-ruleset_type=classifier
+ruleset_type=0
src_ip_addr_v4=172.17.2.103
src_ip_mask_v4=32
-action=nf_steering
+action=2
priority=1
-category=0
sid=1003
vwire_id=0
[classifier_rule:4]
rule_id=5
-ruleset_type=classifier
+ruleset_type=0
dst_ip_addr_v6=2222::4
dst_ip_mask_v6=128
-action=nf_steering
+action=2
priority=1
-category=0
sid=1000
vwire_id=0
[classifier_rule:5]
rule_id=6
-ruleset_type=classifier
+ruleset_type=0
dst_ip_addr_v6=2222::5
dst_ip_mask_v6=128
-action=nf_steering
+action=2
priority=1
-category=0
sid=1001
vwire_id=0
[classifier_rule:6]
rule_id=7
-ruleset_type=classifier
+ruleset_type=0
src_ip_addr_v6=2222::6
src_ip_mask_v6=128
-action=nf_steering
+action=2
priority=1
-category=0
sid=1002
vwire_id=0
[classifier_rule:7]
rule_id=8
-ruleset_type=classifier
+ruleset_type=0
src_ip_addr_v6=2222::7
src_ip_mask_v6=128
-action=nf_steering
+action=2
priority=1
-category=0
sid=1003
vwire_id=0
"""
@@ -366,13 +360,12 @@ class TestForTreeSearch(BaseTest):
global dynamic_conf_base
for i in range(8,128):
dynamic_conf_base += "[classifier_rule:" + str(i) + "]\n"
- dynamic_conf_base += "ruleset_type=classifier\n"
+ dynamic_conf_base += "ruleset_type=0\n"
dynamic_conf_base += "rule_id=" + str(i+1) + "\n"
dynamic_conf_base += "dst_ip_addr_v4=172.19.2." + str(i) + "\n"
dynamic_conf_base += "dst_ip_mask_v4=32\n"
- dynamic_conf_base += "action=nf_steering\n"
+ dynamic_conf_base += "action=2\n"
dynamic_conf_base += "priority=1\n"
- dynamic_conf_base += "category=0\n"
dynamic_conf_base += "sid=1000\n"
dynamic_conf_base += "vwire_id=0\n\n"
@@ -474,7 +467,6 @@ class TestForTreeSearch(BaseTest):
finally:
mrzcpd.stop()
-category_conf = """Current not support priority"""
start_conf_vwire = """
[device]
@@ -526,6 +518,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -575,45 +569,42 @@ devices=veth0,normal
mode=balance
devices=veth1,normal
-"""
-
-dynamic_conf_full_field_match_for_vwire = """
-
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
+ruleset_type=0
src_ip_addr_v4=172.17.1.100
src_ip_mask_v4=32
dst_ip_addr_v4=172.17.2.100
dst_ip_mask_v4=32
-src_port_range_start=1000
-src_port_range_end=1000
-dst_port_range_start=80
-dst_port_range_end=80
-proto=tcp
+src_port_start=1000
+src_port_end=1000
+dst_port_start=80
+dst_port_end=80
+proto=6
priority=1
sid=1000
-category=0
vwire_id=0
-action=nf_steering
+action=2
-[classifier_rule:1]
+"""
+
+dynamic_conf_full_field_match_for_vwire = """
+[classifier_rule:0]
rule_id=2
-ruleset_type=classifier
+ruleset_type=0
src_ip_addr_v6=1111::8888
src_ip_mask_v6=128
dst_ip_addr_v6=2222::9999
dst_ip_mask_v6=128
-src_port_range_start=1000
-src_port_range_end=1000
-dst_port_range_start=80
-dst_port_range_end=80
-proto=udp
+src_port_start=1000
+src_port_end=1000
+dst_port_start=80
+dst_port_end=80
+proto=17
priority=1
sid=1001
-category=0
vwire_id=0
-action=nf_steering
+action=2
"""
"""
@@ -707,13 +698,12 @@ class FullFieldTreeMatchForVwireTest(BaseTest):
dynamic_conf = dynamic_conf_full_field_match_for_vwire
for i in range(8,128):
dynamic_conf += "[classifier_rule:" + str(i) + "]\n"
- dynamic_conf += "ruleset_type=classifier\n"
+ dynamic_conf += "ruleset_type=0\n"
dynamic_conf += "rule_id=" + str(i+1) + "\n"
dynamic_conf += "dst_ip_addr_v4=172.19.2." + str(i) + "\n"
dynamic_conf += "dst_ip_mask_v4=32\n"
- dynamic_conf += "action=nf_steering\n"
+ dynamic_conf += "action=2\n"
dynamic_conf += "priority=1\n"
- dynamic_conf += "category=0\n"
dynamic_conf += "sid=1000\n"
dynamic_conf += "vwire_id=0\n\n"
mrzcpd = Mrzcpd(start_conf_vwire,dynamic_conf)
@@ -799,6 +789,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -859,39 +851,37 @@ devices=veth2,normal
dynamic_conf_full_field_match_for_tera = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
+ruleset_type=0
src_ip_addr_v4=172.17.1.100
src_ip_mask_v4=32
dst_ip_addr_v4=172.17.2.100
dst_ip_mask_v4=32
-src_port_range_start=1000
-src_port_range_end=1000
-dst_port_range_start=80
-dst_port_range_end=80
-proto=tcp
+src_port_start=1000
+src_port_end=1000
+dst_port_start=80
+dst_port_end=80
+proto=6
priority=1
sid=1000
-category=0
tera_adapter_id=0
-action=nf_steering
+action=2
[classifier_rule:1]
rule_id=2
-ruleset_type=classifier
+ruleset_type=0
src_ip_addr_v6=1111::8888
src_ip_mask_v6=128
dst_ip_addr_v6=2222::9999
dst_ip_mask_v6=128
-src_port_range_start=1000
-src_port_range_end=1000
-dst_port_range_start=80
-dst_port_range_end=80
-proto=udp
+src_port_start=1000
+src_port_end=1000
+dst_port_start=80
+dst_port_end=80
+proto=17
priority=1
sid=1001
-category=0
tera_adapter_id=0
-action=nf_steering
+action=2
"""
@@ -976,13 +966,12 @@ class FullFieldTreeMatchForTeraTest(BaseTest):
dynamic_conf = dynamic_conf_full_field_match_for_tera
for i in range(8,128):
dynamic_conf += "[classifier_rule:" + str(i) + "]\n"
- dynamic_conf += "ruleset_type=classifier\n"
+ dynamic_conf += "ruleset_type=0\n"
dynamic_conf += "rule_id=" + str(i+1) + "\n"
dynamic_conf += "dst_ip_addr_v4=172.19.2." + str(i) + "\n"
dynamic_conf += "dst_ip_mask_v4=32\n"
- dynamic_conf += "action=nf_steering\n"
+ dynamic_conf += "action=2\n"
dynamic_conf += "priority=1\n"
- dynamic_conf += "category=0\n"
dynamic_conf += "sid=1000\n"
dynamic_conf += "tera_adapter_id=0\n\n"
mrzcpd = Mrzcpd(start_conf_tera,dynamic_conf)
diff --git a/test/ptf_test/endpoint_dev_test.py b/test/ptf_test/endpoint_dev_test.py
index fa46b44..da136e6 100644
--- a/test/ptf_test/endpoint_dev_test.py
+++ b/test/ptf_test/endpoint_dev_test.py
@@ -40,6 +40,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat,128
diff --git a/test/ptf_test/etherfabric_test.py b/test/ptf_test/etherfabric_test.py
index 61f2e17..5767968 100644
--- a/test/ptf_test/etherfabric_test.py
+++ b/test/ptf_test/etherfabric_test.py
@@ -40,6 +40,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -145,6 +147,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -271,6 +275,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -324,10 +330,9 @@ devices=veth-msgpack-tx,normal
dynamic_conf_with_route_ctx = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
"""
"""
@@ -430,8 +435,10 @@ nohuge = 1
mem = 65535
[keepalive]
-check_spinlock = 1
+check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0 = tunnat, 64
ctrlzone1 = vsys, 64
@@ -499,28 +506,25 @@ listen_device=veth4
dynamic_conf_with_non_contiguous_test = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
ef_adapter_id=0
[classifier_rule:1]
rule_id=2
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1001
ef_adapter_id=2
[classifier_rule:2]
rule_id=2
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1002
ef_adapter_id=4
"""
diff --git a/test/ptf_test/health_check_test.py b/test/ptf_test/health_check_test.py
index 71a48d9..5e85c5c 100644
--- a/test/ptf_test/health_check_test.py
+++ b/test/ptf_test/health_check_test.py
@@ -38,6 +38,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
diff --git a/test/ptf_test/load_balance_test.py b/test/ptf_test/load_balance_test.py
index f762214..58a05d2 100644
--- a/test/ptf_test/load_balance_test.py
+++ b/test/ptf_test/load_balance_test.py
@@ -62,6 +62,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -111,10 +113,9 @@ devices=veth0,normal,veth1,normal,veth2,normal
dynamic_conf = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
vwire_id=0
diff --git a/test/ptf_test/mrzcpd.py b/test/ptf_test/mrzcpd.py
index 1f7b664..edb85c1 100644
--- a/test/ptf_test/mrzcpd.py
+++ b/test/ptf_test/mrzcpd.py
@@ -1,10 +1,9 @@
import ptf
import time
import os
-import signal
import subprocess
import shutil
-import urllib
+from urllib import request
mrzcpd_run_dir = "/var/run/mrzcpd"
@@ -45,7 +44,9 @@ class Mrzcpd:
start_timeout = 60
while start_timeout > 0:
try:
- response = urllib.urlopen('http://localhost:9086')
+ print("Try to connect to mrzcpd http server")
+ response = request.urlopen('http://127.0.0.1:9086/probe')
+ print(response.read())
break
except:
time.sleep(1)
diff --git a/test/ptf_test/msgpack_test.py b/test/ptf_test/msgpack_test.py
index a92b6ff..69e3108 100644
--- a/test/ptf_test/msgpack_test.py
+++ b/test/ptf_test/msgpack_test.py
@@ -56,6 +56,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat,128
@@ -105,10 +107,9 @@ dynamic_conf_serialize = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
vwire_id=0
"""
@@ -203,6 +204,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat,128
@@ -252,10 +255,9 @@ devices=veth2,normal
dynamic_conf_deserialize = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
vwire_id=0
@@ -358,6 +360,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat,128
@@ -406,10 +410,9 @@ devices=veth-msgpack-tx,normal
dynamic_conf_serialize_and_deserialize = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
vwire_id=0
diff --git a/test/ptf_test/tera_test.py b/test/ptf_test/tera_test.py
index 56b58f3..0d024a7 100644
--- a/test/ptf_test/tera_test.py
+++ b/test/ptf_test/tera_test.py
@@ -41,6 +41,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -153,6 +155,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -270,6 +274,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -615,6 +621,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -855,10 +863,9 @@ tera_adapter_id=15
dynamic_conf_with_msgpack = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
"""
@@ -1067,6 +1074,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -1227,10 +1236,9 @@ devices=veth-msgpack-tx,normal
dynamic_conf_with_nf = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
"""
"""
@@ -1412,6 +1420,8 @@ mem=65535
[keepalive]
check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0=tunnat, 64
ctrlzone1=vsys, 64
@@ -1572,10 +1582,9 @@ devices=veth-msgpack-tx,normal
dynamic_conf_with_route_ctx = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
"""
"""
@@ -1755,8 +1764,10 @@ nohuge = 1
mem = 65535
[keepalive]
-check_spinlock = 1
+check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0 = tunnat, 64
ctrlzone1 = vsys, 64
@@ -1830,28 +1841,25 @@ mac_flipping=1
dynamic_conf_with_non_contiguous_test = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
tera_adapter_id=0
[classifier_rule:1]
rule_id=2
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1001
tera_adapter_id=2
[classifier_rule:2]
rule_id=2
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1002
tera_adapter_id=4
"""
diff --git a/test/ptf_test/vwire_test.py b/test/ptf_test/vwire_test.py
index 3d8e7b8..8868f2b 100644
--- a/test/ptf_test/vwire_test.py
+++ b/test/ptf_test/vwire_test.py
@@ -173,8 +173,10 @@ nohuge = 1
mem = 65535
[keepalive]
-check_spinlock = 1
+check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0 = tunnat, 64
ctrlzone1 = vsys, 64
@@ -405,8 +407,10 @@ nohuge = 1
mem = 65535
[keepalive]
-check_spinlock = 1
+check_spinlock=1
+[http_server]
+listen_addr=127.0.0.1
[ctrlzone]
ctrlzone0 = tunnat, 64
ctrlzone1 = vsys, 64
@@ -475,28 +479,25 @@ devices=veth8,normal
dynamic_conf_with_non_contiguous_test = """
[classifier_rule:0]
rule_id=1
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1000
vwire_id=0
[classifier_rule:1]
rule_id=2
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1001
vwire_id=2
[classifier_rule:2]
rule_id=2
-ruleset_type=classifier
-action=nf_steering
+ruleset_type=0
+action=2
priority=1
-category=0
sid=1002
vwire_id=4
"""