Skip to content

Commit

Permalink
go/oasis-test-runner: Add sentry E2E tests scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
tjanez committed Nov 6, 2019
1 parent 923edd7 commit ba3031c
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
75 changes: 75 additions & 0 deletions go/oasis-test-runner/scenario/e2e/sentry.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package e2e

import (
"github.com/oasislabs/oasis-core/go/common/logging"
"github.com/oasislabs/oasis-core/go/oasis-test-runner/oasis"
"github.com/oasislabs/oasis-core/go/oasis-test-runner/scenario"
)

var (
// Sentry is the Tendermint Sentry node scenario.
Sentry scenario.Scenario = newSentryImpl()
)

type sentryImpl struct {
basicImpl

logger *logging.Logger
}

func newSentryImpl() scenario.Scenario {
s := &sentryImpl{
basicImpl: basicImpl{
clientBinary: "simple-keyvalue-client",
},
logger: logging.GetLogger("scenario/e2e/sentry"),
}
return s
}

func (s *sentryImpl) Name() string {
return "sentry"
}

func (s *sentryImpl) Fixture() (*oasis.NetworkFixture, error) {
f, err := s.basicImpl.Fixture()
if err != nil {
return nil, err
}

// Provision sentry nodes and tell which validators to connect to.
f.Sentries = []oasis.SentryFixture{
oasis.SentryFixture{
Validators: []int{0},
},
oasis.SentryFixture{
Validators: []int{1},
},
oasis.SentryFixture{
Validators: []int{2},
},
}

// Provision validators and tell which sentry nodes to connect to.
f.Validators = []oasis.ValidatorFixture{
oasis.ValidatorFixture{
Entity: 1,
Sentries: []int{0},
},
oasis.ValidatorFixture{
Entity: 1,
Sentries: []int{1},
},
oasis.ValidatorFixture{
Entity: 1,
Sentries: []int{2},
},
}

f.Network.LogWatcherHandlers = append(
f.Network.LogWatcherHandlers,
oasis.LogAssertPeerExchangeDisabled(),
)

return f, nil
}
2 changes: 2 additions & 0 deletions go/oasis-test-runner/test-runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func main() {
_ = cmd.Register(e2e.ByzantineMergeStraggler)
// Storage sync test.
_ = cmd.Register(e2e.StorageSync)
// Sentry test.
_ = cmd.Register(e2e.Sentry)
// Keymanager restart test.
_ = cmd.Register(e2e.KeymanagerRestart)
// Dump/restore test.
Expand Down

0 comments on commit ba3031c

Please sign in to comment.