From f1a1e2f6bb0083b5beb989811988b6beb9858a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Jekovec?= Date: Thu, 26 Sep 2024 16:53:53 +0200 Subject: [PATCH] oasis-test-runner: Enable client node registration --- go/oasis-net-runner/fixtures/default.go | 1 + go/oasis-test-runner/oasis/client.go | 5 +++++ go/oasis-test-runner/oasis/fixture.go | 2 ++ 3 files changed, 8 insertions(+) diff --git a/go/oasis-net-runner/fixtures/default.go b/go/oasis-net-runner/fixtures/default.go index 182e20c7e4c..5aa8ba611a0 100644 --- a/go/oasis-net-runner/fixtures/default.go +++ b/go/oasis-net-runner/fixtures/default.go @@ -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 { diff --git a/go/oasis-test-runner/oasis/client.go b/go/oasis-test-runner/oasis/client.go index 7e2e98a9d11..4d785e63e36 100644 --- a/go/oasis-test-runner/oasis/client.go +++ b/go/oasis-test-runner/oasis/client.go @@ -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 diff --git a/go/oasis-test-runner/oasis/fixture.go b/go/oasis-test-runner/oasis/fixture.go index be60faae827..dca781db3c3 100644 --- a/go/oasis-test-runner/oasis/fixture.go +++ b/go/oasis-test-runner/oasis/fixture.go @@ -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"`