Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tests/dash/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ def pytest_addoption(parser):
help="Skip certificates cleanup after test"
)

parser.addoption(
"--dpu_index",
action="store",
default=0,
type=int,
help="The default dpu used for the test"
)


@pytest.fixture(scope="module")
def config_only(request):
Expand Down Expand Up @@ -466,5 +474,5 @@ def acl_default_rule(localhost, duthost, ptfhost, dash_config_info):


@pytest.fixture(scope="module")
def dpu_index():
return 2
def dpu_index(request):
return request.config.getoption("--dpu_index")
16 changes: 12 additions & 4 deletions tests/dash/test_dash_privatelink.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ def common_setup_teardown(localhost, duthost, ptfhost, dpu_index, skip_config):
**pl.APPLIANCE_CONFIG,
**pl.ROUTING_TYPE_PL_CONFIG,
**pl.VNET_CONFIG,
**pl.PE_VNET_MAPPING_CONFIG,
**pl.ROUTE_GROUP1_CONFIG,
**pl.METER_POLICY_V4_CONFIG
}
logger.info(base_config_messages)

apply_messages(localhost, duthost, ptfhost, base_config_messages, dpu_index)

route_messages = {
route_and_mapping_messages = {
**pl.PE_VNET_MAPPING_CONFIG,
**pl.PE_SUBNET_ROUTE_CONFIG,
**pl.VM_SUBNET_ROUTE_CONFIG
}
logger.info(route_messages)
apply_messages(localhost, duthost, ptfhost, route_messages, dpu_index)
logger.info(route_and_mapping_messages)
apply_messages(localhost, duthost, ptfhost, route_and_mapping_messages, dpu_index)

meter_rule_messages = {
**pl.METER_RULE1_V4_CONFIG,
Expand All @@ -85,6 +85,14 @@ def common_setup_teardown(localhost, duthost, ptfhost, dpu_index, skip_config):
logger.info(pl.ENI_ROUTE_GROUP1_CONFIG)
apply_messages(localhost, duthost, ptfhost, pl.ENI_ROUTE_GROUP1_CONFIG, dpu_index)

yield

apply_messages(localhost, duthost, ptfhost, pl.ENI_ROUTE_GROUP1_CONFIG, dpu_index, False)
apply_messages(localhost, duthost, ptfhost, pl.ENI_CONFIG, dpu_index, False)
apply_messages(localhost, duthost, ptfhost, meter_rule_messages, dpu_index, False)
apply_messages(localhost, duthost, ptfhost, route_and_mapping_messages, dpu_index, False)
apply_messages(localhost, duthost, ptfhost, base_config_messages, dpu_index, False)


@pytest.mark.parametrize("encap_proto", ["vxlan", "gre"])
def test_privatelink_basic_transform(
Expand Down
Loading