From 5e33eafb808739f53134c97bccbb9ec427b345f7 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sat, 9 Nov 2024 20:40:39 +0100 Subject: [PATCH] Fix test removing all allocs --- go/daemon/network/network_it_test.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/go/daemon/network/network_it_test.go b/go/daemon/network/network_it_test.go index e8a12f5..7f30398 100644 --- a/go/daemon/network/network_it_test.go +++ b/go/daemon/network/network_it_test.go @@ -225,14 +225,10 @@ func TestNetwork_SetConfig(t *testing.T) { }) networkConfig = secondus.getConfig(t) - prevHost = secondus.getHostsByName(t)[secondus.hostName] - removedAlloc = networkConfig.Storage.Allocations[0] - removedRole = allocsToRoles( + prevHost = secondus.getHostsByName(t)[secondus.hostName] + removedRole = allocsToRoles( secondus.hostName, prevHost.Garage.Instances, )[0] - removedGarageInst = daecommon.BootstrapGarageHostForAlloc( - prevHost, removedAlloc, - ) primusGarageAdminClient = primus.garageAdminClient(t) ) @@ -246,8 +242,7 @@ func TestNetwork_SetConfig(t *testing.T) { assert.True(t, ok) allocs := newHost.HostConfigured.Garage.Instances - assert.Len(t, allocs, 3) - assert.NotContains(t, allocs, removedGarageInst) + assert.Empty(t, allocs) t.Log("Checking that garage layout still contains the old allocation") layout, err := primusGarageAdminClient.GetLayout(h.ctx)