Skip to content

Commit

Permalink
oasis-test-runner: Enable client node registration
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Sep 26, 2024
1 parent e552937 commit f1a1e2f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions go/oasis-net-runner/fixtures/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ func newDefaultFixture() (*oasis.NetworkFixture, error) {
fixture.ComputeWorkers[j].Runtimes = append(fixture.ComputeWorkers[j].Runtimes, rtIndex)
}
fixture.Clients[0].Runtimes = append(fixture.Clients[0].Runtimes, rtIndex)
fixture.Clients[0].Entity = 1

// Runtime state paths to use to initialize the runtime with.
if len(runtimeStatePaths) <= i {
Expand Down
5 changes: 5 additions & 0 deletions go/oasis-test-runner/oasis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func (client *Client) ModifyConfig() error {

client.Config.P2P.Port = client.p2pPort

if !client.entity.isDebugTestEntity {
entityID, _ := client.entity.ID().MarshalText() // Cannot fail.
client.Config.Registration.EntityID = string(entityID)
}

if len(client.runtimes) > 0 {
client.Config.Mode = config.ModeClient
client.Config.Runtime.Provisioner = client.runtimeProvisioner
Expand Down
2 changes: 2 additions & 0 deletions go/oasis-test-runner/oasis/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ func (f *SentryFixture) Create(net *Network) (*Sentry, error) {
type ClientFixture struct {
NodeFixture

Entity int `json:"entity"`

AllowErrorTermination bool `json:"allow_error_termination"`
AllowEarlyTermination bool `json:"allow_early_termination"`

Expand Down

0 comments on commit f1a1e2f

Please sign in to comment.