Skip to content

Commit

Permalink
[vs tests] Remove class-level flaky fixtures (#1189)
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Allen <daall@microsoft.com>
  • Loading branch information
daall authored and lguohan committed Jan 30, 2020
1 parent dc695fb commit 1883c0a
Show file tree
Hide file tree
Showing 42 changed files with 0 additions and 84 deletions.
3 changes: 0 additions & 3 deletions tests/test_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


class BaseTestAcl(object):
Expand Down Expand Up @@ -188,7 +187,6 @@ def verify_acl_rule(self, dvs, field, value):
assert False


@pytest.mark.flaky
class TestAcl(BaseTestAcl):
def test_AclTableCreation(self, dvs, testlog):
self.setup_db(dvs)
Expand Down Expand Up @@ -1375,7 +1373,6 @@ def test_AclRuleRedirectToNexthop(self, dvs, testlog):
dvs.set_interface_status("Ethernet4", "down")


@pytest.mark.flaky
class TestAclRuleValidation(BaseTestAcl):
""" Test class for cases that check if orchagent corectly validates
ACL rules input
Expand Down
2 changes: 0 additions & 2 deletions tests/test_acl_ctrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestPortChannelAcl(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_acl_egress_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestEgressAclTable(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_acl_portchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestPortChannelAcl(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_admin_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestAdminStatus(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_crm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky

def getCrmCounterValue(dvs, key, counter):

Expand Down Expand Up @@ -65,7 +64,6 @@ def check_syslog(dvs, marker, err_log, expected_cnt):
assert num.strip() >= str(expected_cnt)


@pytest.mark.flaky
class TestCrm(object):
def test_CrmFdbEntry(self, dvs, testlog):

Expand Down
2 changes: 0 additions & 2 deletions tests/test_dirbcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestDirectedBroadcast(object):
def test_DirectedBroadcast(self, dvs, testlog):

Expand Down
2 changes: 0 additions & 2 deletions tests/test_drop_counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky

# Supported drop counters
PORT_INGRESS_DROPS = 'PORT_INGRESS_DROPS'
Expand Down Expand Up @@ -59,7 +58,6 @@
# FIXME: It is really annoying to have to re-run tests due to inconsistent timing, should
# implement some sort of polling interface for checking ASIC/flex counter tables after
# applying changes to config DB
@pytest.mark.flaky
class TestDropCounters(object):
def setup_db(self, dvs):
self.asic_db = swsscommon.DBConnector(1, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_dtel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestDtel(object):
def test_DtelGlobalAttribs(self, dvs, testlog):

Expand Down
2 changes: 0 additions & 2 deletions tests/test_fdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky
from distutils.version import StrictVersion

def create_entry(tbl, key, pairs):
Expand All @@ -28,7 +27,6 @@ def how_many_entries_exist(db, table):
return len(tbl.getKeys())


@pytest.mark.flaky
class TestFdb(object):
def test_FdbWarmRestartNotifications(self, dvs, testlog):
dvs.setup_db()
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fdb_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky
from distutils.version import StrictVersion


@pytest.mark.flaky
class TestFdbUpdate(object):
def create_entry(self, tbl, key, pairs):
fvs = swsscommon.FieldValuePairs(pairs)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestRouterInterface(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import time

from swsscommon import swsscommon
from flaky import flaky
from distutils.version import StrictVersion


@pytest.mark.flaky
class TestMirror(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_mirror_ipv6_combined.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
import time

from swsscommon import swsscommon
from flaky import flaky
from distutils.version import StrictVersion

DVS_FAKE_PLATFORM = "broadcom"


@pytest.mark.flaky
class TestMirror(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_mirror_ipv6_separate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
from distutils.version import StrictVersion

from swsscommon import swsscommon
from flaky import flaky

DVS_FAKE_PLATFORM = "mellanox"


@pytest.mark.flaky
class TestMirror(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_mirror_policer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import time

from swsscommon import swsscommon
from flaky import flaky
from distutils.version import StrictVersion


@pytest.mark.flaky
class TestMirror(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
1 change: 0 additions & 1 deletion tests/test_nat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os

from swsscommon import swsscommon
from flaky import flaky


# FIXME: These tests depend on changes in sonic-buildimage, we need to reenable
Expand Down
2 changes: 0 additions & 2 deletions tests/test_neighbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestNeighbor(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_nhg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestNextHopGroup(object):
def test_route_nhg(self, dvs, testlog):
config_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_pfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky

def getBitMaskStr(bits):

Expand Down Expand Up @@ -60,7 +59,6 @@ def getPortAttr(dvs, port_oid, port_attr):
return ''


@pytest.mark.flaky
class TestPfc(object):
def test_PfcAsymmetric(self, dvs, testlog):

Expand Down
2 changes: 0 additions & 2 deletions tests/test_policer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import time

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestPolicer(object):
def test_PolicerBasic(self, dvs, testlog):
dvs.setup_db()
Expand Down
2 changes: 0 additions & 2 deletions tests/test_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestPort(object):
def test_PortMtu(self, dvs, testlog):
pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_port_an.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestPortAutoNeg(object):
def test_PortAutoNegCold(self, dvs, testlog):

Expand Down
2 changes: 0 additions & 2 deletions tests/test_port_buffer_rel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


# The test check that the ports will be up, when the admin state is UP by conf db.
@pytest.mark.flaky
class TestPortBuffer(object):
def test_PortsAreUpAfterBuffers(self, dvs, testlog):
num_ports = 32
Expand Down
2 changes: 0 additions & 2 deletions tests/test_port_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.yield_fixture
Expand All @@ -15,7 +14,6 @@ def port_config(request, dvs):
dvs.runcmd("mv %s.bak %s" % (file_name, file_name))


@pytest.mark.flaky
class TestPortConfig(object):

def getPortName(self, dvs, port_vid):
Expand Down
2 changes: 0 additions & 2 deletions tests/test_port_mac_learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestPortMacLearn(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_portchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestPortchannel(object):
def test_Portchannel(self, dvs, testlog):

Expand Down
2 changes: 0 additions & 2 deletions tests/test_qos_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import time

from swsscommon import swsscommon
from flaky import flaky

CFG_DOT1P_TO_TC_MAP_TABLE_NAME = "DOT1P_TO_TC_MAP"
CFG_DOT1P_TO_TC_MAP_KEY = "AZURE"
Expand All @@ -24,7 +23,6 @@
CFG_PORT_TABLE_NAME = "PORT"


@pytest.mark.flaky
class TestDot1p(object):
def connect_dbs(self, dvs):
self.asic_db = swsscommon.DBConnector(1, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestRoute(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_setro.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@

from pprint import pprint
from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestSetRo(object):
def test_SetReadOnlyAttribute(self, dvs, testlog):

Expand Down
2 changes: 0 additions & 2 deletions tests/test_sflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import pytest

from swsscommon import swsscommon
from flaky import flaky


@pytest.mark.flaky
class TestSflow(object):
speed_rate_table = {
"400000":"40000",
Expand Down
Loading

0 comments on commit 1883c0a

Please sign in to comment.