...
1
2
3
4
5
6
7
8
9
10
11
12
13
14 package procfs
15
16 import (
17 "testing"
18 )
19
20 func TestTLSStat(t *testing.T) {
21 tlsStats, err := getProcFixtures(t).NewTLSStat()
22 if err != nil {
23 t.Fatal(err)
24 }
25
26 for _, test := range []struct {
27 name string
28 want int
29 got int
30 }{
31 {name: "TLSCurrTxSw", want: 5, got: tlsStats.TLSCurrTxSw},
32 {name: "TLSCurrRxSw", want: 5, got: tlsStats.TLSCurrRxSw},
33 {name: "TLSCurrTxDevice", want: 0, got: tlsStats.TLSCurrTxDevice},
34 {name: "TLSCurrRxDevice", want: 0, got: tlsStats.TLSCurrRxDevice},
35 {name: "TLSTxSw", want: 8711, got: tlsStats.TLSTxSw},
36 {name: "TLSTxSw", want: 8711, got: tlsStats.TLSRxSw},
37 {name: "TLSTxDevice", want: 0, got: tlsStats.TLSTxDevice},
38 {name: "TLSRxDevice", want: 0, got: tlsStats.TLSRxDevice},
39 {name: "TLSDecryptError", want: 13, got: tlsStats.TLSDecryptError},
40 {name: "TLSRxDeviceResync", want: 0, got: tlsStats.TLSRxDeviceResync},
41 {name: "TLSDecryptRetry", want: 0, got: tlsStats.TLSDecryptRetry},
42 {name: "TLSRxNoPadViolation", want: 0, got: tlsStats.TLSRxNoPadViolation},
43 } {
44 if test.want != test.got {
45 t.Errorf("Want %s %d, have %d", test.name, test.want, test.got)
46 }
47 }
48 }
49
View as plain text