-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/oasis-test-runner: Add sentry E2E tests scenario
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters