diff --git a/tests/conftest.py b/tests/conftest.py index 57cf0efb53d8..ca7588cf57af 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -542,3 +542,9 @@ def dvs(request): dvs = DockerVirtualSwitch(name) yield dvs dvs.destroy() + +@pytest.yield_fixture +def testlog(request, dvs): + dvs.runcmd("logger === start test %s ===" % request.node.name) + yield testlog + dvs.runcmd("logger === finish test %s ===" % request.node.name) diff --git a/tests/test_acl.py b/tests/test_acl.py index 31a5528288e1..98becf8c2b83 100644 --- a/tests/test_acl.py +++ b/tests/test_acl.py @@ -130,7 +130,7 @@ def verify_acl_lag_binding(self, adb, lag_ids): assert len(port_groups) == len(lag_ids) assert set(port_groups) == set(acl_table_groups) - def test_AclTableCreation(self, dvs): + def test_AclTableCreation(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -159,7 +159,7 @@ def test_AclTableCreation(self, dvs): # check port binding self.verify_acl_port_binding(dvs, adb, bind_ports) - def test_AclRuleL4SrcPort(self, dvs): + def test_AclRuleL4SrcPort(self, dvs, testlog): """ hmset ACL_RULE|test|acl_test_rule priority 55 PACKET_ACTION FORWARD L4_SRC_PORT 65000 """ @@ -210,7 +210,7 @@ def test_AclRuleL4SrcPort(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_AclRuleInOutPorts(self, dvs): + def test_AclRuleInOutPorts(self, dvs, testlog): """ hmset ACL_RULE|test|acl_test_rule priority 55 PACKET_ACTION FORWARD IN_PORTS Ethernet0,Ethernet4 OUT_PORTS Ethernet8,Ethernet12 """ @@ -270,7 +270,7 @@ def test_AclRuleInOutPorts(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_AclTableDeletion(self, dvs): + def test_AclTableDeletion(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -286,7 +286,7 @@ def test_AclTableDeletion(self, dvs): # only the default table was left along with DTel tables assert len(keys) >= 1 - def test_V6AclTableCreation(self, dvs): + def test_V6AclTableCreation(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -359,7 +359,7 @@ def test_V6AclTableCreation(self, dvs): assert set(port_groups) == set(acl_table_groups) - def test_V6AclRuleIPv6Any(self, dvs): + def test_V6AclRuleIPv6Any(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule1 priority 1000 PACKET_ACTION FORWARD IPv6Any """ @@ -410,7 +410,7 @@ def test_V6AclRuleIPv6Any(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclRuleIPv6AnyDrop(self, dvs): + def test_V6AclRuleIPv6AnyDrop(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule2 priority 1002 PACKET_ACTION DROP IPv6Any """ @@ -461,7 +461,7 @@ def test_V6AclRuleIPv6AnyDrop(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclRuleIpProtocol(self, dvs): + def test_V6AclRuleIpProtocol(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule3 priority 1003 PACKET_ACTION DROP IP_PROTOCOL 6 """ @@ -512,7 +512,7 @@ def test_V6AclRuleIpProtocol(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclRuleSrcIPv6(self, dvs): + def test_V6AclRuleSrcIPv6(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule4 priority 1004 PACKET_ACTION DROP SRC_IPV6 2777::0/64 """ @@ -563,7 +563,7 @@ def test_V6AclRuleSrcIPv6(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclRuleDstIPv6(self, dvs): + def test_V6AclRuleDstIPv6(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule5 priority 1005 PACKET_ACTION DROP DST_IPV6 2002::2/128 """ @@ -614,7 +614,7 @@ def test_V6AclRuleDstIPv6(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclRuleL4SrcPort(self, dvs): + def test_V6AclRuleL4SrcPort(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule6 priority 1006 PACKET_ACTION DROP L4_SRC_PORT 65000 """ @@ -665,7 +665,7 @@ def test_V6AclRuleL4SrcPort(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclRuleL4DstPort(self, dvs): + def test_V6AclRuleL4DstPort(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule7 priority 1007 PACKET_ACTION DROP L4_DST_PORT 65001 """ @@ -716,7 +716,7 @@ def test_V6AclRuleL4DstPort(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclRuleTCPFlags(self, dvs): + def test_V6AclRuleTCPFlags(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule8 priority 1008 PACKET_ACTION DROP TCP_FLAGS 0x7/0x3f """ @@ -767,7 +767,7 @@ def test_V6AclRuleTCPFlags(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclRuleL4SrcPortRange(self, dvs): + def test_V6AclRuleL4SrcPortRange(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule9 priority 1009 PACKET_ACTION DROP L4_SRC_PORT_RANGE 1-100 """ @@ -832,7 +832,7 @@ def test_V6AclRuleL4SrcPortRange(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclRuleL4DstPortRange(self, dvs): + def test_V6AclRuleL4DstPortRange(self, dvs, testlog): """ hmset ACL_RULE|test-aclv6|test_rule10 priority 1010 PACKET_ACTION DROP L4_DST_PORT_RANGE 101-200 """ @@ -897,7 +897,7 @@ def test_V6AclRuleL4DstPortRange(self, dvs): (status, fvs) = atbl.get(acl_entry[0]) assert status == False - def test_V6AclTableDeletion(self, dvs): + def test_V6AclTableDeletion(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -928,7 +928,7 @@ def check_rule_existence(self, entry, rules, verifs): #did not find the rule return False - def test_InsertAclRuleBetweenPriorities(self, dvs): + def test_InsertAclRuleBetweenPriorities(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -1026,7 +1026,7 @@ def test_InsertAclRuleBetweenPriorities(self, dvs): # only the default table was left assert len(keys) >= 1 - def test_RulesWithDiffMaskLengths(self, dvs): + def test_RulesWithDiffMaskLengths(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -1111,7 +1111,7 @@ def test_RulesWithDiffMaskLengths(self, dvs): keys = atbl.getKeys() assert len(keys) >= 1 - def test_AclTableCreationOnLAGMember(self, dvs): + def test_AclTableCreationOnLAGMember(self, dvs, testlog): # prepare db and tables self.clean_up_left_over(dvs) db = swsscommon.DBConnector(4, dvs.redis_sock, 0) @@ -1139,7 +1139,7 @@ def test_AclTableCreationOnLAGMember(self, dvs): # verify test result - ACL table creation should fail assert self.verify_if_any_acl_table_created(dvs, adb) == False - def test_AclTableCreationOnLAG(self, dvs): + def test_AclTableCreationOnLAG(self, dvs, testlog): # prepare db and tables self.clean_up_left_over(dvs) db = swsscommon.DBConnector(4, dvs.redis_sock, 0) @@ -1189,7 +1189,7 @@ def test_AclTableCreationOnLAG(self, dvs): tbl = swsscommon.Table(db, "ACL_TABLE") tbl._del("test_LAG") - def test_AclTableCreationBeforeLAG(self, dvs): + def test_AclTableCreationBeforeLAG(self, dvs, testlog): # prepare db and tables self.clean_up_left_over(dvs) db = swsscommon.DBConnector(4, dvs.redis_sock, 0) diff --git a/tests/test_crm.py b/tests/test_crm.py index 3e2baf546b55..e649168266fd 100644 --- a/tests/test_crm.py +++ b/tests/test_crm.py @@ -39,7 +39,7 @@ def setReadOnlyAttr(dvs, obj, attr, val): ntf.send("set_ro", key, fvp) -def test_CrmFdbEntry(dvs): +def test_CrmFdbEntry(dvs, testlog): dvs.runcmd("crm config polling interval 1") @@ -92,7 +92,7 @@ def test_CrmFdbEntry(dvs): assert new_avail_counter == avail_counter -def test_CrmIpv4Route(dvs): +def test_CrmIpv4Route(dvs, testlog): dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") @@ -141,7 +141,7 @@ def test_CrmIpv4Route(dvs): assert new_avail_counter == avail_counter -def test_CrmIpv6Route(dvs): +def test_CrmIpv6Route(dvs, testlog): # Enable IPv6 routing dvs.runcmd("sysctl net.ipv6.conf.all.disable_ipv6=0") @@ -197,7 +197,7 @@ def test_CrmIpv6Route(dvs): assert new_avail_counter == avail_counter -def test_CrmIpv4Nexthop(dvs): +def test_CrmIpv4Nexthop(dvs, testlog): dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") @@ -238,7 +238,7 @@ def test_CrmIpv4Nexthop(dvs): assert new_avail_counter == avail_counter -def test_CrmIpv6Nexthop(dvs): +def test_CrmIpv6Nexthop(dvs, testlog): # Enable IPv6 routing dvs.runcmd("sysctl net.ipv6.conf.all.disable_ipv6=0") @@ -283,7 +283,7 @@ def test_CrmIpv6Nexthop(dvs): assert new_avail_counter == avail_counter -def test_CrmIpv4Neighbor(dvs): +def test_CrmIpv4Neighbor(dvs, testlog): dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") @@ -324,7 +324,7 @@ def test_CrmIpv4Neighbor(dvs): assert new_avail_counter == avail_counter -def test_CrmIpv6Neighbor(dvs): +def test_CrmIpv6Neighbor(dvs, testlog): # Enable IPv6 routing dvs.runcmd("sysctl net.ipv6.conf.all.disable_ipv6=0") @@ -369,7 +369,7 @@ def test_CrmIpv6Neighbor(dvs): assert new_avail_counter == avail_counter -def test_CrmNexthopGroup(dvs): +def test_CrmNexthopGroup(dvs, testlog): dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") dvs.runcmd("ifconfig Ethernet4 10.0.0.2/31 up") @@ -421,7 +421,7 @@ def test_CrmNexthopGroup(dvs): assert new_avail_counter == avail_counter -def test_CrmNexthopGroupMember(dvs): +def test_CrmNexthopGroupMember(dvs, testlog): # down, then up to generate port up signal dvs.servers[0].runcmd("ip link set down dev eth0") == 0 @@ -479,7 +479,7 @@ def test_CrmNexthopGroupMember(dvs): assert new_avail_counter == avail_counter -def test_CrmAcl(dvs): +def test_CrmAcl(dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) diff --git a/tests/test_dirbcast.py b/tests/test_dirbcast.py index bf7d50c3c0e5..b05b505bd695 100644 --- a/tests/test_dirbcast.py +++ b/tests/test_dirbcast.py @@ -3,7 +3,7 @@ import re import json -def test_DirectedBroadcast(dvs): +def test_DirectedBroadcast(dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) diff --git a/tests/test_dtel.py b/tests/test_dtel.py index 8cdebbf425f1..a31d7af321a5 100644 --- a/tests/test_dtel.py +++ b/tests/test_dtel.py @@ -6,7 +6,7 @@ import json class TestDtel(object): - def test_DtelGlobalAttribs(self, dvs): + def test_DtelGlobalAttribs(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -86,7 +86,7 @@ def test_DtelGlobalAttribs(self, dvs): tbl._del("QUEUE_REPORT") tbl._del("SINK_PORT_LIST") - def test_DtelReportSessionAttribs(self, dvs): + def test_DtelReportSessionAttribs(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -127,7 +127,7 @@ def test_DtelReportSessionAttribs(self, dvs): tbl._del("RS-1") - def test_DtelINTSessionAttribs(self, dvs): + def test_DtelINTSessionAttribs(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -171,7 +171,7 @@ def test_DtelINTSessionAttribs(self, dvs): tbl._del("INT-1") - def test_DtelQueueReportAttribs(self, dvs): + def test_DtelQueueReportAttribs(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) @@ -212,7 +212,7 @@ def test_DtelQueueReportAttribs(self, dvs): tbl._del("Ethernet0|0") - def test_DtelEventAttribs(self, dvs): + def test_DtelEventAttribs(self, dvs, testlog): db = swsscommon.DBConnector(4, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) diff --git a/tests/test_fdb_cold.py b/tests/test_fdb_cold.py index d0556a2e855e..4e4b9ad21e64 100644 --- a/tests/test_fdb_cold.py +++ b/tests/test_fdb_cold.py @@ -24,7 +24,7 @@ def how_many_entries_exist(db, table): tbl = swsscommon.Table(db, table) return len(tbl.getKeys()) -def test_FDBAddedAfterMemberCreated(dvs): +def test_FDBAddedAfterMemberCreated(dvs, testlog): dvs.setup_db() dvs.runcmd("sonic-clear fdb all") diff --git a/tests/test_fdb_warm.py b/tests/test_fdb_warm.py index db466e9c4e72..492fe781e57d 100644 --- a/tests/test_fdb_warm.py +++ b/tests/test_fdb_warm.py @@ -24,7 +24,7 @@ def how_many_entries_exist(db, table): tbl = swsscommon.Table(db, table) return len(tbl.getKeys()) -def test_fdb_notifications(dvs): +def test_fdb_notifications(dvs, testlog): dvs.setup_db() dvs.runcmd("sonic-clear fdb all") diff --git a/tests/test_interface.py b/tests/test_interface.py index 11384fe60d6f..9a86e197edb2 100644 --- a/tests/test_interface.py +++ b/tests/test_interface.py @@ -26,7 +26,7 @@ def set_mtu(self, interface, mtu): tbl.set(interface, fvs) time.sleep(1) - def test_InterfaceAddRemoveIpv4Address(self, dvs): + def test_InterfaceAddRemoveIpv4Address(self, dvs, testlog): self.setup_db(dvs) # assign IP to interface @@ -95,7 +95,7 @@ def test_InterfaceAddRemoveIpv4Address(self, dvs): if route["dest"] == "10.0.0.4/32": assert False - def test_InterfaceSetMtu(self, dvs): + def test_InterfaceSetMtu(self, dvs, testlog): self.setup_db(dvs) # assign IP to interface @@ -175,7 +175,7 @@ def set_mtu(self, interface, mtu): tbl.set(interface, fvs) time.sleep(1) - def test_InterfaceAddRemoveIpv4Address(self, dvs): + def test_InterfaceAddRemoveIpv4Address(self, dvs, testlog): self.setup_db(dvs) # create port channel @@ -251,7 +251,7 @@ def test_InterfaceAddRemoveIpv4Address(self, dvs): self.remove_port_channel(dvs, "PortChannel001") - def test_InterfaceSetMtu(self, dvs): + def test_InterfaceSetMtu(self, dvs, testlog): self.setup_db(dvs) # create port channel diff --git a/tests/test_mirror.py b/tests/test_mirror.py index 6ad4cf418138..d1a298404064 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -97,7 +97,7 @@ def get_mirror_session_state(self, name): return { fv[0]: fv[1] for fv in fvs } - def test_MirrorAddRemove(self, dvs): + def test_MirrorAddRemove(self, dvs, testlog): """ This test covers the basic mirror session creation and removal operations Operation flow: @@ -229,7 +229,7 @@ def remove_fdb(self, vlan, mac): # Ignore testcase in Debian Jessie # TODO: Remove this skip if Jessie support is no longer needed @pytest.mark.skipif(StrictVersion(platform.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") - def test_MirrorToVlanAddRemove(self, dvs): + def test_MirrorToVlanAddRemove(self, dvs, testlog): """ This test covers basic mirror session creation and removal operation with destination port sits in a VLAN @@ -365,7 +365,7 @@ def remove_port_channel_member(self, channel, interface): time.sleep(1) - def test_MirrorToLagAddRemove(self, dvs): + def test_MirrorToLagAddRemove(self, dvs, testlog): """ This test covers basic mirror session creation and removal operations with destination port sits in a LAG @@ -436,7 +436,7 @@ def test_MirrorToLagAddRemove(self, dvs): # Ignore testcase in Debian Jessie # TODO: Remove this skip if Jessie support is no longer needed @pytest.mark.skipif(StrictVersion(platform.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") - def test_MirrorDestMoveVlan(self, dvs): + def test_MirrorDestMoveVlan(self, dvs, testlog): """ This test tests mirror session destination move from non-VLAN to VLAN and back to non-VLAN port @@ -554,7 +554,7 @@ def test_MirrorDestMoveVlan(self, dvs): self.remove_mirror_session(session) - def test_MirrorDestMoveLag(self, dvs): + def test_MirrorDestMoveLag(self, dvs, testlog): """ This test tests mirror session destination move from non-LAG to LAG and back to non-LAG port @@ -707,7 +707,7 @@ def remove_mirror_acl_dscp_rule(self, table, rule): time.sleep(1) - def test_AclBindMirror(self, dvs): + def test_AclBindMirror(self, dvs, testlog): """ This test tests ACL associated with mirror session with DSCP value The DSCP value is tested on both with mask and without mask diff --git a/tests/test_nhg.py b/tests/test_nhg.py index 75f336d0275f..6694cd885fc8 100644 --- a/tests/test_nhg.py +++ b/tests/test_nhg.py @@ -4,7 +4,7 @@ import time import json -def test_route_nhg(dvs): +def test_route_nhg(dvs, testlog): dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") dvs.runcmd("ifconfig Ethernet4 10.0.0.2/31 up") diff --git a/tests/test_pfc.py b/tests/test_pfc.py index 19cfc50e269d..8ed9112beab0 100644 --- a/tests/test_pfc.py +++ b/tests/test_pfc.py @@ -58,7 +58,7 @@ def getPortAttr(dvs, port_oid, port_attr): return '' -def test_PfcAsymmetric(dvs): +def test_PfcAsymmetric(dvs, testlog): port_name = 'Ethernet0' pfc_queues = [ 3, 4 ] diff --git a/tests/test_port.py b/tests/test_port.py index ce841800c3f7..54de1d0b52fb 100644 --- a/tests/test_port.py +++ b/tests/test_port.py @@ -4,7 +4,7 @@ import os class TestPort(object): - def test_PortMtu(self, dvs): + def test_PortMtu(self, dvs, testlog): pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0) adb = swsscommon.DBConnector(1, dvs.redis_sock, 0) cdb = swsscommon.DBConnector(4, dvs.redis_sock, 0) @@ -23,7 +23,7 @@ def test_PortMtu(self, dvs): if fv[0] == "mtu": assert fv[1] == "9100" -def test_PortNotification(dvs): +def test_PortNotification(dvs, testlog): dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") == 0 dvs.runcmd("ifconfig Ethernet4 10.0.0.2/31 up") == 0 @@ -66,7 +66,7 @@ def test_PortNotification(dvs): assert oper_status == "up" -def test_PortFec(dvs): +def test_PortFec(dvs, testlog): dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") == 0 dvs.runcmd("ifconfig Ethernet4 10.0.0.2/31 up") == 0 diff --git a/tests/test_port_an.py b/tests/test_port_an.py index b9912caf173a..3b4414059a36 100644 --- a/tests/test_port_an.py +++ b/tests/test_port_an.py @@ -2,7 +2,7 @@ import time import os -def test_PortAutoNeg(dvs): +def test_PortAutoNeg(dvs, testlog): db = swsscommon.DBConnector(0, dvs.redis_sock, 0) diff --git a/tests/test_port_buffer_rel.py b/tests/test_port_buffer_rel.py index d8c3497121d5..231bec6ddf32 100644 --- a/tests/test_port_buffer_rel.py +++ b/tests/test_port_buffer_rel.py @@ -3,7 +3,7 @@ # The test check that the ports will be up, when the admin state is UP by conf db. -def test_PortsAreUpAfterBuffers(dvs): +def test_PortsAreUpAfterBuffers(dvs, testlog): num_ports = 32 asic_db = swsscommon.DBConnector(swsscommon.ASIC_DB, dvs.redis_sock, 0) conf_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0) diff --git a/tests/test_portchannel.py b/tests/test_portchannel.py index f9ac0bf79709..569b06d02fa5 100644 --- a/tests/test_portchannel.py +++ b/tests/test_portchannel.py @@ -3,7 +3,7 @@ import re import json -def test_PortChannel(dvs): +def test_PortChannel(dvs, testlog): # create port channel db = swsscommon.DBConnector(0, dvs.redis_sock, 0) diff --git a/tests/test_route.py b/tests/test_route.py index 20f66b9337ce..1ed77630805b 100644 --- a/tests/test_route.py +++ b/tests/test_route.py @@ -4,7 +4,7 @@ import time import json -def test_RouteAdd(dvs): +def test_RouteAdd(dvs, testlog): dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") dvs.runcmd("ifconfig Ethernet4 10.0.0.2/31 up") diff --git a/tests/test_setro.py b/tests/test_setro.py index 1f619e66464e..8c962dd20e8c 100755 --- a/tests/test_setro.py +++ b/tests/test_setro.py @@ -4,7 +4,7 @@ import redis from pprint import pprint -def test_SetReadOnlyAttribute(dvs): +def test_SetReadOnlyAttribute(dvs, testlog): db = swsscommon.DBConnector(swsscommon.ASIC_DB, dvs.redis_sock, 0) diff --git a/tests/test_speed.py b/tests/test_speed.py index c4f92a7ef78d..4425d7f3b620 100644 --- a/tests/test_speed.py +++ b/tests/test_speed.py @@ -15,7 +15,7 @@ class TestSpeedSet(object): num_ports = 32 - def test_SpeedAndBufferSet(self, dvs): + def test_SpeedAndBufferSet(self, dvs, testlog): speed_list = ['50000', '25000', '40000', '10000', '100000'] cdb = swsscommon.DBConnector(4, dvs.redis_sock, 0) diff --git a/tests/test_tunnel.py b/tests/test_tunnel.py index 5b21b9e993e7..7aae9f01f16a 100644 --- a/tests/test_tunnel.py +++ b/tests/test_tunnel.py @@ -163,7 +163,7 @@ def cleanup_left_over(self, db, asicdb): class TestDecapTunnel(TestTunnelBase): """ Tests for decap tunnel creation and removal """ - def test_TunnelDecap_v4(self, dvs): + def test_TunnelDecap_v4(self, dvs, testlog): """ test IPv4 tunnel creation """ db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) @@ -177,7 +177,7 @@ def test_TunnelDecap_v4(self, dvs): ecn_mode="standard", ttl_mode="pipe") self.remove_and_test_tunnel(db, asicdb, "IPINIPv4Decap") - def test_TunnelDecap_v6(self, dvs): + def test_TunnelDecap_v6(self, dvs, testlog): """ test IPv6 tunnel creation """ db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) @@ -195,7 +195,7 @@ def test_TunnelDecap_v6(self, dvs): class TestSymmetricTunnel(TestTunnelBase): """ Tests for symmetric tunnel creation and removal """ - def test_TunnelSymmetric_v4(self, dvs): + def test_TunnelSymmetric_v4(self, dvs, testlog): """ test IPv4 tunnel creation """ db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) @@ -210,7 +210,7 @@ def test_TunnelSymmetric_v4(self, dvs): ecn_mode="copy_from_outer", ttl_mode="uniform") self.remove_and_test_tunnel(db, asicdb, "IPINIPv4Symmetric") - def test_TunnelSymmetric_v6(self, dvs): + def test_TunnelSymmetric_v6(self, dvs, testlog): """ test IPv6 tunnel creation """ db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) diff --git a/tests/test_vlan.py b/tests/test_vlan.py index efe554737c98..e16c16a8d130 100644 --- a/tests/test_vlan.py +++ b/tests/test_vlan.py @@ -35,7 +35,7 @@ def remove_vlan_member(self, vlan, interface): tbl._del("Vlan" + vlan + "|" + interface) time.sleep(1) - def test_VlanAddRemove(self, dvs): + def test_VlanAddRemove(self, dvs, testlog): self.setup_db(dvs) # create vlan @@ -108,7 +108,7 @@ def test_VlanAddRemove(self, dvs): # remvoe vlan self.remove_vlan("2") - def test_MultipleVlan(self, dvs): + def test_MultipleVlan(self, dvs, testlog): return self.setup_db(dvs) diff --git a/tests/test_vrf.py b/tests/test_vrf.py index 9307d9d584e9..3dec3e0dc19f 100644 --- a/tests/test_vrf.py +++ b/tests/test_vrf.py @@ -151,7 +151,7 @@ def packet_action_gen(): return r[0], r[1] -def test_VRFOrch_Comprehensive(dvs): +def test_VRFOrch_Comprehensive(dvs, testlog): asic_db = swsscommon.DBConnector(swsscommon.ASIC_DB, dvs.redis_sock, 0) appl_db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) @@ -182,7 +182,7 @@ def test_VRFOrch_Comprehensive(dvs): vrf_remove(asic_db, appl_db, vrf_name, state) -def test_VRFOrch(dvs): +def test_VRFOrch(dvs, testlog): asic_db = swsscommon.DBConnector(swsscommon.ASIC_DB, dvs.redis_sock, 0) appl_db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) state = vrf_create(asic_db, appl_db, "vrf0", @@ -205,7 +205,7 @@ def test_VRFOrch(dvs): ) vrf_remove(asic_db, appl_db, "vrf1", state) -def test_VRFOrch_Update(dvs): +def test_VRFOrch_Update(dvs, testlog): asic_db = swsscommon.DBConnector(swsscommon.ASIC_DB, dvs.redis_sock, 0) appl_db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) diff --git a/tests/test_vxlan_tunnel.py b/tests/test_vxlan_tunnel.py index 56cc557dbffa..fd6673de55fd 100644 --- a/tests/test_vxlan_tunnel.py +++ b/tests/test_vxlan_tunnel.py @@ -235,7 +235,7 @@ def get_lo(dvs): return lo_id -def test_vxlan_term_orch(dvs): +def test_vxlan_term_orch(dvs, testlog): tunnel_map_ids = set() tunnel_map_entry_ids = set() tunnel_ids = set() diff --git a/tests/test_warm_reboot.py b/tests/test_warm_reboot.py index f83bfffb6707..eec6be98e7fc 100644 --- a/tests/test_warm_reboot.py +++ b/tests/test_warm_reboot.py @@ -101,7 +101,7 @@ def how_many_entries_exist(db, table): tbl = swsscommon.Table(db, table) return len(tbl.getKeys()) -def test_PortSyncdWarmRestart(dvs): +def test_PortSyncdWarmRestart(dvs, testlog): conf_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0) appl_db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) @@ -179,7 +179,7 @@ def test_PortSyncdWarmRestart(dvs): swss_app_check_RestoreCount_single(state_db, restore_count, "portsyncd") -def test_VlanMgrdWarmRestart(dvs): +def test_VlanMgrdWarmRestart(dvs, testlog): conf_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0) appl_db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) @@ -308,7 +308,7 @@ def check_syslog_for_neighbor_entry(dvs, marker, new_cnt, delete_cnt, iptype): else: assert "iptype is unknown" == "" -def test_swss_neighbor_syncup(dvs): +def test_swss_neighbor_syncup(dvs, testlog): appl_db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) conf_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0) @@ -659,7 +659,7 @@ def test_swss_neighbor_syncup(dvs): # TODO: The condition of warm restart readiness check is still under discussion. -def test_OrchagentWarmRestartReadyCheck(dvs): +def test_OrchagentWarmRestartReadyCheck(dvs, testlog): # do a pre-cleanup dvs.runcmd("ip -s -s neigh flush all") @@ -709,7 +709,7 @@ def test_OrchagentWarmRestartReadyCheck(dvs): dvs.start_swss() time.sleep(5) -def test_swss_port_state_syncup(dvs): +def test_swss_port_state_syncup(dvs, testlog): appl_db = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) conf_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0)