mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-15 10:25:40 +00:00
respond packet should not be dropped if request packet is already allowed (#1725)
This commit is contained in:
@@ -2468,12 +2468,21 @@ pub async fn acl_group_self_test(
|
||||
#[rstest::rstest]
|
||||
#[tokio::test]
|
||||
#[serial_test::serial]
|
||||
pub async fn whitelist_test(#[values("tcp", "udp")] protocol: &str) {
|
||||
pub async fn whitelist_test(
|
||||
#[values("tcp", "udp")] protocol: &str,
|
||||
#[values(true, false)] test_outbound_allow_list: bool,
|
||||
) {
|
||||
let port = 44553;
|
||||
let acl_configured_inst = if test_outbound_allow_list {
|
||||
"inst1"
|
||||
} else {
|
||||
"inst3"
|
||||
};
|
||||
let insts = init_three_node_ex(
|
||||
protocol,
|
||||
move |cfg| {
|
||||
if cfg.get_inst_name() == "inst3" {
|
||||
let port = if test_outbound_allow_list { 0 } else { port };
|
||||
if cfg.get_inst_name() == acl_configured_inst {
|
||||
if protocol == "tcp" {
|
||||
cfg.set_tcp_whitelist(vec![format!("{}", port)]);
|
||||
} else if protocol == "udp" {
|
||||
@@ -2536,6 +2545,10 @@ pub async fn whitelist_test(#[values("tcp", "udp")] protocol: &str) {
|
||||
.unwrap_or_else(|_| panic!("{} should be allowed", p));
|
||||
}
|
||||
|
||||
if test_outbound_allow_list {
|
||||
return;
|
||||
}
|
||||
|
||||
// test other port
|
||||
let other_port = port + 1;
|
||||
for p in ["tcp", "udp"] {
|
||||
|
||||
Reference in New Issue
Block a user