diff --git a/backend/server/database/migrations_test.go b/backend/server/database/migrations_test.go index 892e21736..2bb2253ce 100644 --- a/backend/server/database/migrations_test.go +++ b/backend/server/database/migrations_test.go @@ -10,6 +10,7 @@ import ( "github.com/go-pg/pg/v10" "github.com/stretchr/testify/require" + "isc.org/stork/server/apps/kea" dbops "isc.org/stork/server/database" "isc.org/stork/server/database/maintenance" dbmodel "isc.org/stork/server/database/model" @@ -591,7 +592,12 @@ func TestMigration55LocalHostInDatabaseAndConfig(t *testing.T) { } }`) require.NoError(t, err) - err = server.DetectReferences() + + fec := &storktestdbmodel.FakeEventCenter{} + lookup := dbmodel.NewDHCPOptionDefinitionLookup() + app, _ := server.GetKea() + + err = kea.CommitAppIntoDB(db, app, fec, nil, lookup) require.NoError(t, err) // Add a database host reservations. diff --git a/backend/server/database/model/test/keaserver.go b/backend/server/database/model/test/keaserver.go index fc6e7ce52..97ddb8050 100644 --- a/backend/server/database/model/test/keaserver.go +++ b/backend/server/database/model/test/keaserver.go @@ -2,9 +2,7 @@ package dbmodeltest import ( "github.com/go-pg/pg/v10" - "isc.org/stork/server/apps/kea" dbmodel "isc.org/stork/server/database/model" - storktestdbmodel "isc.org/stork/server/test/dbmodel" ) // A wrapper for a Kea daemon. @@ -52,19 +50,6 @@ func (server *KeaServer) Configure(config string) error { return dbmodel.UpdateDaemon(server.kea.machine.db, d) } -// Detects the referenced objects i.e., subnets, shared networks, and hosts. -func (server *KeaServer) DetectReferences() error { - app, err := server.GetKea() - if err != nil { - return err - } - - fec := &storktestdbmodel.FakeEventCenter{} - lookup := dbmodel.NewDHCPOptionDefinitionLookup() - - return kea.CommitAppIntoDB(server.kea.machine.db, app, fec, nil, lookup) -} - // Returns a machine the Kea server belongs to. func (server *KeaServer) GetMachine() (*dbmodel.Machine, error) { return server.kea.GetMachine()