X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fut_ctrl_submgr_test.go;h=65edd1b50dde01b14a45f899812fd26a6fc2821e;hb=afadb6df033657afef927964aa637ba7c8fc0880;hp=87279041274e23e857aa7e9c294ff6d661fcf0c0;hpb=989d584ada9e40aa97848700bd26c9b7af72b91d;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/ut_ctrl_submgr_test.go b/pkg/control/ut_ctrl_submgr_test.go index 8727904..65edd1b 100644 --- a/pkg/control/ut_ctrl_submgr_test.go +++ b/pkg/control/ut_ctrl_submgr_test.go @@ -21,6 +21,7 @@ package control import ( "fmt" + "github.com/stretchr/testify/assert" "io/ioutil" "net/http" "strconv" @@ -285,6 +286,14 @@ func (mc *testingSubmgrControl) wait_msgcounter_change(t *testing.T, orig uint64 return 0, false } +func (mc *testingSubmgrControl) VerifyAllClean(t *testing.T) { + // Verify that all resources are freed + assert.Equal(t, 0, len(mainCtrl.c.registry.register)) + assert.Equal(t, 0, len(mainCtrl.c.registry.restSubscriptions)) + verifyRESTKeyCount(t, 0) + verifyE2KeyCount(t, 0) +} + func (mc *testingSubmgrControl) GetMetrics(t *testing.T) (string, error) { req, err := http.NewRequest("GET", "http://localhost:8080/ric/v1/metrics", nil) if err != nil {