Commit 89da1624 authored by Yann Garcia's avatar Yann Garcia
Browse files

Finalyze RnisQuery_BI_BO tests

parent 369357b7
Loading
Loading
Loading
Loading
+14 −6
Original line number Original line Diff line number Diff line
@@ -391,8 +391,8 @@ class mec_database:
    def getRabInfo(self, p_cell_id):
    def getRabInfo(self, p_cell_id):
        print(">>> getRabInfo: ", p_cell_id)
        print(">>> getRabInfo: ", p_cell_id)
        resp = None
        resp = None
        if p_cell_id == '0xFFFFFFFF':
        if p_cell_id == '0x8000099':
            resp = "{\"problemDetails\": {\t\"type\": \"Bad Request\",\t\"title\": \"RnisAPI\",\t\"status\": 400,\t\"detail\": \"Wrong parameters\",\t\"instance\": \"string\"}}"
            resp = "{\"problemDetails\": {\t\"type\": \"Not Found\",\t\"title\": \"RnisAPI\",\t\"status\": 404,\t\"detail\": \"Not Found\",\t\"instance\": \"string\"}}"
        else:
        else:
            resp = "{ \"RabInfo\": { \"timeStamp\": { \"seconds\": 1577836800, \"nanoSeconds\": 0 }, \"appInsId\": \"01\", \"requestId\": \"01\", \"cellUserInfo\": [ { \"ecgi\": { \"plmn\": { \"mcc\": \"001\", \"mnc\": \"01\" }, \"cellId\": \"" + p_cell_id + "\" }, \"ueInfo\": [ { \"associateId\": [ { \"type\": \"1\", \"value\": \"192.0.2.0\" } ], \"erabInfo\": [ { \"erabId\": 10 , \"erabQosParameters\": [ { \"qci\": 7, \"qosInformation\": [ { \"erabMbrDl\": 10, \"erabMbrUl\": 10, \"erabGbrDl\": 10, \"erabGbrUl\": 10 } ] } ] } ] } ] } ] } }"
            resp = "{ \"RabInfo\": { \"timeStamp\": { \"seconds\": 1577836800, \"nanoSeconds\": 0 }, \"appInsId\": \"01\", \"requestId\": \"01\", \"cellUserInfo\": [ { \"ecgi\": { \"plmn\": { \"mcc\": \"001\", \"mnc\": \"01\" }, \"cellId\": \"" + p_cell_id + "\" }, \"ueInfo\": [ { \"associateId\": [ { \"type\": \"1\", \"value\": \"192.0.2.0\" } ], \"erabInfo\": [ { \"erabId\": 10 , \"erabQosParameters\": [ { \"qci\": 7, \"qosInformation\": [ { \"erabMbrDl\": 10, \"erabMbrUl\": 10, \"erabGbrDl\": 10, \"erabGbrUl\": 10 } ] } ] } ] } ] } ] } }"
        return resp
        return resp
@@ -402,7 +402,7 @@ class mec_database:
        print(">>> getPlmnInfo: ", p_app_inst)
        print(">>> getPlmnInfo: ", p_app_inst)
        resp = None
        resp = None
        if p_app_inst == '99':
        if p_app_inst == '99':
            resp = "{\"problemDetails\": {\t\"type\": \"Bad Request\",\t\"title\": \"RnisAPI\",\t\"status\": 400,\t\"detail\": \"Wrong parameters\",\t\"instance\": \"string\"}}"
            resp = "{\"problemDetails\": {\t\"type\": \"Not Found\",\t\"title\": \"RnisAPI\",\t\"status\": 404,\t\"detail\": \"Not Found\",\t\"instance\": \"string\"}}"
        else:
        else:
            resp = "{ \"PlmnInfo\": { \"timeStamp\": { \"seconds\": 1577836800, \"nanoSeconds\": 0 }, \"appInsId\": \"" + p_app_inst + "\", \"plmn\": [ { \"mcc\": \"001\", \"mnc\": \"01\" } ] } }"
            resp = "{ \"PlmnInfo\": { \"timeStamp\": { \"seconds\": 1577836800, \"nanoSeconds\": 0 }, \"appInsId\": \"" + p_app_inst + "\", \"plmn\": [ { \"mcc\": \"001\", \"mnc\": \"01\" } ] } }"
        return resp
        return resp
@@ -411,11 +411,19 @@ class mec_database:
    def getS1BearerInfo(self, p_cell_id):
    def getS1BearerInfo(self, p_cell_id):
        print(">>> getS1BearerInfo: ", p_cell_id)
        print(">>> getS1BearerInfo: ", p_cell_id)
        resp = None
        resp = None
        if p_cell_id == '99':
        if p_cell_id == '0x8000099':
            resp = "{\"problemDetails\": {\t\"type\": \"Bad Request\",\t\"title\": \"RnisAPI\",\t\"status\": 400,\t\"detail\": \"Wrong parameters\",\t\"instance\": \"string\"}}"
            resp = "{\"problemDetails\": {\t\"type\": \"Not Found\",\t\"title\": \"RnisAPI\",\t\"status\": 404,\t\"detail\": \"Not Found\",\t\"instance\": \"string\"}}"
        else:
        else:
            resp = "{ \"S1BearerInfo\": { \"timeStamp\": { \"seconds\": 1577836800, \"nanoSeconds\": 0 }, \"s1UeInfo\": [ { \"tempUeId\": [ { \"mmec\": \"0\", \"mtmsi\": \"1234\" } ], \"associateId\": [ { \"type\": \"1\", \"value\": \"192.0.2.0\" }, { \"type\": \"3\", \"value\": \"198.51.100.0\" } ], \"ecgi\": [ { \"plmn\": { \"mcc\": \"001\", \"mnc\": \"01\" }, \"cellId\": \"0x800000A\" } ], \"s1BearerInfoDetailed\": [ { \"erabId\": 1, \"s1EnbInfo\": { \"ipAddress\": \"192.0.2.0\", \"tunnelId\": \"1111\" }, \"sGwInfo\": { \"ipAddress\": \"192.0.2.1\", \"tunnelId\": \"2222\" } } ] } ]    } }"
            resp = "{ \"S1BearerInfo\": { \"timeStamp\": { \"seconds\": 1577836800, \"nanoSeconds\": 0 }, \"s1UeInfo\": [ { \"tempUeId\": [ { \"mmec\": \"0\", \"mtmsi\": \"1234\" } ], \"associateId\": [ { \"type\": \"1\", \"value\": \"192.0.2.0\" }, { \"type\": \"3\", \"value\": \"198.51.100.0\" } ], \"ecgi\": [ { \"plmn\": { \"mcc\": \"001\", \"mnc\": \"01\" }, \"cellId\": \"0x800000A\" } ], \"s1BearerInfoDetailed\": [ { \"erabId\": 1, \"s1EnbInfo\": { \"ipAddress\": \"192.0.2.0\", \"tunnelId\": \"1111\" }, \"sGwInfo\": { \"ipAddress\": \"192.0.2.1\", \"tunnelId\": \"2222\" } } ] } ]    } }"
        return resp
        return resp
    # End of getPlmnInfo
    # End of getS1BearerInfo

    def getL2MeasInfo(self, p_cell_id):
        print(">>> getL2MeasInfo: ", p_cell_id)
        resp = None
        if p_cell_id == '0x8000099':
            resp = "{\"problemDetails\": {\t\"type\": \"Not Found\",\t\"title\": \"RnisAPI\",\t\"status\": 404,\t\"detail\": \"Not Found\",\t\"instance\": \"string\"}}"
        return resp
    # End of getL2MeasInfo


# End of class mec_database
# End of class mec_database
+5 −3
Original line number Original line Diff line number Diff line
@@ -436,12 +436,14 @@ class myHandler(http.server.BaseHTTPRequestHandler):
                        query = s[0]
                        query = s[0]
                        s = s[1].split('=')
                        s = s[1].split('=')
                        print('__process__rnis__api__ (queries): ', s)
                        print('__process__rnis__api__ (queries): ', s)
                        if query == 'rab_info':
                        if query == 'rab_info' and s[0] == 'cell_id':
                            resp = self.__db__.getRabInfo(s[1])
                            resp = self.__db__.getRabInfo(s[1])
                        elif query == 'plmn_info':
                        elif query == 'plmn_info' and s[0] == 'app_ins_id':
                            resp = self.__db__.getPlmnInfo(s[1])
                            resp = self.__db__.getPlmnInfo(s[1])
                        elif query == 's1_bearer_info':
                        elif query == 's1_bearer_info' and s[0] == 'cell_id':
                            resp = self.__db__.getS1BearerInfo(s[1])
                            resp = self.__db__.getS1BearerInfo(s[1])
                        elif query == 'layer2_meas' and s[0] == 'cell_id':
                            resp = self.__db__.getL2MeasInfo(s[1])
                        else:
                        else:
                            resp = "{\"problemDetails\": {\t\"type\": \"Bad Request\",\t\"title\": \"RnisAPI\",\t\"status\": 400,\t\"detail\": \"Wrong parameters\",\t\"instance\": \"string\"}}"
                            resp = "{\"problemDetails\": {\t\"type\": \"Bad Request\",\t\"title\": \"RnisAPI\",\t\"status\": 400,\t\"detail\": \"Wrong parameters\",\t\"instance\": \"string\"}}"
        if (resp == None):
        if (resp == None):