-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestEngine.go
65 lines (53 loc) · 1.19 KB
/
testEngine.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package main
import (
"net"
)
// supported lb engine protocols and distribution modes
var tlbSuppCapabilities = map[lbProto]map[distMode]bool{
lbProtoTcp: {
distModeRR: true,
},
}
type testLb struct {
failDependenciesCheck bool
failPermissionsCheck bool
failStart bool
}
func (tlb *testLb) setResults(failDependenciesCheck, failPermissionsCheck, failStart bool) {
tlb.failDependenciesCheck = failDependenciesCheck
tlb.failPermissionsCheck = failPermissionsCheck
tlb.failStart = failStart
}
func (tlb *testLb) checkDependencies() error {
if tlb.failDependenciesCheck {
return errCheckDep
}
return nil
}
func (tlb *testLb) checkPermissions() error {
if tlb.failPermissionsCheck {
return errCheckPerm
}
return nil
}
func (tlb *testLb) getCapabilities() map[lbProto]map[distMode]bool {
return tlbSuppCapabilities
}
func (tlb *testLb) start(l *lb) error {
if tlb.failStart {
return errLbEngineStart
}
return nil
}
func (tlb *testLb) stop() error {
return nil
}
func (tlb *testLb) reconfig(l *lb) error {
return nil
}
func (tlb *testLb) updateTarget(t *target) error {
return nil
}
func (tlb *testLb) updateUpstream(u *upstream, auip *[]net.IP) error {
return nil
}