ttcn3_sys_interface: Parse SIBs even when "StaticCellInfo" is missing

The test TC_9_2_1_1_1 sends a Cell->AddOrReconfigure->Basic message
without a "StaticCellInfo" member. This is used to change SIB1 of
the cell and simulate a different PLMN/TAC in the test.

handle_request_cell_basic() ignored the json message if "StaticCellInfo"
is missing which results in the SIB not being updated (PLMN stays as
00102 for example).
With this patch the SIBs after the json are now parsed even if there
"StaticCellInfo" is missing. A confirmation of the json is not sent
because the test does not seem to expect one in that case.

Related: TC_9_2_1_1_1
This commit is contained in:
Daniel Willmann 2020-03-12 17:16:10 +01:00 committed by Andre Puschmann
parent bc4e4ff97b
commit 3a804e23fa
1 changed files with 21 additions and 19 deletions

View File

@ -121,6 +121,10 @@ private:
void handle_request_cell_basic(Document& document, const uint8_t* payload, const uint16_t len)
{
// That is the cellId or name that the testsuites uses to refer to a specific cell
const Value& cell_name = document["Common"]["CellId"];
assert(cell_name.IsString());
if (document["Request"]["Cell"]["AddOrReconfigure"]["Basic"].HasMember("StaticCellInfo")) {
// Extract EARFCN
const Value& earfcn =
@ -155,13 +159,10 @@ private:
document["Request"]["Cell"]["AddOrReconfigure"]["Basic"]["InitialCellPower"]["MaxReferencePower"];
assert(ref_power.IsInt());
// That is the cellId or name that the testsuites uses to refer to a specific cell
const Value& cell_name = document["Common"]["CellId"];
assert(cell_name.IsString());
// Now configure cell
syssim->set_cell_config(
ttcn3_helpers::get_timing_info(document), cell_name.GetString(), earfcn.GetInt(), cell, ref_power.GetInt());
}
// Pull out SIBs and send to syssim
uint16_t consumed_bytes = 0;
@ -182,6 +183,7 @@ private:
consumed_bytes = payload_ptr - payload;
}
if (document["Request"]["Cell"]["AddOrReconfigure"]["Basic"].HasMember("StaticCellInfo")) {
// Create response for template car_CellConfig_CNF(CellId_Type p_CellId)
std::string resp = ttcn3_helpers::get_basic_sys_req_cnf(cell_name.GetString(), "Cell");