testing

package
v0.0.0-...-2a45ea8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoTestCommit

func DoTestCommit(t *testing.T, impl messages.MessageImpl)

func DoTestHello

func DoTestHello(t *testing.T, impl messages.MessageImpl)

func DoTestMessageImpl

func DoTestMessageImpl(t *testing.T, impl messages.MessageImpl)

func DoTestNewView

func DoTestNewView(t *testing.T, impl messages.MessageImpl)

func DoTestPrepare

func DoTestPrepare(t *testing.T, impl messages.MessageImpl)

func DoTestReply

func DoTestReply(t *testing.T, impl messages.MessageImpl)

func DoTestReqViewChange

func DoTestReqViewChange(t *testing.T, impl messages.MessageImpl)

func DoTestRequest

func DoTestRequest(t *testing.T, impl messages.MessageImpl)

func DoTestViewChange

func DoTestViewChange(t *testing.T, impl messages.MessageImpl)

func ExtendQuorum

func ExtendQuorum(t, n uint32, q map[uint32]bool) <-chan map[uint32]bool

ExtendQuorum returns a channel that receives possible extensions of the supplied replica set q with t more replica IDs, given the total number of replicas n.

func GenerateMessageLogs

func GenerateMessageLogs(impl messages.MessageImpl, f, n uint32, v uint64, reqs []messages.Request) <-chan []messages.MessageLog

generateMessageLogs returns a channel that receives possible sets of message logs, indexed by replica ID which, for the view number v derived from possible protocol histories preparing and committing the supplied sequence of requests among the views, given the max number of faulty replicas f and the total number of replicas n.

func GenerateNewViewCertificates

func GenerateNewViewCertificates(impl messages.MessageImpl, f, n uint32, v uint64, vcs []messages.ViewChange) <-chan messages.NewViewCert

GenerateNewViewCertificates returns a channel that receives possible new-view certificates for the view number v derived from the supplied set of ViewChange messages, indexed by replica ID, given the max number of faulty replicas f and the total number of replicas n.

func GenerateNewViewMessages

func GenerateNewViewMessages(impl messages.MessageImpl, f, n uint32, v uint64, vcs []messages.ViewChange) <-chan messages.NewView

GenerateNewViewMessages returns a channel that receives possible NewView messages for the view number v derived from the supplied set of ViewChange messages, indexed by replica ID, given the max number of faulty replicas f and the total number of replicas n.

func GeneratePartialLogs

func GeneratePartialLogs(p, t uint32, logs []messages.MessageLog) <-chan []messages.MessageLog

GeneratePartialLogs returns a channel that receives possible sets of partial message logs derived from the supplied set of message logs, indexed by replica ID, by possibly truncating different message logs of up to t replicas, except the one of the replica p.

func LastLogCV

func LastLogCV(log messages.MessageLog) (cv uint64)

func MakeTestNV

func MakeTestNV(impl messages.MessageImpl, r uint32, v uint64, nvCert messages.NewViewCert, cv uint64) messages.NewView

func MakeTestNVCert

func MakeTestNVCert(impl messages.MessageImpl) messages.NewViewCert

func MakeTestPrep

func MakeTestPrep(impl messages.MessageImpl, r uint32, v uint64, req messages.Request, cv uint64) messages.Prepare

func MakeTestReply

func MakeTestReply(impl messages.MessageImpl, r, cl uint32, seq uint64, res []byte) messages.Reply

func MakeTestReq

func MakeTestReq(impl messages.MessageImpl, cl uint32, seq uint64, op []byte) messages.Request

func MakeTestReqViewChange

func MakeTestReqViewChange(impl messages.MessageImpl, r uint32, nv uint64) messages.ReqViewChange

func MakeTestSig

func MakeTestSig(data []byte) []byte

func MakeTestUI

func MakeTestUI(cv uint64, data []byte) *usig.UI

func PopulateLogs

func PopulateLogs(impl messages.MessageImpl, n uint32, v uint64, logs []messages.MessageLog, reqs []messages.Request) []messages.MessageLog

PopulateLogs extends the supplied set of message logs, indexed by replica ID, with Prepare/Commit messages for the supplied sequence of requests, given the total number of replicas n and the current view number v.

func RandBytes

func RandBytes() []byte

func RandHello

func RandHello(impl messages.MessageImpl) messages.Hello

func RandPrep

func RandPrep(impl messages.MessageImpl) messages.Prepare

func RandReply

func RandReply(impl messages.MessageImpl) messages.Reply

func RandReq

func RandReq(impl messages.MessageImpl) messages.Request

func RandReqViewChange

func RandReqViewChange(impl messages.MessageImpl) messages.ReqViewChange

func RandUI

func RandUI(data []byte) *usig.UI

func RandVCCert

func RandVCCert(impl messages.MessageImpl, f, n uint32, v uint64) messages.ViewChangeCert

func RemarshalMsg

func RemarshalMsg(impl messages.MessageImpl, msg messages.Message) messages.Message

func RequireCertMsgEqual

func RequireCertMsgEqual(t *testing.T, m1, m2 messages.CertifiedMessage)

func RequireCommEqual

func RequireCommEqual(t *testing.T, comm1, comm2 messages.Commit)

func RequireHelloEqual

func RequireHelloEqual(t *testing.T, h1, h2 messages.Hello)

func RequireMsgLogEqual

func RequireMsgLogEqual(t *testing.T, log1, log2 messages.MessageLog)

func RequireNVCertEqual

func RequireNVCertEqual(t *testing.T, c1, c2 messages.NewViewCert)

func RequireNVEqual

func RequireNVEqual(t *testing.T, nv1, nv2 messages.NewView)

func RequirePrepEqual

func RequirePrepEqual(t *testing.T, prep1, prep2 messages.Prepare)

func RequireReplyEqual

func RequireReplyEqual(t *testing.T, reply1, reply2 messages.Reply)

func RequireReqEqual

func RequireReqEqual(t *testing.T, req1, req2 messages.Request)

func RequireReqViewChangeEqual

func RequireReqViewChangeEqual(t *testing.T, rvc1, rvc2 messages.ReqViewChange)

func RequireVCCertEqual

func RequireVCCertEqual(t *testing.T, c1, c2 messages.ViewChangeCert)

func RequireVCEqual

func RequireVCEqual(t *testing.T, vc1, vc2 messages.ViewChange)

func TerminateMessageLogs

func TerminateMessageLogs(impl messages.MessageImpl, f, n uint32, v uint64, logs []messages.MessageLog) ([]messages.MessageLog, []messages.ViewChange)

TerminateMessageLogs replaces the message logs in the supplied set, indexed by replica ID, with ViewChange messages for the next view, given the max number of faulty replicas f, the total number of replicas n, and the current view number v.

func WriteLogAsString

func WriteLogAsString(w io.Writer, log messages.MessageLog, delim string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL