(have NetDevSNMP6)
| 51 | } |
| 52 | |
| 53 | func validateNetDevSNMP6(have NetDevSNMP6) error { |
| 54 | var wantNetDevSNMP6 = map[string]map[string]uint64{ |
| 55 | "eth0": { |
| 56 | "ifIndex": 1, |
| 57 | "Ip6InOctets": 14064059261, |
| 58 | "Ip6OutOctets": 811213622, |
| 59 | "Icmp6InMsgs": 53293, |
| 60 | "Icmp6OutMsgs": 20400, |
| 61 | }, |
| 62 | "eth1": { |
| 63 | "ifIndex": 2, |
| 64 | "Ip6InOctets": 303177290674, |
| 65 | "Ip6OutOctets": 29245052746, |
| 66 | "Icmp6InMsgs": 37911, |
| 67 | "Icmp6OutMsgs": 114015, |
| 68 | }, |
| 69 | } |
| 70 | |
| 71 | for wantIface, wantData := range wantNetDevSNMP6 { |
| 72 | if haveData, ok := have[wantIface]; ok { |
| 73 | for wantStat, wantVal := range wantData { |
| 74 | if haveVal, ok := haveData[wantStat]; !ok { |
| 75 | return fmt.Errorf("stat %s missing from %s test data", wantStat, wantIface) |
| 76 | } else if wantVal != haveVal { |
| 77 | return fmt.Errorf("%s - %s: want %d, have %d", wantIface, wantStat, wantVal, haveVal) |
| 78 | } |
| 79 | } |
| 80 | } else { |
| 81 | return fmt.Errorf("%s not found in test data", wantIface) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | return nil |
| 86 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…