From d34495e6e09c674bd2b401d60dd5754fde9dc8f4 Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Thu, 8 Apr 2021 10:55:35 -0400 Subject: [PATCH] agent: add test for reserved core config mapping --- command/agent/agent_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/command/agent/agent_test.go b/command/agent/agent_test.go index 4f9c39585..9147559f1 100644 --- a/command/agent/agent_test.go +++ b/command/agent/agent_test.go @@ -517,6 +517,19 @@ func TestAgent_ClientConfig(t *testing.T) { } } +func TestAgent_ClientConfig_ReservedCores(t *testing.T) { + t.Parallel() + conf := DefaultConfig() + conf.Client.Enabled = true + conf.Client.ReserveableCores = "0-7" + conf.Client.Reserved.Cores = "0,2-3" + a := &Agent{config: conf} + c, err := a.clientConfig() + require.NoError(t, err) + require.Exactly(t, []uint16{0, 1, 2, 3, 4, 5, 6, 7}, c.ReservableCores) + require.Exactly(t, []uint16{0, 2, 3}, c.Node.ReservedResources.Cpu.ReservedCpuCores) +} + // Clients should inherit telemetry configuration func TestAgent_Client_TelemetryConfiguration(t *testing.T) { assert := assert.New(t)