Skip to content

Commit

Permalink
Merge pull request #37 from microsoft/dev/nl/passUseCase
Browse files Browse the repository at this point in the history
add 802.3 acceptance of LinkAggregation
  • Loading branch information
liunick-msft committed Jul 6, 2023
2 parents 0e9d3b3 + eeb6e11 commit 1b38729
Show file tree
Hide file tree
Showing 7 changed files with 458 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/featureLLDP.go
Expand Up @@ -108,7 +108,7 @@ func (l *LLDPResultType) decodeLLDPInfoPacket(packet gopacket.Packet) {
}

// Subtype7_LinkAgg
l.Subtype7_LinkAggCap = info8021.LinkAggregation.Supported
l.Subtype7_LinkAggCap = (info8021.LinkAggregation.Supported || info8023.LinkAggregation.Supported)
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/resultOutput_test.go
Expand Up @@ -24,6 +24,9 @@ func TestResultOutput(t *testing.T) {
"pass_test": {
inputFileName: "pass_test",
},
"8023_test": {
inputFileName: "8023_test",
},
}

srcFolder, err := os.Getwd()
Expand All @@ -44,10 +47,10 @@ func TestResultOutput(t *testing.T) {
goldenYamlFile := filepath.Join(testGoldenFolder, tc.inputFileName+".yml")
want := parseYamlToGo(goldenYamlFile)
if !reflect.DeepEqual(want.RoleResultList, got.RoleResultList) {
t.Errorf("%s - RoleResultList Failed \n want: %v \n got: %v", name, want.RoleResultList, got.RoleResultList)
t.Errorf("%s - RoleResultList Failed \n want: %#v \n got: %#v", name, want.RoleResultList, got.RoleResultList)
}
if !reflect.DeepEqual(want.LLDPResult, got.LLDPResult) {
t.Errorf("%s - LLDPResult Failed \n want: %v \n got: %v", name, want.LLDPResult, got.LLDPResult)
t.Errorf("%s - LLDPResult Failed \n want: %#v \n got: %#v", name, want.LLDPResult, got.LLDPResult)
}
// Generate Yaml JSON PDF files for view
pdfFileName := filepath.Join(testOutputFolder, tc.inputFileName+".pdf")
Expand Down
226 changes: 226 additions & 0 deletions src/test/goldenConfig/8023_test.yml
@@ -0,0 +1,226 @@
TestDate: 2023-06-05T22:58:44.947278Z
ToolBuildVersion: 1.2305.01
RoleResultList:
- rolename: Management
rolepass: Fail
featuresbyrole:
- featurename: VLAN
featurepass: Fail
featurelogsubject: VLAN Mismatch
featurelogdetail: 'Detect: [7 710 711 712 713 714 715 716 717 718 719], but Input: [710 711 712 713 714 715 716 717 718 719]'
featureroles:
- Management
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: DHCP - Relay Agent IP
featurepass: Fail
featurelogsubject: DHCP Relay Agent IP Not Detected from switch, please check switch dhcp configuration.
featurelogdetail: ""
featureroles:
- Management
- featurename: LLDP - Port VLAN ID (Subtype = 1)
featurepass: Fail
featurelogsubject: LLDP Subtype 1 Mismatch, please check switch VLAN configuration
featurelogdetail: 'Detect: 720, but Input: 710'
featureroles:
- Management
- featurename: LLDP - Link Aggregation (Subtype = 7)
featurepass: Pass
featurelogsubject: ""
featurelogdetail: ""
featureroles:
- Management
- Compute (Standard)
- Compute (SDN)
- Storage
- rolename: Storage
rolepass: Fail
featuresbyrole:
- featurename: VLAN
featurepass: Fail
featurelogsubject: VLAN Mismatch
featurelogdetail: 'Detect: [7 710 711 712 713 714 715 716 717 718 719], but Input: [710 711 712 713 714 715 716 717 718 719]'
featureroles:
- Management
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - VLAN Name (Subtype = 3)
featurepass: Fail
featurelogsubject: LLDP Subtype 3 Mismatch, please check switch VLAN configuration
featurelogdetail: 'Detect: [7 710 711 712 713 714 715 716 717 718 719], but Input: [710 711 712 713 714 715 716 717 718 719]'
featureroles:
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - Maximum Frame Size (Subtype = 4)
featurepass: Fail
featurelogsubject: LLDP Subtype 4 not detected from switch
featurelogdetail: ""
featureroles:
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - Link Aggregation (Subtype = 7)
featurepass: Pass
featurelogsubject: ""
featurelogdetail: ""
featureroles:
- Management
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - ETS Maximum Number of Traffic Classes (Subtype = 9)
featurepass: Fail
featurelogsubject: ETS Maximum Number of Traffic Classes not detected from switch
featurelogdetail: ""
featureroles:
- Storage
- featurename: LLDP - ETS Class Bandwidth Configuration (Subtype = 9)
featurepass: Fail
featurelogsubject: Priority 0~7 Mismatch
featurelogdetail: Detect 0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0, but should be 0:48,1:50,2:2,3:0,4:0,5:0,6:0,7:0
featureroles:
- Storage
- featurename: LLDP - PFC Maximum Number of Traffic Classes (Subtype = B)
featurepass: Fail
featurelogsubject: PFC Maximum Number of Traffic Classes not detected from switch
featurelogdetail: ""
featureroles:
- Storage
- featurename: LLDP - PFC Priority Class Enabled (Subtype = B)
featurepass: Fail
featurelogsubject: Priority 0~7 Mismatch
featurelogdetail: Detect 0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0, but should be 0:0,1:0,2:0,3:1,4:0,5:0,6:0,7:0
featureroles:
- Storage
- rolename: Compute (Standard)
rolepass: Fail
featuresbyrole:
- featurename: VLAN
featurepass: Fail
featurelogsubject: VLAN Mismatch
featurelogdetail: 'Detect: [7 710 711 712 713 714 715 716 717 718 719], but Input: [710 711 712 713 714 715 716 717 718 719]'
featureroles:
- Management
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - VLAN Name (Subtype = 3)
featurepass: Fail
featurelogsubject: LLDP Subtype 3 Mismatch, please check switch VLAN configuration
featurelogdetail: 'Detect: [7 710 711 712 713 714 715 716 717 718 719], but Input: [710 711 712 713 714 715 716 717 718 719]'
featureroles:
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - Maximum Frame Size (Subtype = 4)
featurepass: Fail
featurelogsubject: LLDP Subtype 4 not detected from switch
featurelogdetail: ""
featureroles:
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - Link Aggregation (Subtype = 7)
featurepass: Pass
featurelogsubject: ""
featurelogdetail: ""
featureroles:
- Management
- Compute (Standard)
- Compute (SDN)
- Storage
- rolename: Compute (SDN)
rolepass: Fail
featuresbyrole:
- featurename: BGP
featurepass: Fail
featurelogsubject: TCP 179 Packet Not Detected from switch, please check switch BGP configuration.
featurelogdetail: ""
featureroles:
- Compute (SDN)
- featurename: VLAN
featurepass: Fail
featurelogsubject: VLAN Mismatch
featurelogdetail: 'Detect: [7 710 711 712 713 714 715 716 717 718 719], but Input: [710 711 712 713 714 715 716 717 718 719]'
featureroles:
- Management
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - VLAN Name (Subtype = 3)
featurepass: Fail
featurelogsubject: LLDP Subtype 3 Mismatch, please check switch VLAN configuration
featurelogdetail: 'Detect: [7 710 711 712 713 714 715 716 717 718 719], but Input: [710 711 712 713 714 715 716 717 718 719]'
featureroles:
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - Maximum Frame Size (Subtype = 4)
featurepass: Fail
featurelogsubject: LLDP Subtype 4 not detected from switch
featurelogdetail: ""
featureroles:
- Compute (Standard)
- Compute (SDN)
- Storage
- featurename: LLDP - Link Aggregation (Subtype = 7)
featurepass: Pass
featurelogsubject: ""
featurelogdetail: ""
featureroles:
- Management
- Compute (Standard)
- Compute (SDN)
- Storage
VLANResult:
nativevlanid: 720
allvlanids:
- 7
- 710
- 711
- 712
- 713
- 714
- 715
- 716
- 717
- 718
- 719
LLDPResult:
sysdes: 'SONiC Software Version: SONiC.3.1.0.13 - HwSku: Supermicro_sse_t7132s - Distribution: Debian 11.6 - Kernel: 5.10.0-8-2-amd64'
portname: Eth1
chasisid: 7cc2554a489a
chasisidtype: MAC Address
subtype1_portvlanid: 720
subtype3_vlanlist:
- 7
- 710
- 711
- 712
- 713
- 714
- 715
- 716
- 717
- 718
- 719
subtype4_maxframesize: 0
subtype7_linkaggcap: true
subtype9_ets:
etstotalpg: 0
etsbwbypgid:
subtypeb_pfc:
pfcmaxclasses: 0
pfcconfig:
DHCPResult:
dhcppacketdetected: true
relayagentip: ""
BGPResult:
bgptcppacketdetected: false
switchinterfaceip: ""
switchinterfacemac: ""
hostinterfaceip: ""
hostinterfacemac: ""
Binary file added src/test/testInput/8023_test.pcap
Binary file not shown.
Binary file added src/test/testOutput/8023_test.pdf
Binary file not shown.

0 comments on commit 1b38729

Please sign in to comment.