diff --git a/Makefile b/Makefile index 82e613935d2..017a2f4066f 100644 --- a/Makefile +++ b/Makefile @@ -1060,7 +1060,7 @@ ut: .PHONY: cover cover: - go test ./pkg/ovs ./pkg/util ./pkg/ipam -gcflags=all=-l -p 1 -coverprofile=cover.out -covermode=atomic + go test ./pkg/ovs ./pkg/util ./pkg/ipam -gcflags=all=-l -coverprofile=cover.out -covermode=atomic go tool cover -func=cover.out | grep -v "100.0%" go tool cover -html=cover.out -o cover.html diff --git a/pkg/ovs/ovn-nb-suite_test.go b/pkg/ovs/ovn-nb-suite_test.go index 8f41a81b99b..9ee2976737e 100644 --- a/pkg/ovs/ovn-nb-suite_test.go +++ b/pkg/ovs/ovn-nb-suite_test.go @@ -41,18 +41,8 @@ func emptyNbDatabaseModel() (model.ClientDBModel, error) { func (suite *OvnClientTestSuite) SetupSuite() { fmt.Println("set up ovn client test suite") - // setup ovn nb client + // setup ovn nb client schema nbClientSchema := ovnnb.Schema() - nbClientDBModel, err := ovnnb.FullDatabaseModel() - require.NoError(suite.T(), err) - - _, nbSock := newOVSDBServer(suite.T(), nbClientDBModel, nbClientSchema) - nbEndpoint := fmt.Sprintf("unix:%s", nbSock) - require.FileExists(suite.T(), nbSock) - - ovnNBClient, err := newOvnNbClient(suite.T(), nbEndpoint, 10) - require.NoError(suite.T(), err) - suite.ovnNBClient = ovnNBClient // setup failed case ovn nb client emptyNbDBModel, err := emptyNbDatabaseModel() @@ -68,6 +58,18 @@ func (suite *OvnClientTestSuite) SetupSuite() { server1.Close() require.NoFileExists(suite.T(), nbSock1) + // setup ovn nb client + nbClientDBModel, err := ovnnb.FullDatabaseModel() + require.NoError(suite.T(), err) + + _, nbSock := newOVSDBServer(suite.T(), nbClientDBModel, nbClientSchema) + nbEndpoint := fmt.Sprintf("unix:%s", nbSock) + require.FileExists(suite.T(), nbSock) + + ovnNBClient, err := newOvnNbClient(suite.T(), nbEndpoint, 10) + require.NoError(suite.T(), err) + suite.ovnNBClient = ovnNBClient + // setup ovn sb client sbClientSchema := ovnsb.Schema() sbClientDBModel, err := ovnsb.FullDatabaseModel()