Skip to content

Commit 8448a60

Browse files
authored
[vs tests]Migrating sonic-swss tests to use hwsku instead of fakeplatform (#1978)
* Using Mlnx hwsku instead of fake platform
1 parent faa26db commit 8448a60

10 files changed

+15
-25
lines changed

orchagent/aclorch.cpp

+9-10
Original file line numberDiff line numberDiff line change
@@ -2436,7 +2436,8 @@ void AclOrch::init(vector<TableConnector>& connectors, PortsOrch *portOrch, Mirr
24362436
platform == BFN_PLATFORM_SUBSTRING ||
24372437
platform == MRVL_PLATFORM_SUBSTRING ||
24382438
platform == INVM_PLATFORM_SUBSTRING ||
2439-
platform == NPS_PLATFORM_SUBSTRING)
2439+
platform == NPS_PLATFORM_SUBSTRING ||
2440+
platform == VS_PLATFORM_SUBSTRING)
24402441
{
24412442
m_mirrorTableCapabilities =
24422443
{
@@ -2459,19 +2460,17 @@ void AclOrch::init(vector<TableConnector>& connectors, PortsOrch *portOrch, Mirr
24592460
SWSS_LOG_NOTICE(" ACL_TABLE_MIRRORV6: %s",
24602461
m_mirrorTableCapabilities[ACL_TABLE_MIRRORV6] ? "yes" : "no");
24612462

2462-
// In Broadcom platform, V4 and V6 rules are stored in the same table
2463-
if (platform == BRCM_PLATFORM_SUBSTRING ||
2464-
platform == NPS_PLATFORM_SUBSTRING ||
2465-
platform == BFN_PLATFORM_SUBSTRING ||
2466-
platform == INVM_PLATFORM_SUBSTRING) {
2467-
m_isCombinedMirrorV6Table = true;
2468-
}
2469-
24702463
// In Mellanox platform, V4 and V6 rules are stored in different tables
24712464
if (platform == MLNX_PLATFORM_SUBSTRING ||
2472-
platform == MRVL_PLATFORM_SUBSTRING) {
2465+
platform == MRVL_PLATFORM_SUBSTRING)
2466+
{
24732467
m_isCombinedMirrorV6Table = false;
24742468
}
2469+
else
2470+
{
2471+
m_isCombinedMirrorV6Table = true;
2472+
}
2473+
24752474

24762475
// Store the capabilities in state database
24772476
// TODO: Move this part of the code into syncd

tests/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ For those developing new features for SWSS or the DVS framework, you might find
103103
sudo pytest --dvsname=vs --forcedvs
104104
```
105105
106-
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.
106+
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.
107107
108108
```
109-
-e "fake_platform=mellanox"
109+
-e "HWSKU=Mellanox-SN2700"
110110
```
111111
112112
## Other useful test parameters

tests/test_evpn_fdb.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import time
33
from evpn_tunnel import VxlanTunnel,VxlanEvpnHelper
44

5-
DVS_ENV = ["fake_platform=broadcom"]
6-
75
def get_vxlan_p2p_tunnel_bp(db, remote_ip):
86
tnl_id = None
97
bp = None

tests/test_evpn_fdb_p2mp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import time
33
from evpn_tunnel import VxlanTunnel,VxlanEvpnHelper
44

5-
DVS_ENV = ["fake_platform=mellanox"]
5+
DVS_ENV = ["HWSKU=Mellanox-SN2700"]
66

77
def get_vxlan_p2mp_tunnel_bp(db, src_ip):
88
tnl_id = None

tests/test_evpn_l3_vxlan.py

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
from evpn_tunnel import VxlanTunnel,VxlanEvpnHelper
66
import time
77

8-
DVS_ENV = ["fake_platform=broadcom"]
9-
108
class TestL3Vxlan(object):
119

1210
def get_vxlan_obj(self):

tests/test_evpn_l3_vxlan_p2mp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from evpn_tunnel import VxlanTunnel,VxlanEvpnHelper
33
import time
44

5-
DVS_ENV = ["fake_platform=mellanox"]
5+
DVS_ENV = ["HWSKU=Mellanox-SN2700"]
66

77
class TestL3VxlanP2MP(object):
88

tests/test_evpn_tunnel.py

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from pprint import pprint
55
from evpn_tunnel import VxlanTunnel
66

7-
DVS_ENV = ["fake_platform=broadcom"]
8-
97
class TestVxlanOrch(object):
108

119
def get_vxlan_obj(self):

tests/test_evpn_tunnel_p2mp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from evpn_tunnel import VxlanTunnel
22

3-
DVS_ENV = ["fake_platform=mellanox"]
3+
DVS_ENV = ["HWSKU=Mellanox-SN2700"]
44

55
class TestVxlanOrchP2MP(object):
66

tests/test_mirror_ipv6_combined.py

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
from swsscommon import swsscommon
55

6-
DVS_ENV = ["fake_platform=broadcom"]
7-
8-
96
class TestMirror(object):
107
def setup_db(self, dvs):
118
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)

tests/test_mirror_ipv6_separate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from swsscommon import swsscommon
55

6-
DVS_ENV = ["fake_platform=mellanox"]
6+
DVS_ENV = ["HWSKU=Mellanox-SN2700"]
77

88

99
class TestMirror(object):

0 commit comments

Comments
 (0)