X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=E2Manager%2Ftests%2FdataProvider.go;h=0adf3f9c24dcd9acb4784b460bb8314d0d2dde62;hb=a07b8597afc9d063a7f37a376a5bcf29ba29b557;hp=64d390ee9fdf2d3413665786a0088d2d27a1d016;hpb=07ef76dd471a0892a893c90e0ab06713aee34be1;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/tests/dataProvider.go b/E2Manager/tests/dataProvider.go index 64d390e..0adf3f9 100644 --- a/E2Manager/tests/dataProvider.go +++ b/E2Manager/tests/dataProvider.go @@ -13,22 +13,22 @@ // 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). package tests import ( "bytes" "encoding/json" - "fmt" "net/http" "strconv" - "testing" ) const ( MaxMsgSize int = 4096 - Port int = 5555 + Port int = 3801 Flags int = 0 MessageType int = 1001 RanPort uint16 = 879 @@ -46,38 +46,13 @@ func GetPort() string { } func GetHttpRequest() *http.Request { - data := map[string]interface{}{"ranIp": RanIp, - "ranPort": RanPort, "ranName": RanName} - b := new(bytes.Buffer) - _ = json.NewEncoder(b).Encode(data) - req, _ := http.NewRequest("POST", "https://localhost:3800/request", b) - return req -} - -func GetInvalidRequestDetails() *http.Request { - data := map[string]interface{}{"ranIp": "256.0.0.0", - "ranPort": RanPort, "ranName": RanName} - b := new(bytes.Buffer) - _ = json.NewEncoder(b).Encode(data) - req, _ := http.NewRequest("POST", "https://localhost:3800/request", b) - return req -} - -func GetInvalidMessageType() *http.Request { - data := map[string]interface{}{"ranIp": "1.2.3.4", - "ranPort": RanPort, "ranName": RanName} + data := map[string]interface{}{ + "ranIp": RanIp, + "ranPort": RanPort, + "ranName": RanName, + } b := new(bytes.Buffer) _ = json.NewEncoder(b).Encode(data) req, _ := http.NewRequest("POST", "https://localhost:3800/request", b) return req -} - -func GetPackedPayload(t *testing.T) []byte { - inputPayloadAsStr := "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829000001000133" - payload := make([]byte, len(inputPayloadAsStr)/2) - _, err := fmt.Sscanf(inputPayloadAsStr, "%x", &payload) - if err != nil { - t.Errorf("convert inputPayloadAsStr to payloadAsByte. Error: %v\n", err) - } - return payload -} +} \ No newline at end of file