-
Notifications
You must be signed in to change notification settings - Fork 53
/
route_info_zos_test.go
45 lines (41 loc) · 1.52 KB
/
route_info_zos_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package sockaddr
import "testing"
func Test_zosProcessOnetstatOutput(t *testing.T) {
dummyOutput := `MVS TCP/IP NETSTAT CS V2R5 TCPIP Name: TCPIP 12:52:35
IPv4 Destinations
Destination Gateway Flags Refcnt Interface
----------- ------- ----- ------ ---------
Default 0.0.0.0 UGS 0000000000 TCPIPLINK
0.0.0.0 0.0.0.0 US 0000000000 TCPIPLINK
0.0.0.0 0.0.0.0 UH 0000000000 TCPIPLINK
0.0.0.0 0.0.0.0 UH 0000000000 LOOPBACK
0.0.0.0 0.0.0.0 H 0000000000 EZAZCX
0.0.0.0 0.0.0.0 H 0000000000 EZASAMEMVS
IPv6 Destinations
DestIP: Default
Gw: ::
Intf: TCPIPLINK6 Refcnt: 0000000000
Flgs: UGS MTU: 2000
DestIP: ::
Gw: ::
Intf: LOOPBACK6 Refcnt: 0000000000
Flgs: UH MTU: 65535
DestIP: ::
Gw: ::
Intf: TCPIPLINK6 Refcnt: 0000000000
Flgs: US MTU: 2000
DestIP: ::
Gw: ::
Intf: TCPIPLINK6 Refcnt: 0000000000
Flgs: UH MTU: 9008
DestIP: ::
Gw: ::
Intf: TCPIPLINK6 Refcnt: 0000000000
Flgs: UH MTU: 9008`
if _, err := zosProcessOnetstatOutput(dummyOutput); err != nil {
t.Errorf("err != nil for zosProcessOnetstatOutput - %v", err)
}
if result, err := zosProcessOnetstatOutput(""); err == nil {
t.Errorf("got %s; want \"\"", result)
}
}