X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fsbi%2Fnngpush_test.go;h=b17b2ca534fb720cd9ff693e97bcacc0139952d3;hb=refs%2Fchanges%2F29%2F2029%2F2;hp=d7a65726ae4f9044c8e30b7da72bc89154e27573;hpb=749099bc00ec6cad5da19846e65bd5b4bd9b8de4;p=ric-plt%2Frtmgr.git diff --git a/pkg/sbi/nngpush_test.go b/pkg/sbi/nngpush_test.go index d7a6572..b17b2ca 100644 --- a/pkg/sbi/nngpush_test.go +++ b/pkg/sbi/nngpush_test.go @@ -31,6 +31,9 @@ import ( "errors" "routing-manager/pkg/rtmgr" "routing-manager/pkg/stub" + //"nanomsg.org/go/mangos/v2" + //_ "nanomsg.org/go/mangos/v2/transport/all" + //"nanomsg.org/go/mangos/v2/protocol/push" "testing" ) @@ -226,3 +229,28 @@ func TestNngPushDeleteEndpointWithSocketCloseError(t *testing.T) { t.Errorf("nngpush.DeleteEndpoint() was incorrect, got: %v, want: %v.", nil, "error") } } + +/* +Initialize and send policies +*/ +func TestNngPushInitializeandsendPolicies(t *testing.T) { + var nngpush = NngPush{} + _,_ = createNewPushSocket() + policies := []string{"hello","welcome"} + nngpush.send(rtmgr.Eps["10.1.1.1:0"],&policies) +} + +/* +func TestPipeEventHandler(t *testing.T) { + var sock mangos.Socket + var event mangos.PipeEvent + var pipe mangos.Pipe + + var err error + sock, err = push.NewSocket() + sock.Dial("tcp://127.0.0.1:4555") + sock.SetPipeEventHook(pipeEventHandler) + pipeEventHandler(event,pipe) + t.Log(err) +} +*/