diff --git a/controller/nucleus/sbiFilesystemStore_test.go b/controller/nucleus/sbiFilesystemStore_test.go index 61bf3fdc3820c90678f7b0c161d17262ed3d04dd..24ab4dae94443d461fd561f5539434a6fc1d5a17 100644 --- a/controller/nucleus/sbiFilesystemStore_test.go +++ b/controller/nucleus/sbiFilesystemStore_test.go @@ -9,9 +9,13 @@ import ( "github.com/google/uuid" ) +func ensureStoreFilesForTestsAreRemoved() { + ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) + ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) +} + func TestAddSbi(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + defer ensureStoreFilesForTestsAreRemoved() pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") sbiStore := NewSbiStore(pndID) @@ -27,8 +31,7 @@ func TestAddSbi(t *testing.T) { } func TestGetAllSbis(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + defer ensureStoreFilesForTestsAreRemoved() pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") sbiStore := NewSbiStore(pndID) @@ -66,8 +69,7 @@ func TestGetAllSbis(t *testing.T) { } func TestGetSbi(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + defer ensureStoreFilesForTestsAreRemoved() pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") @@ -99,8 +101,7 @@ func TestGetSbi(t *testing.T) { } func TestDeleteAllSbis(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + defer ensureStoreFilesForTestsAreRemoved() pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") sbiStore := NewSbiStore(pndID)