summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorroot <[email protected]>2024-09-19 03:39:12 +0000
committerroot <[email protected]>2024-09-19 03:39:12 +0000
commitdb8a811a75cfb5fade767a4b73854977230fd87b (patch)
tree839e871f605439190665970756add5a97df0fbaf /test
parente0c20d27ede30d34e5ad2301ed6c14eb6f5cb295 (diff)
OMPUB-1426: ipport_plugin table support CIDR format, while table_info not changedv4.1.43dev-24.02
Diffstat (limited to 'test')
-rw-r--r--test/maat_framework_gtest.cpp4
-rw-r--r--test/maat_json.json8
-rw-r--r--test/table_info.conf9
3 files changed, 10 insertions, 11 deletions
diff --git a/test/maat_framework_gtest.cpp b/test/maat_framework_gtest.cpp
index 361f6ff..9043e45 100644
--- a/test/maat_framework_gtest.cpp
+++ b/test/maat_framework_gtest.cpp
@@ -5624,7 +5624,7 @@ void ipport_plugin_ex_new_cb(const char *table_name, int table_id, const char *k
ud->rule_id = atoll(table_line + column_offset);
- ret = get_column_pos(table_line, 6, &column_offset, &column_len);
+ ret = get_column_pos(table_line, 5, &column_offset, &column_len);
EXPECT_EQ(ret, 0);
ud->buffer = ALLOC(char, column_len + 1);
@@ -5684,7 +5684,7 @@ TEST_F(IPPortPluginTable, EX_DATA) {
EXPECT_EQ(ret, 1);
EXPECT_EQ(results[0]->rule_id, 103);
- ret = inet_pton(AF_INET, "192.168.100.5", &ipv4.ipv4);
+ ret = inet_pton(AF_INET, "192.168.200.5", &ipv4.ipv4);
EXPECT_EQ(ret, 1);
port = htons(150);
diff --git a/test/maat_json.json b/test/maat_json.json
index 9cfbdb7..16723d2 100644
--- a/test/maat_json.json
+++ b/test/maat_json.json
@@ -4189,10 +4189,10 @@
{
"table_name": "TEST_IPPORT_PLUGIN_WITH_EXDATA",
"table_content": [
- "101\t4\t192.168.100.1\t192.168.100.1\t0\t255\t1",
- "102\t4\t192.168.100.2\t192.168.100.100\t100\t200\t1",
- "103\t4\t192.168.100.1\t192.168.100.1\t255\t300\t1",
- "104\t6\t2001:db8:1234::5210\t2001:db8:1234::5220\t255\t512\t1"
+ "101\t4\t192.168.100.1/32\t0\t255\t1",
+ "102\t4\t192.168.200.1/24\t100\t200\t1",
+ "103\t4\t192.168.100.1\t255\t300\t1",
+ "104\t6\t2001:db8:1234::5210/64\t255\t512\t1"
]
},
{
diff --git a/test/table_info.conf b/test/table_info.conf
index 2280023..902ae53 100644
--- a/test/table_info.conf
+++ b/test/table_info.conf
@@ -634,15 +634,14 @@
"table_id":52,
"table_name":"TEST_IPPORT_PLUGIN_WITH_EXDATA",
"table_type":"ipport_plugin",
- "valid_column":7,
+ "valid_column":6,
"custom": {
"gc_timeout_s": 3,
"item_id":1,
"ip_type":2,
- "start_ip":3,
- "end_ip":4,
- "port1":5,
- "port2":6
+ "ip_addr":3,
+ "port1":4,
+ "port2":5
}
},
{