def test_all_args_member(self, match_engine): params = {} m_vlan = Vlan_Member(match_engine) returned = m_vlan.get_all_args("") expect = ["Vlan3|Ethernet0", "Vlan3|Ethernet8", "Vlan4|Ethernet16", "Vlan4|Ethernet24", "Vlan6|Ethernet32", "Vlan6|Ethernet40", "Vlan7|Ethernet48", "Vlan7|Ethernet56", "Vlan8|Ethernet64", "Vlan8|Ethernet72"] ddiff = DeepDiff(expect, returned, ignore_order=True) assert not ddiff, ddiff
def test_working_state_vlan_member2(self, match_engine): params = {} params["namespace"] = "" params[Vlan_Member.ARG_NAME] = "Vlan4|Ethernet24" m_vlan = Vlan_Member(match_engine) returned = m_vlan.execute(params) expect = create_template_dict(dbs=["CONFIG_DB", "APPL_DB", "ASIC_DB", "STATE_DB"]) expect["CONFIG_DB"]["keys"].append("VLAN_MEMBER|Vlan4|Ethernet24") expect["APPL_DB"]["keys"].append("VLAN_MEMBER_TABLE:Vlan4:Ethernet24") expect["STATE_DB"]["keys"].append("VLAN_MEMBER_TABLE|Vlan4|Ethernet24") expect["ASIC_DB"]["keys"].append("ASIC_STATE:SAI_OBJECT_TYPE_VLAN_MEMBER:oid:0x27000000000624") expect["ASIC_DB"]["keys"].append("ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a000000000623") ddiff = DeepDiff(sort_lists(returned), sort_lists(expect), ignore_order=True) assert not ddiff, ddiff
def test_missing_asic_db_member(self, match_engine): params = {} params[Vlan_Member.ARG_NAME] = "Vlan8|Ethernet72" params["namespace"] = "" m_vlan = Vlan_Member(match_engine) returned = m_vlan.execute(params) expect = create_template_dict(dbs=["CONFIG_DB", "APPL_DB", "ASIC_DB", "STATE_DB"]) expect["CONFIG_DB"]["keys"].append("VLAN_MEMBER|Vlan8|Ethernet72") expect["APPL_DB"]["keys"].append("VLAN_MEMBER_TABLE:Vlan8:Ethernet72") expect["STATE_DB"]["keys"].append("VLAN_MEMBER_TABLE|Vlan8|Ethernet72") expect["ASIC_DB"]["tables_not_found"].append("ASIC_STATE:SAI_OBJECT_TYPE_VLAN_MEMBER") expect["ASIC_DB"]["tables_not_found"].append("ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT") ddiff = DeepDiff(sort_lists(returned), sort_lists(expect), ignore_order=True) assert not ddiff, ddiff
def test_garbage_number_vlan_member(self, match_engine): params = {} params[Vlan_Member.ARG_NAME]= "3892" params["namespace"] = "" m_vlan = Vlan_Member(match_engine) returned = m_vlan.execute(params) expect = create_template_dict(dbs=["CONFIG_DB", "APPL_DB", "ASIC_DB", "STATE_DB"]) expect["CONFIG_DB"]["tables_not_found"].append("VLAN_MEMBER") expect["APPL_DB"]["tables_not_found"].append("VLAN_MEMBER_TABLE") expect["STATE_DB"]["tables_not_found"].append("VLAN_MEMBER_TABLE") expect["ASIC_DB"]["tables_not_found"].append("ASIC_STATE:SAI_OBJECT_TYPE_VLAN_MEMBER") expect["ASIC_DB"]["tables_not_found"].append("ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT") ddiff = DeepDiff(returned, expect, ignore_order=True) assert not ddiff, ddiff