Skip to content

Commit

Permalink
Remove skip of subinterface tests and remove rif loopback tests
Browse files Browse the repository at this point in the history
Signed-off-by: liora <liora@nvidia.com>
  • Loading branch information
liorghub committed Aug 17, 2022
1 parent fd0c585 commit 334899a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 106 deletions.
97 changes: 0 additions & 97 deletions tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from swsscommon import swsscommon

VLAN_SUB_INTERFACE_SEPARATOR = '.'

class TestRouterInterface(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down Expand Up @@ -2195,101 +2193,6 @@ def test_VLanInterfaceIpv6LinkLocalOnly(self, dvs, testlog):
# one loopback router interface
assert len(intf_entries) == 1

def set_loopback_action(self, interface, action):
if interface.startswith("PortChannel"):
tbl_name = "PORTCHANNEL_INTERFACE"
elif interface.startswith("Vlan"):
tbl_name = "VLAN_INTERFACE"
else:
sub_intf_sep_idx = interface.find(VLAN_SUB_INTERFACE_SEPARATOR)
if sub_intf_sep_idx != -1:
tbl_name = "VLAN_SUB_INTERFACE"
else:
tbl_name = "INTERFACE"

fvs = swsscommon.FieldValuePairs([("loopback_action", action)])
tbl = swsscommon.Table(self.cdb, tbl_name)
tbl.set(interface, fvs)
time.sleep(1)

def loopback_action_test(self, iface, action):
# create interface
self.create_l3_intf(iface, "")

# set interface loopback action in config db
self.set_loopback_action(iface, action)

# check application database
tbl = swsscommon.Table(self.pdb, "INTF_TABLE")
(status, fvs) = tbl.get(iface)
assert status == True

action_found = False
for fv in fvs:
if fv[0] == "loopback_action":
action_found = True
assert fv[1] == action
assert action_found == True

# check asic db
tbl = swsscommon.Table(self.adb, "ASIC_STATE:SAI_OBJECT_TYPE_ROUTER_INTERFACE")
intf_entries = tbl.getKeys()

action_map = {"drop": "SAI_PACKET_ACTION_DROP", "forward": "SAI_PACKET_ACTION_FORWARD"}
action_found = False
for key in intf_entries:
(status, fvs) = tbl.get(key)
assert status == True

for fv in fvs:
if fv[0] == "SAI_ROUTER_INTERFACE_ATTR_LOOPBACK_PACKET_ACTION":
action_found = True
assert fv[1] == action_map[action]
assert action_found == True

# remove interface
self.remove_l3_intf(iface)

def test_interfaceLoopbackActionDrop(self, dvs, testlog):
self.setup_db(dvs)
self.loopback_action_test("Ethernet8", "drop")

def test_interfaceLoopbackActionForward(self, dvs, testlog):
self.setup_db(dvs)
self.loopback_action_test("Ethernet8", "forward")

def test_subInterfaceLoopbackActionDrop(self, dvs, testlog):
self.setup_db(dvs)
self.loopback_action_test("Ethernet8.1", "drop")

def test_subInterfaceLoopbackActionForward(self, dvs, testlog):
self.setup_db(dvs)
self.loopback_action_test("Ethernet8.1", "forward")

def test_vlanInterfaceLoopbackActionDrop(self, dvs, testlog):
self.setup_db(dvs)
self.create_vlan("10")
self.loopback_action_test("Vlan10", "drop")
self.remove_vlan("10")

def test_vlanInterfaceLoopbackActionForward(self, dvs, testlog):
self.setup_db(dvs)
self.create_vlan("20")
self.loopback_action_test("Vlan20", "forward")
self.remove_vlan("20")

def test_portChannelInterfaceLoopbackActionDrop(self, dvs, testlog):
self.setup_db(dvs)
self.create_port_channel("PortChannel009")
self.loopback_action_test("PortChannel009", "drop")
self.remove_port_channel("PortChannel009")

def test_portChannelInterfaceLoopbackActionForward(self, dvs, testlog):
self.setup_db(dvs)
self.create_port_channel("PortChannel010")
self.loopback_action_test("PortChannel010", "forward")
self.remove_port_channel("PortChannel010")

# Add Dummy always-pass test at end as workaroud
# for issue when Flaky fail on final test it invokes module tear-down before retrying
def test_nonflaky_dummy():
Expand Down
9 changes: 0 additions & 9 deletions tests/test_sub_port_intf.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ def _test_sub_port_intf_creation(self, dvs, sub_port_intf_name, vrf_name=None):
self.remove_lag(parent_port)
self.check_lag_removal(parent_port_oid)

@pytest.mark.skip(reason="Failing. Under investigation")
def test_sub_port_intf_creation(self, dvs):
self.connect_dbs(dvs)

Expand Down Expand Up @@ -669,7 +668,6 @@ def _test_sub_port_intf_add_ip_addrs(self, dvs, sub_port_intf_name, vrf_name=Non
self.remove_lag(parent_port)
self.asic_db.wait_for_n_keys(ASIC_LAG_TABLE, 0)

@pytest.mark.skip(reason="Failing. Under investigation")
def test_sub_port_intf_add_ip_addrs(self, dvs):
self.connect_dbs(dvs)

Expand Down Expand Up @@ -745,7 +743,6 @@ def _test_sub_port_intf_appl_db_proc_seq(self, dvs, sub_port_intf_name, admin_up
self.remove_lag(parent_port)
self.check_lag_removal(parent_port_oid)

@pytest.mark.skip(reason="Failing. Under investigation")
def test_sub_port_intf_appl_db_proc_seq(self, dvs):
self.connect_dbs(dvs)

Expand Down Expand Up @@ -870,7 +867,6 @@ def _test_sub_port_intf_admin_status_change(self, dvs, sub_port_intf_name, vrf_n
self.remove_lag(parent_port)
self.asic_db.wait_for_n_keys(ASIC_LAG_TABLE, 0)

@pytest.mark.skip(reason="Failing. Under investigation")
def test_sub_port_intf_admin_status_change(self, dvs):
self.connect_dbs(dvs)

Expand Down Expand Up @@ -955,7 +951,6 @@ def _test_sub_port_intf_remove_ip_addrs(self, dvs, sub_port_intf_name, vrf_name=
self.remove_lag(parent_port)
self.asic_db.wait_for_n_keys(ASIC_LAG_TABLE, 0)

@pytest.mark.skip(reason="Failing. Under investigation")
def test_sub_port_intf_remove_ip_addrs(self, dvs):
self.connect_dbs(dvs)

Expand Down Expand Up @@ -1147,7 +1142,6 @@ def _test_sub_port_intf_removal(self, dvs, sub_port_intf_name, removal_seq_test=
self.remove_lag(parent_port)
self.check_lag_removal(parent_port_oid)

@pytest.mark.skip(reason="Failing. Under investigation")
def test_sub_port_intf_removal(self, dvs):
self.connect_dbs(dvs)

Expand Down Expand Up @@ -1223,7 +1217,6 @@ def _test_sub_port_intf_mtu(self, dvs, sub_port_intf_name, vrf_name=None):
self.remove_lag(parent_port)
self.asic_db.wait_for_n_keys(ASIC_LAG_TABLE, 0)

@pytest.mark.skip(reason="Failing. Under investigation")
def test_sub_port_intf_mtu(self, dvs):
self.connect_dbs(dvs)

Expand Down Expand Up @@ -1452,7 +1445,6 @@ def _test_sub_port_intf_nhg_accel(self, dvs, sub_port_intf_name, nhop_num=3, cre

parent_port_idx += (4 if parent_port_prefix == ETHERNET_PREFIX else 1)

@pytest.mark.skip(reason="Failing. Under investigation")
def test_sub_port_intf_nhg_accel(self, dvs):
self.connect_dbs(dvs)

Expand Down Expand Up @@ -1593,7 +1585,6 @@ def _test_sub_port_intf_oper_down_with_pending_neigh_route_tasks(self, dvs, sub_

parent_port_idx += (4 if parent_port_prefix == ETHERNET_PREFIX else 1)

@pytest.mark.skip(reason="Failing. Under investigation")
def test_sub_port_intf_oper_down_with_pending_neigh_route_tasks(self, dvs):
self.connect_dbs(dvs)

Expand Down

0 comments on commit 334899a

Please sign in to comment.