Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
2cc50832
Commit
2cc50832
authored
Aug 09, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for F1AP gNB-DU Configuration Update enc/dec library
parent
9958e53c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
openair2/F1AP/tests/f1ap_lib_test.c
openair2/F1AP/tests/f1ap_lib_test.c
+75
-0
No files found.
openair2/F1AP/tests/f1ap_lib_test.c
View file @
2cc50832
...
...
@@ -357,6 +357,80 @@ static void test_f1ap_setup_failure(void)
AssertFatal
(
ret
,
"eq_f1ap_setup_failure(): copied message doesn't match
\n
"
);
}
/**
* @brief Test F1 gNB-DU Configuration Update
*/
static
void
test_f1ap_du_configuration_update
(
void
)
{
/* sys_info */
uint8_t
*
mib
=
calloc
(
3
,
sizeof
(
uint8_t
));
uint8_t
*
sib1
=
calloc
(
3
,
sizeof
(
uint8_t
));
f1ap_gnb_du_system_info_t
sys_info
=
{
.
mib_length
=
3
,
.
mib
=
mib
,
.
sib1_length
=
3
,
.
sib1
=
sib1
,
};
/* measurement_timing_information modify */
char
*
s
=
"1"
;
int
measurement_timing_config_len
=
strlen
(
s
)
+
1
;
uint8_t
*
measurement_timing_config_mod
=
calloc
(
measurement_timing_config_len
,
sizeof
(
uint8_t
));
AssertFatal
(
measurement_timing_config_mod
!=
NULL
,
"out of memory
\n
"
);
memcpy
((
void
*
)
measurement_timing_config_mod
,
s
,
measurement_timing_config_len
);
/* TAC modify */
uint32_t
*
tac
=
calloc
(
1
,
sizeof
(
uint32_t
));
AssertFatal
(
tac
!=
NULL
,
"out of memory
\n
"
);
*
tac
=
456
;
/* info modify */
f1ap_served_cell_info_t
info
=
{
.
mode
=
F1AP_MODE_TDD
,
.
tdd
.
freqinfo
.
arfcn
=
640000
,
.
tdd
.
freqinfo
.
band
=
78
,
.
tdd
.
tbw
.
nrb
=
66
,
.
tdd
.
tbw
.
scs
=
1
,
.
measurement_timing_config_len
=
measurement_timing_config_len
,
.
measurement_timing_config
=
measurement_timing_config_mod
,
.
nr_cellid
=
123456
,
.
plmn
.
mcc
=
1
,
.
plmn
.
mnc
=
1
,
.
plmn
.
mnc_digit_length
=
3
,
.
tac
=
tac
,
};
/* create message */
f1ap_gnb_du_configuration_update_t
orig
=
{
.
transaction_id
=
2
,
.
num_cells_to_modify
=
1
,
.
cell_to_modify
[
0
].
info
=
info
,
.
num_cells_to_delete
=
0
,
.
cell_to_delete
[
0
].
nr_cellid
=
1234UL
,
.
cell_to_delete
[
0
].
plmn
.
mcc
=
1
,
.
cell_to_delete
[
0
].
plmn
.
mnc
=
1
,
.
cell_to_delete
[
0
].
plmn
.
mnc_digit_length
=
3
,
};
orig
.
cell_to_modify
[
0
].
sys_info
=
calloc
(
1
,
sizeof
(
*
orig
.
cell_to_modify
[
0
].
sys_info
));
AssertFatal
(
orig
.
cell_to_modify
[
0
].
sys_info
!=
NULL
,
"out of memory
\n
"
);
*
orig
.
cell_to_modify
[
0
].
sys_info
=
sys_info
;
F1AP_F1AP_PDU_t
*
f1enc
=
encode_f1ap_du_configuration_update
(
&
orig
);
F1AP_F1AP_PDU_t
*
f1dec
=
f1ap_encode_decode
(
f1enc
);
f1ap_msg_free
(
f1enc
);
f1ap_gnb_du_configuration_update_t
decoded
=
{
0
};
bool
ret
=
decode_f1ap_du_configuration_update
(
f1dec
,
&
decoded
);
AssertFatal
(
ret
,
"decode_f1ap_setup_request(): could not decode message
\n
"
);
f1ap_msg_free
(
f1dec
);
ret
=
eq_f1ap_du_configuration_update
(
&
orig
,
&
decoded
);
AssertFatal
(
ret
,
"eq_f1ap_setup_request(): decoded message doesn't match
\n
"
);
free_f1ap_du_configuration_update
(
&
decoded
);
f1ap_gnb_du_configuration_update_t
cp
=
cp_f1ap_du_configuration_update
(
&
orig
);
ret
=
eq_f1ap_du_configuration_update
(
&
orig
,
&
cp
);
AssertFatal
(
ret
,
"eq_f1ap_setup_request(): copied message doesn't match
\n
"
);
free_f1ap_du_configuration_update
(
&
cp
);
free_f1ap_du_configuration_update
(
&
orig
);
}
int
main
()
{
test_initial_ul_rrc_message_transfer
();
...
...
@@ -365,5 +439,6 @@ int main()
test_f1ap_setup_request
();
test_f1ap_setup_response
();
test_f1ap_setup_failure
();
test_f1ap_du_configuration_update
();
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment