def test_working_state(self, match_engine):
     """
     Scenario: When the config is properly applied and propagated
     """
     params = {Vxlan_tunnel.ARG_NAME: "vtep_1336", "namespace": ""}
     m_vxlan_tunnel = Vxlan_tunnel(match_engine)
     returned = m_vxlan_tunnel.execute(params)
     expect = create_template_dict(
         dbs=["CONFIG_DB", "APPL_DB", "ASIC_DB", "STATE_DB"])
     expect["CONFIG_DB"]["keys"].append("VXLAN_TUNNEL|vtep_1336")
     expect["APPL_DB"]["keys"].append("VXLAN_TUNNEL_TABLE:vtep_1336")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL:oid:0x2a0000000007ed")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_TERM_TABLE_ENTRY:oid:0x2b0000000007ee"
     )
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_MAP:oid:0x290000000007ea")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_MAP:oid:0x290000000007e9")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_MAP:oid:0x290000000007ec")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_MAP:oid:0x290000000007eb")
     expect["STATE_DB"]["tables_not_found"].append("VXLAN_TUNNEL_TABLE")
     ddiff = DeepDiff(returned, expect, ignore_order=True)
     assert not ddiff, ddiff
 def test_missing_asic_vxlan_tunnel_term(self, match_engine):
     """
     Scenario: When the config was applied and just SAI_OBJECT_TYPE_TUNNEL_TERM_TABLE_ENTRY is missing in the asic db
     """
     params = {Vxlan_tunnel.ARG_NAME: "vtep_1000", "namespace": ""}
     m_vxlan_tunnel = Vxlan_tunnel(match_engine)
     returned = m_vxlan_tunnel.execute(params)
     expect = create_template_dict(
         dbs=["CONFIG_DB", "APPL_DB", "ASIC_DB", "STATE_DB"])
     expect["CONFIG_DB"]["keys"].append("VXLAN_TUNNEL|vtep_1000")
     expect["APPL_DB"]["keys"].append("VXLAN_TUNNEL_TABLE:vtep_1000")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL:oid:0x2a0000000007ef")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_MAP:oid:0x290000000007ba")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_MAP:oid:0x290000000007b9")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_MAP:oid:0x290000000007bc")
     expect["ASIC_DB"]["keys"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_MAP:oid:0x290000000007bb")
     expect["ASIC_DB"]["tables_not_found"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_TERM_TABLE_ENTRY")
     expect["STATE_DB"]["tables_not_found"].append("VXLAN_TUNNEL_TABLE")
     ddiff = DeepDiff(returned, expect, ignore_order=True)
     assert not ddiff, ddiff
 def test_all_args(self, match_engine):
     """
     Scenario: Verify Whether the get_all_args method is working as expected
     """
     m_vxlan_tunnel = Vxlan_tunnel(match_engine)
     returned = m_vxlan_tunnel.get_all_args("")
     expect = [
         "vtep_1336", "vtep_1111", "vtep_1000", "vtep_2312", "vtep_1234"
     ]
     ddiff = DeepDiff(expect, returned, ignore_order=True)
     assert not ddiff, ddiff
 def test_no_vxlan_tunnel(self, match_engine):
     """
     Scenario: When the config was not present
     """
     params = {Vxlan_tunnel.ARG_NAME: "vtep_5555", "namespace": ""}
     m_vxlan_tunnel = Vxlan_tunnel(match_engine)
     returned = m_vxlan_tunnel.execute(params)
     expect = create_template_dict(
         dbs=["CONFIG_DB", "APPL_DB", "ASIC_DB", "STATE_DB"])
     expect["CONFIG_DB"]["tables_not_found"].append("VXLAN_TUNNEL")
     expect["APPL_DB"]["tables_not_found"].append("VXLAN_TUNNEL_TABLE")
     expect["ASIC_DB"]["tables_not_found"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL")
     expect["ASIC_DB"]["tables_not_found"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_TERM_TABLE_ENTRY")
     expect["ASIC_DB"]["tables_not_found"].append(
         "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_MAP")
     expect["STATE_DB"]["tables_not_found"].append("VXLAN_TUNNEL_TABLE")
     ddiff = DeepDiff(returned, expect, ignore_order=True)
     assert not ddiff, ddiff