Skip to content

Commit

Permalink
[vs tests]Migrating sonic-swss tests to use hwsku instead of fakeplat…
Browse files Browse the repository at this point in the history
…form (sonic-net#1978)

* Using Mlnx hwsku instead of fake platform
  • Loading branch information
dgsudharsan committed Nov 4, 2021
1 parent faa26db commit 8448a60
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 25 deletions.
19 changes: 9 additions & 10 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,8 @@ void AclOrch::init(vector<TableConnector>& connectors, PortsOrch *portOrch, Mirr
platform == BFN_PLATFORM_SUBSTRING ||
platform == MRVL_PLATFORM_SUBSTRING ||
platform == INVM_PLATFORM_SUBSTRING ||
platform == NPS_PLATFORM_SUBSTRING)
platform == NPS_PLATFORM_SUBSTRING ||
platform == VS_PLATFORM_SUBSTRING)
{
m_mirrorTableCapabilities =
{
Expand All @@ -2459,19 +2460,17 @@ void AclOrch::init(vector<TableConnector>& connectors, PortsOrch *portOrch, Mirr
SWSS_LOG_NOTICE(" ACL_TABLE_MIRRORV6: %s",
m_mirrorTableCapabilities[ACL_TABLE_MIRRORV6] ? "yes" : "no");

// In Broadcom platform, V4 and V6 rules are stored in the same table
if (platform == BRCM_PLATFORM_SUBSTRING ||
platform == NPS_PLATFORM_SUBSTRING ||
platform == BFN_PLATFORM_SUBSTRING ||
platform == INVM_PLATFORM_SUBSTRING) {
m_isCombinedMirrorV6Table = true;
}

// In Mellanox platform, V4 and V6 rules are stored in different tables
if (platform == MLNX_PLATFORM_SUBSTRING ||
platform == MRVL_PLATFORM_SUBSTRING) {
platform == MRVL_PLATFORM_SUBSTRING)
{
m_isCombinedMirrorV6Table = false;
}
else
{
m_isCombinedMirrorV6Table = true;
}


// Store the capabilities in state database
// TODO: Move this part of the code into syncd
Expand Down
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ For those developing new features for SWSS or the DVS framework, you might find
sudo pytest --dvsname=vs --forcedvs
```

5. Additionally, if you need to simulate a specific hardware platform (e.g. Broadcom or Mellanox), you can add this environment variable when starting the DVS container. Note that this is not a precise 1-to-1 model, and dataplane behavior is not simulated by the DVS.
5. Additionally, if you need to simulate a specific hardware platform (e.g. Broadcom or Mellanox), you can add this environment variable for hardware SKU when starting the DVS container. Note that this is not a precise 1-to-1 model, and dataplane behavior is not simulated by the DVS.

```
-e "fake_platform=mellanox"
-e "HWSKU=Mellanox-SN2700"
```

## Other useful test parameters
Expand Down
2 changes: 0 additions & 2 deletions tests/test_evpn_fdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import time
from evpn_tunnel import VxlanTunnel,VxlanEvpnHelper

DVS_ENV = ["fake_platform=broadcom"]

def get_vxlan_p2p_tunnel_bp(db, remote_ip):
tnl_id = None
bp = None
Expand Down
2 changes: 1 addition & 1 deletion tests/test_evpn_fdb_p2mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time
from evpn_tunnel import VxlanTunnel,VxlanEvpnHelper

DVS_ENV = ["fake_platform=mellanox"]
DVS_ENV = ["HWSKU=Mellanox-SN2700"]

def get_vxlan_p2mp_tunnel_bp(db, src_ip):
tnl_id = None
Expand Down
2 changes: 0 additions & 2 deletions tests/test_evpn_l3_vxlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from evpn_tunnel import VxlanTunnel,VxlanEvpnHelper
import time

DVS_ENV = ["fake_platform=broadcom"]

class TestL3Vxlan(object):

def get_vxlan_obj(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_evpn_l3_vxlan_p2mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from evpn_tunnel import VxlanTunnel,VxlanEvpnHelper
import time

DVS_ENV = ["fake_platform=mellanox"]
DVS_ENV = ["HWSKU=Mellanox-SN2700"]

class TestL3VxlanP2MP(object):

Expand Down
2 changes: 0 additions & 2 deletions tests/test_evpn_tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from pprint import pprint
from evpn_tunnel import VxlanTunnel

DVS_ENV = ["fake_platform=broadcom"]

class TestVxlanOrch(object):

def get_vxlan_obj(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_evpn_tunnel_p2mp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from evpn_tunnel import VxlanTunnel

DVS_ENV = ["fake_platform=mellanox"]
DVS_ENV = ["HWSKU=Mellanox-SN2700"]

class TestVxlanOrchP2MP(object):

Expand Down
3 changes: 0 additions & 3 deletions tests/test_mirror_ipv6_combined.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

from swsscommon import swsscommon

DVS_ENV = ["fake_platform=broadcom"]


class TestMirror(object):
def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_mirror_ipv6_separate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from swsscommon import swsscommon

DVS_ENV = ["fake_platform=mellanox"]
DVS_ENV = ["HWSKU=Mellanox-SN2700"]


class TestMirror(object):
Expand Down

0 comments on commit 8448a60

Please sign in to comment.