neels has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-pfcp/+/30247 )
Change subject: pfcp_test: add missing 'pdi_present = true'
......................................................................
pfcp_test: add missing 'pdi_present = true'
test_enc_dec[8] includes a PDI IE in Update PDR. The PDI is optional
here, so it requires setting a presence flag to true. This was missing,
hence the PDI part was not being tested at all. Add this presence flag.
This was probably a copy-paste error from testing the Create PDR IE,
where the PDI is mandatory and has no presence flag.
Change-Id: Idc70ae23f15d3af65f98557cc51a111f2e6d75c9
---
M tests/libosmo-pfcp/pfcp_test.c
M tests/libosmo-pfcp/pfcp_test.ok
2 files changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-pfcp refs/changes/47/30247/1
diff --git a/tests/libosmo-pfcp/pfcp_test.c b/tests/libosmo-pfcp/pfcp_test.c
index d6853b1..b204a9f 100644
--- a/tests/libosmo-pfcp/pfcp_test.c
+++ b/tests/libosmo-pfcp/pfcp_test.c
@@ -344,6 +344,7 @@
.upd_pdr = {
{
.pdr_id = 1,
+ .pdi_present = true,
.pdi = {
.source_iface = OSMO_PFCP_SOURCE_IFACE_ACCESS,
.local_f_teid_present = true,
diff --git a/tests/libosmo-pfcp/pfcp_test.ok b/tests/libosmo-pfcp/pfcp_test.ok
index 2b8cc1a..23ce16d 100644
--- a/tests/libosmo-pfcp/pfcp_test.ok
+++ b/tests/libosmo-pfcp/pfcp_test.ok
@@ -89,10 +89,10 @@
=== start test_enc_dec[8]
encoding: SESSION_MOD_REQ
-PFCPv1 SESSION_MOD_REQ hdr={seq=9 SEID=0x0} ies={ 'Remove PDR'={ { 'PDR
ID'=1 } } 'Remove FAR'={ { 'FAR ID'=1 } } 'Create PDR'={ {
'PDR ID'=3 'Precedence'=255 'PDI'={ 'Source
Interface'=Access 'F-TEID'=CHOOSE-v4 } 'Outer Header
Removal'=GTP_U_UDP_IPV4 'FAR ID'=3 } } 'Create FAR'={ { 'FAR
ID'=3 'Apply Action'=( FORW ) 'Forwarding Parameters'={
'Destination Interface'=Access 'Outer Header Creation'=( GTP_U_UDP_IPV4
),TEID:0xabcdef,v4:10.9.8.7 } } } 'Update PDR'={ { 'PDR ID'=1 'Outer
Header Removal'=GTP_U_UDP_IPV4 'FAR ID'=1 } } 'Update FAR'={ {
'FAR ID'=1 'Update Forwarding Parameters'={ 'Network
Instance'="internet" } } } }
+PFCPv1 SESSION_MOD_REQ hdr={seq=9 SEID=0x0} ies={ 'Remove PDR'={ { 'PDR
ID'=1 } } 'Remove FAR'={ { 'FAR ID'=1 } } 'Create PDR'={ {
'PDR ID'=3 'Precedence'=255 'PDI'={ 'Source
Interface'=Access 'F-TEID'=CHOOSE-v4 } 'Outer Header
Removal'=GTP_U_UDP_IPV4 'FAR ID'=3 } } 'Create FAR'={ { 'FAR
ID'=3 'Apply Action'=( FORW ) 'Forwarding Parameters'={
'Destination Interface'=Access 'Outer Header Creation'=( GTP_U_UDP_IPV4
),TEID:0xabcdef,v4:10.9.8.7 } } } 'Update PDR'={ { 'PDR ID'=1 'Outer
Header Removal'=GTP_U_UDP_IPV4 'PDI'={ 'Source Interface'=Access
'F-TEID'=CHOOSE-v4 } 'FAR ID'=1 } } 'Update FAR'={ { 'FAR
ID'=1 'Update Forwarding Parameters'={ 'Network
Instance'="internet" } } } }
osmo_pfcp_msg_encode() rc = 0
-21 34 00 ab 00 00 00 00 00 00 00 00 00 00 09 00 00 0f 00 06 00 38 00 02 00 01 00 10 00 08
00 6c 00 04 00 00 00 01 00 01 00 29 00 38 00 02 00 03 00 1d 00 04 00 00 00 ff 00 02 00 0a
00 14 00 01 00 00 15 00 01 05 00 5f 00 01 00 00 6c 00 04 00 00 00 03 00 03 00 25 00 6c 00
04 00 00 00 03 00 2c 00 02 02 00 00 04 00 13 00 2a 00 01 00 00 54 00 0a 01 00 00 ab cd ef
0a 09 08 07 00 09 00 13 00 38 00 02 00 01 00 5f 00 01 00 00 6c 00 04 00 00 00 01 00 0a 00
18 00 6c 00 04 00 00 00 01 00 0b 00 0c 00 16 00 08 69 6e 74 65 72 6e 65 74 .
-osmo_pfcp_msg_decode_header() rc = 175
+21 34 00 b9 00 00 00 00 00 00 00 00 00 00 09 00 00 0f 00 06 00 38 00 02 00 01 00 10 00 08
00 6c 00 04 00 00 00 01 00 01 00 29 00 38 00 02 00 03 00 1d 00 04 00 00 00 ff 00 02 00 0a
00 14 00 01 00 00 15 00 01 05 00 5f 00 01 00 00 6c 00 04 00 00 00 03 00 03 00 25 00 6c 00
04 00 00 00 03 00 2c 00 02 02 00 00 04 00 13 00 2a 00 01 00 00 54 00 0a 01 00 00 ab cd ef
0a 09 08 07 00 09 00 21 00 38 00 02 00 01 00 5f 00 01 00 00 02 00 0a 00 14 00 01 00 00 15
00 01 05 00 6c 00 04 00 00 00 01 00 0a 00 18 00 6c 00 04 00 00 00 01 00 0b 00 0c 00 16 00
08 69 6e 74 65 72 6e 65 74 .
+osmo_pfcp_msg_decode_header() rc = 189
rc == msgb_length()
osmo_pfcp_msg_decode_tlv() rc = 0
parsed == orig
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-pfcp/+/30247
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-pfcp
Gerrit-Branch: master
Gerrit-Change-Id: Idc70ae23f15d3af65f98557cc51a111f2e6d75c9
Gerrit-Change-Number: 30247
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange