Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mocks: update list, fix unexported interfaces in bfd #3878

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions go/pkg/router/bfd/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,4 @@ type (
DefaultIntervalGenerator = defaultIntervalGenerator
State = state
Event = event
Source = source
IntervalGenerator = intervalGenerator
)
8 changes: 4 additions & 4 deletions go/pkg/router/bfd/jitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (
// periodic BFD Control packets should be reduced by. If gen is nil, math/rand is used
// for randomness.
func computeInterval(transmitInterval time.Duration, detectMult uint,
gen intervalGenerator) time.Duration {
gen IntervalGenerator) time.Duration {

if transmitInterval <= 0 {
panic("transmission interval must be > 0")
Expand All @@ -65,7 +65,7 @@ func computeInterval(transmitInterval time.Duration, detectMult uint,
}

// IntervalGenerator generates integers in [x, y). It panics if x < 0 or if y <= x.
type intervalGenerator interface {
type IntervalGenerator interface {
Generate(x, y int) int
}

Expand All @@ -78,7 +78,7 @@ type defaultIntervalGenerator struct {
// Source is used for pseudorandomness. Implementations do
// not need to be strong enough for use in cryptography. If nil,
// the default random number generator in package rand is used.
Source source
Source Source
}

// Generate returns pseudorandom integers from [x, y). Generate panics
Expand All @@ -101,6 +101,6 @@ func (g defaultIntervalGenerator) intn(n int) int {

// Source is an pseudorandom number generator interface that is
// satisfied by package math/rand's Rand type.
type source interface {
type Source interface {
Intn(n int) int
}
24 changes: 15 additions & 9 deletions tools/gomocks
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,49 @@ from plumbum import local
from plumbum.cmd import cp, mkdir, rm, chmod

MOCK_TARGETS = [
("go/border/rctrl/grpc", "IfStateHandler"),
("go/cs/beacon", "DB,Transaction"),
("go/cs/beaconing",
"BeaconInserter,BeaconProvider,BeaconSender,RPC,SegmentProvider,SegmentStore"),
("go/cs/ifstate", "InterfaceStateSender,RevInserter"),
("go/cs/keepalive", "IfStatePusher,RevDropper"),
("go/cs/reservationstorage/backend", "DB,Transaction"),
("go/cs/revocation", "Store"),
("go/cs/segutil", "Policy"),
("go/hidden_path_srv/internal/registration", "Validator"),
("go/hidden_path_srv/internal/hpsegreq", "Fetcher"),
("go/hidden_path_srv/internal/registration", "Validator"),
("go/lib/ctrl/seg", "Signer"),
("go/lib/infra", "Messenger,ResponseWriter,Verifier,Handler"),
("go/lib/infra/messenger", "LocalSVCRouter,Resolver"),
("go/lib/infra", "Messenger,ResponseWriter,Verifier,Handler"),
("go/lib/infra/modules/segfetcher",
"DstProvider,ReplyHandler,Requester,RequestAPI,Resolver,Splitter,LocalInfo"),
"DstProvider,ReplyHandler,Requester,Resolver,RPC,Splitter,LocalInfo"),
("go/lib/infra/modules/seghandler", "Storage,Verifier"),
("go/lib/l4", "L4Header"),
("go/lib/pathdb", "PathDB,Transaction,ReadWrite"),
("go/lib/pathmgr", "Policy,Querier,Resolver"),
("go/lib/periodic/internal/metrics", "ExportMetric"),
("go/lib/pktcls", "Cond"),
("go/lib/revcache", "RevCache"),
("go/lib/sciond", "Service,Connector"),
("go/lib/sciond", "Connector"),
("go/lib/snet",
"PacketDispatcherService,Network,PacketConn,Path,PathQuerier,Router,RevocationHandler"),
"PacketDispatcherService,Network,PacketConn,Path,PathInterface," +
"PathMetadata,PathQuerier,Router,RevocationHandler"),
("go/lib/sock/reliable", "Dispatcher"),
("go/lib/sock/reliable/reconnect", "IOOperation,Reconnecter"),
("go/lib/svc", "RequestHandler,RoundTripper"),
("go/lib/svc/internal/ctxconn", "DeadlineCloser"),
("go/lib/svc", "RequestHandler,RoundTripper"),
("go/lib/topology", "Topology"),
("go/lib/underlay/conn", "Conn"),
("go/lib/xtest", "Callback"),
("go/pkg/cs/trust", "CACertProvider,PolicyGen,SignerGen"),
("go/pkg/cs/trust/grpc", "ChainBuilder,RenewalRequestVerifier,Signer"),
("go/pkg/cs/trust", "CACertProvider,PolicyGen,SignerGen"),
("go/pkg/proto/control_plane",
"ChainRenewalServiceServer,InterfaceStateConsumerServiceServer," +
"InterfaceStateServiceServer,TrustMaterialServiceServer"),
("go/pkg/router/bfd", "Source,IntervalGenerator"),
("go/pkg/router", "BatchConn"),
("go/pkg/sciond/fetcher", "Fetcher,Policy"),
("go/pkg/trust", "DB,Fetcher,Inspector,KeyRing,Provider,Recurser,Router,RPC"),
("go/pkg/trust",
"DB,Fetcher,Inspector,KeyRing,Provider,Recurser,Router,X509KeyPairLoader"),
("go/pkg/trust/renewal", "DB"),
("go/sig/egress/iface", "Session"),
("go/sig/egress/worker", "SCIONWriter"),
Expand Down