X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fsbi%2Fnngpush_test.go;h=b17b2ca534fb720cd9ff693e97bcacc0139952d3;hb=41e32c6cd23e3ac33e4b004b0fde57e371d02c81;hp=5e9316956fc19596e7a1ddf6774007c2aa7591d0;hpb=92162653c9741f2417d1a36ec1c211d6863d0a68;p=ric-plt%2Frtmgr.git diff --git a/pkg/sbi/nngpush_test.go b/pkg/sbi/nngpush_test.go index 5e93169..b17b2ca 100644 --- a/pkg/sbi/nngpush_test.go +++ b/pkg/sbi/nngpush_test.go @@ -14,6 +14,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + This source code is part of the near-RT RIC (RAN Intelligent Controller) + platform project (RICP). + ================================================================================== */ /* @@ -27,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" ) @@ -105,7 +112,7 @@ func TestNngPushTerminate(t *testing.T) { } /* -nngpush.UpdateEndpoints() is testd against stub.ValidXapps dataset +nngpush.UpdateEndpoints() is testd against stub.ValidXApps dataset */ func TestNngPushUpdateEndpoints(t *testing.T) { var nngpush = NngPush{} @@ -222,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) +} +*/