Wireless-Innovation-Forum / Citizens-Broadband-Radio-Service-Device

Apache License 2.0
31 stars 19 forks source link

Verifying CBSD ID and Grant ID existence in messages following transition to JSON schema #70

Closed idanrazisr closed 6 years ago

idanrazisr commented 6 years ago

Mock-SAS automatically provides in REgistration Request messages CBSD ID and Grant ID and then expects to get these in subsequent messages. With the transition to JSON Schema in Mock-SAS implementation I am not sure if Mock-SAS will fail the Request message if CBSD-ID and Grant ID are not present. Looking at the JsonExpectedFolder -> Optional Param I can see that cbsdID appears in the "grantOptional.json" and in "relinquishmentOptional.json" (for example) but I am not sure if Mock-SAS is trating this as "Mandatory Required" or as "Optional". For example: if a CBSD sends Relinquishment Request that includes only a CBSD-ID without Grant-ID (where both are required according to the SAS<->CBSD Spec), will Mock-SAS pass or fail the Validation of this Relinquishment Request message? For other parameters coming in the Request message we can put them in the JSONExpected, but because CBSD-ID and Grant-ID are created automatically by Mock-SAS I am not sure about them.

cwilliams-ericsson commented 6 years ago

Hi Idan,

Test Harness automatically adds correct cbsdId (and if applicable) grantId to the jsonExpectedObj, NOT the incoming request. That way, those parameters are REQUIRED when it does the comparison to the received request message, even if they are not present in the jsonExpectedFolder json file. So, it does operate properly. Take a look in Assert.py - compare_Json_Req() if you want the details.

We could add "cbsdId" and "grantId" as REQUIRED parameters in the optional json schema if we want, which would enforce it at the optional check level, but that isn't necessary since the Test Harness code (as above) already checks them as required parameters.

For example, here is a grantId sent without a cbsdId...

2017-11-21T14:15:55.191Z - INFO - grant request from CBRS : { "grantRequest": [ { "operationParam": { "maxEirp": 18.0, "operationFrequencyRange": { "highFrequency": 3595000000, "lowFrequency": 3575000000 } } } ] } 2017-11-21T14:15:55.201Z - INFO - the server shot down because : ERROR - the http request does not include key : cbsdId , or that the cbsdid in the http request is not include mock-sas 2017-11-21T14:15:55.365Z - INFO - The final result of the test : WINNF.FT.C.HBT.1_HB_Success_Case is - FAIL

idanrazisr commented 6 years ago

Understood - closing issue