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
927b1577
Commit
927b1577
authored
Oct 28, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for E1 Bearer Context Setup Response
parent
10b07c77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
openair2/E1AP/tests/e1ap_lib_test.c
openair2/E1AP/tests/e1ap_lib_test.c
+59
-0
No files found.
openair2/E1AP/tests/e1ap_lib_test.c
View file @
927b1577
...
...
@@ -159,8 +159,67 @@ static void test_bearer_context_setup_request(void)
free_e1ap_context_setup_request
(
&
orig
);
}
/**
* @brief Test E1AP Bearer Context Setup Response encoding/decoding
*/
static
void
test_bearer_context_setup_response
(
void
)
{
// Step 1: Initialize the E1AP Bearer Context Setup Response
e1ap_bearer_setup_resp_t
orig
=
{
.
gNB_cu_cp_ue_id
=
1234
,
.
gNB_cu_up_ue_id
=
5678
,
.
numPDUSessions
=
1
,
.
pduSession
[
0
].
id
=
1
,
.
pduSession
[
0
].
tlAddress
=
167772161
,
.
pduSession
[
0
].
teId
=
0x12345
,
.
pduSession
[
0
].
numDRBSetup
=
1
,
.
pduSession
[
0
].
numDRBFailed
=
0
,
.
pduSession
[
0
].
DRBnGRanList
[
0
].
id
=
1
,
.
pduSession
[
0
].
DRBnGRanList
[
0
].
numUpParam
=
1
,
.
pduSession
[
0
].
DRBnGRanList
[
0
].
numQosFlowSetup
=
1
,
.
pduSession
[
0
].
DRBnGRanList
[
0
].
qosFlows
[
0
].
qfi
=
1
,
.
pduSession
[
0
].
DRBnGRanList
[
0
].
UpParamList
[
0
].
cell_group_id
=
MCG
,
.
pduSession
[
0
].
DRBnGRanList
[
0
].
UpParamList
[
0
].
teId
=
0x34345
,
.
pduSession
[
0
].
DRBnGRanList
[
0
].
UpParamList
[
0
].
tlAddress
=
167772161
,
};
// E1AP encode the original message
E1AP_E1AP_PDU_t
*
enc
=
encode_E1_bearer_context_setup_response
(
&
orig
);
// E1AP decode the encoded message
E1AP_E1AP_PDU_t
*
dec
=
e1ap_encode_decode
(
enc
);
// Free the E1AP encoded message
e1ap_msg_free
(
enc
);
// E1 message decode
e1ap_bearer_setup_resp_t
decoded
=
{
0
};
bool
ret
=
decode_E1_bearer_context_setup_response
(
dec
,
&
decoded
);
AssertFatal
(
ret
,
"decode_E1_bearer_context_setup_response(): could not decode message
\n
"
);
// Free the E1AP decoded message
e1ap_msg_free
(
dec
);
// Equality check original/decoded
ret
=
eq_bearer_context_setup_response
(
&
orig
,
&
decoded
);
AssertFatal
(
ret
,
"eq_bearer_context_setup_response(): decoded message doesn't match
\n
"
);
// Free the memory for the decoded message
free_e1ap_context_setup_response
(
&
decoded
);
// Deep copy and equality check of the original message
e1ap_bearer_setup_resp_t
cp
=
cp_bearer_context_setup_response
(
&
orig
);
ret
=
eq_bearer_context_setup_response
(
&
orig
,
&
cp
);
AssertFatal
(
ret
,
"eq_bearer_context_setup_response(): copied message doesn't match
\n
"
);
// Free the copied message and original
free_e1ap_context_setup_response
(
&
cp
);
free_e1ap_context_setup_response
(
&
orig
);
}
int
main
()
{
// E1 Bearer Context Setup
test_bearer_context_setup_request
();
test_bearer_context_setup_response
();
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