Clean packing. Removing packer layer.
[ric-plt/submgr.git] / e2ap / pkg / e2ap / e2ap_tests / msg.go
index b94cacc..7f23b96 100644 (file)
@@ -20,6 +20,7 @@
 package e2ap_tests
 
 import (
+       "encoding/hex"
        "fmt"
        "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
        "github.com/google/go-cmp/cmp"
@@ -76,6 +77,17 @@ type E2ApTests struct {
        packerif e2ap.E2APPackerIf
 }
 
+func (testCtxt *E2ApTests) toPackedData(t *testing.T, buffer string) *e2ap.PackedData {
+       msg, err := hex.DecodeString(buffer)
+       if err != nil {
+               testCtxt.testError(t, "Hex DecodeString Failed: %s [%s]", err.Error(), buffer)
+               return nil
+       }
+       packedData := &e2ap.PackedData{}
+       packedData.Buf = msg
+       return packedData
+}
+
 func NewE2ApTests(name string, packerif e2ap.E2APPackerIf) *E2ApTests {
        testCtxt := &E2ApTests{}
        testCtxt.packerif = packerif
@@ -100,5 +112,10 @@ func RunTests(t *testing.T, e2aptestctxt *E2ApTests) {
        t.Run(e2aptestctxt.Name(), func(t *testing.T) {
                e2aptestctxt.E2ApTestMsgSubscriptionDeleteFailure(t)
        })
-       t.Run(e2aptestctxt.Name(), func(t *testing.T) { e2aptestctxt.E2ApTestMsgIndication(t) })
+       t.Run(e2aptestctxt.Name(), func(t *testing.T) { e2aptestctxt.E2ApTestMsgSubscriptionRequestBuffers(t) })
+       t.Run(e2aptestctxt.Name(), func(t *testing.T) { e2aptestctxt.E2ApTestMsgSubscriptionResponseBuffers(t) })
+       t.Run(e2aptestctxt.Name(), func(t *testing.T) { e2aptestctxt.E2ApTestMsgSubscriptionFailureBuffers(t) })
+       t.Run(e2aptestctxt.Name(), func(t *testing.T) { e2aptestctxt.E2ApTestMsgSubscriptionDeleteRequestBuffers(t) })
+       t.Run(e2aptestctxt.Name(), func(t *testing.T) { e2aptestctxt.E2ApTestMsgSubscriptionDeleteResponseBuffers(t) })
+       t.Run(e2aptestctxt.Name(), func(t *testing.T) { e2aptestctxt.E2ApTestMsgSubscriptionDeleteFailureBuffers(t) })
 }