Skip to content

Commit

Permalink
[p4rt-tests] Bind response consumer to appl_state_db (sonic-net#2105)
Browse files Browse the repository at this point in the history
What I did
In p4rt test scripts, bind response consumer to appl_state_db for consistency.

Why I did it
In p4orch, the relating notification producer for table P4RT_TABLE is on database appl state db

How I verified it
Run vstest

Details if related
notification channel name would be tagged dbId - sonic-net/sonic-swss-common#568
  • Loading branch information
jimmyzhai authored Jan 11, 2022
1 parent 43e54e5 commit d3cd402
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/p4rt/test_l3.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _set_up(self, dvs):
self._p4rt_route_obj.set_up_databases(dvs)
self._p4rt_wcmp_group_obj.set_up_databases(dvs)
self.response_consumer = swsscommon.NotificationConsumer(
self._p4rt_route_obj.appl_db, "APPL_DB_P4RT_TABLE_RESPONSE_CHANNEL")
self._p4rt_route_obj.appl_state_db, "APPL_DB_P4RT_TABLE_RESPONSE_CHANNEL")

def _set_vrf(self, dvs):
# Create VRF.
Expand Down
2 changes: 1 addition & 1 deletion tests/p4rt/test_p4rt_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _set_up(self, dvs):
self._p4rt_udf_obj.set_up_databases(dvs)

self.response_consumer = swsscommon.NotificationConsumer(
self._p4rt_acl_table_definition_obj.appl_db, "APPL_DB_P4RT_TABLE_RESPONSE_CHANNEL"
self._p4rt_acl_table_definition_obj.appl_state_db, "APPL_DB_P4RT_TABLE_RESPONSE_CHANNEL"
)

@pytest.mark.skip(reason="p4orch is not enabled")
Expand Down
2 changes: 1 addition & 1 deletion tests/p4rt/test_p4rt_mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _set_up(self, dvs):
self._p4rt_mirror_session_wrapper = P4RtMirrorSessionWrapper()
self._p4rt_mirror_session_wrapper.set_up_databases(dvs)
self._response_consumer = swsscommon.NotificationConsumer(
self._p4rt_mirror_session_wrapper.appl_db, "APPL_DB_P4RT_TABLE_RESPONSE_CHANNEL")
self._p4rt_mirror_session_wrapper.appl_state_db, "APPL_DB_P4RT_TABLE_RESPONSE_CHANNEL")

def test_MirrorSessionAddModifyAndDelete(self, dvs, testlog):
# Initialize database connectors
Expand Down

0 comments on commit d3cd402

Please sign in to comment.