Skip to content

Commit

Permalink
[Yang-models] Modify mirror yang model src_port to match CONFIG_DB
Browse files Browse the repository at this point in the history
  • Loading branch information
rupesh-k committed Feb 1, 2023
1 parent 6ba1a2e commit 6cefab0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 82 deletions.
6 changes: 1 addition & 5 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1933,11 +1933,7 @@
"direction": "RX",
"type": "SPAN",
"dst_port": "Ethernet2",
"src_port": [
"Ethernet3",
"Ethernet4"
]

"src_port": "Ethernet3,Ethernet4"
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@
"MIRROR_ERSPAN_ENTRY_VALID_SRC_PORTCHANNEL": {
"desc": "Configuring ERSPAN entry with valid source portchannel"
},
"MIRROR_ERSPAN_ENTRY_INVALID_SRC_PORT": {
"desc": "Configuring ERSPAN entry with invalid source port",
"eStrKey" : "InvalidValue"
},
"MIRROR_SPAN_ENTRY_WITH_VALID_VALUES": {
"desc": "Configuring SPAN entry with valid source and destination ports"
},
Expand All @@ -90,10 +86,6 @@
"MIRROR_SPAN_ENTRY_VALID_DST_PORT_CPU": {
"desc": "Configuring SPAN entry with valid destination port CPU"
},
"MIRROR_SPAN_ENTRY_INVALID_SRC_PORT": {
"desc": "Configuring SPAN entry with invalid destination ports",
"eStrKey" : "InvalidValue"
},
"MIRROR_SPAN_ENTRY_INVALID_DIRECTION": {
"desc": "Configuring SPAN entry with invalid direction",
"eStrKey": "InvalidValue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,7 @@
"gre_type": "0x1234",
"dscp": "10",
"ttl": "63",
"src_port": [
"Ethernet0"
]
"src_port": "Ethernet0"
}
]
}
Expand Down Expand Up @@ -346,29 +344,7 @@
"gre_type": "0x1234",
"dscp": "10",
"ttl": "63",
"src_port": [
"PortChannel5"
]
}
]
}
}
},
"MIRROR_ERSPAN_ENTRY_INVALID_SRC_PORT": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
{
"name": "erspan",
"type": "ERSPAN",
"dst_ip": "11.1.1.1",
"src_ip": "10.1.1.1",
"gre_type": "0x1234",
"dscp": "10",
"ttl": "63",
"src_port": [
"Ethernet0"
]
"src_port": "PortChannel5"
}
]
}
Expand Down Expand Up @@ -415,10 +391,7 @@
"name": "span",
"type": "SPAN",
"dst_port": "Ethernet0",
"src_port": [
"Ethernet4",
"Ethernet8"
],
"src_port": "Ethernet4,Ethernet8",
"direction": "RX"
}
]
Expand Down Expand Up @@ -479,37 +452,6 @@
}
}
},
"MIRROR_SPAN_ENTRY_INVALID_SRC_PORT": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "1",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
{
"name": "span",
"type": "SPAN",
"dst_port": "Ethernet0",
"src_port": [
"Ethernet4"
]
}
]
}
}
},
"MIRROR_SPAN_ENTRY_INVALID_DIRECTION": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
Expand Down
11 changes: 3 additions & 8 deletions src/sonic-yang-models/yang-models/sonic-mirror-session.yang
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,9 @@ module sonic-mirror-session {
"Destination port configuration for port mirroring(SPAN).";
}

leaf-list src_port {
type union {
type leafref {
path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name";
}
type leafref {
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
}
leaf src_port {
type string {
length 1..256;
}
description
"Source port configuration for mirroring. Can be configured for both SPAN/ERSPAN.
Expand Down

0 comments on commit 6cefab0

Please sign in to comment.