Commit Graph

52 Commits

Author SHA1 Message Date
Pau Espin ca587f154c ggsn: Submit User Location Information in CreatePDPContextReq
According to TS 29.060, sec 7.3.1 Create PDP Context Request:
"""
The SGSN shall include the User Location Information IE in the PDP
Context Activation procedure. The SGSN shall include the CGI or SAI
in the "Geographic Location" field of the User Location Information
IE depending on whether the MS is in a cell or a service area
respectively.
"""

Change-Id: Iaea95e5779d4f878023ce3f160ac69f092452056
2022-02-02 10:46:17 +01:00
Pau Espin 38aeffb9be ggsn: Submit RATType in CreatePDPContextReq
According to TS 29.060, sec 7.3.1 Create PDP Context Request:
"The SGSN shall include the RAT Type IE during Primary PDP Context
Activation procedure."

Change-Id: Ibc57798e50ccd08ef6126f75f7c8134e56d2778a
2022-02-02 10:46:17 +01:00
Harald Welte 7ef6d10145 ggsn: Fix TC_pdp4_act_deact_with_single_dns()
In TC_pdp4_act_deact_with_single_dns we activate, deactivate and then
re-activate a PDP context. Hoewver, we re-use the same variable and
don't reset the state in between.  This results in the second PDP CTX
activation to include an end-user-address (static IP allocation), which
OsmoGGSN doesn't implement.

Before osmo-ggsn Change-Id Iac8868438655fe4e5e07d167d7dbd6273dbb7678,
the test passed as osmo-ggsn simply ignored the requested static address.
After that change, we reject static addresses and hence the test starts
to fail.

Change-Id: I1b1869bc2cee39c8fddd8fa63f48bdaa6a65e462
Related: OS#5097
2021-04-01 21:27:33 +02:00
Pau Espin c04c69e689 ggsn: Terminate immediately on pipong altstep failure
Change-Id: I1ae66afc562c6bf968b0b3bfa9a254fac0bd7404
2020-03-03 16:48:34 +01:00
Pau Espin 6f319f9794 ggsn: Drop unneeded m_ggsn_supports_echo_interval
Latest osmo-ggsn release is 1.5.0, so this param is not needed at all.

Change-Id: Ie1c3cde2a01e8ea49aadcb1f7384995cb68039cb
2020-01-05 11:21:07 +00:00
Pau Espin bb2bb061e5 ggsn: Delete previously activated pdp ctx in *_interact()
This change fixes some GGSN_Tests failing lately since osmo-ggsn
correctly sends DeleteCtxReq for dangling pdp ctx upon increased
Recovery counter received, and tests are not expecting that (because
they don't expectect dangling pdp ctx from previous tests).

Change-Id: I232298e2bfd8bfc99d82cbf5803d11db7eb1786a
2019-09-03 13:19:29 +02:00
Pau Espin fa1ca02d34 ggsn: Introduce test TC_pdp_act2_recovery
Some code is moved out of f_pdp_ctx_act() into f_handle_create_req() in
order to re-use it in the test.

Related: OS#4165
Change-Id: I48c1bc9287ce8b820e5ea672dffbc5a8503f16d7
2019-08-23 19:13:34 +02:00
Pau Espin 6916ec4648 ggsn: Introduce test TC_pdp_act_restart_ctr_echo
VTY functionalities to enable and disable echo requests in osmo-ggsn are
added too as part of the test.

Depends: osmo-ggsn.git Id2c84165dc59dff495106758146a701ca488834f
Related: OS#4165
Change-Id: Ia37e48e7ff9ad063f9eabf447f8a6a0a3fc380d9
2019-08-23 18:32:49 +02:00
Pau Espin 22d597ff94 ggsn: Introduce test TC_pdp46_act_deact_apn4
Related osmo-ggsn.git libgtp fix: I6c6215a4ce478afabc78ffaf5ffb0cf829e41226

Related: OS#4154
Change-Id: Ia1893e0c181307ac1ceb07ee5f496507f7a603c8
2019-08-21 16:31:35 +02:00
Harald Welte f82985484b ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken()
This test case reproduces a real-world PCO capture including a broken
PAP AuthenticationReq.  It triggers some weird behavior in OsmoGGSN
1.3.0 where it would send duplicate IPCP repsonses and no PAP response.

Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c
Related: OS#3914
2019-07-03 16:24:19 +00:00
Pau Espin 9a5f42f997 ggsn: Add test to verify retransmit queue_resp
Related: OS#3997
Change-Id: I8d937d0af9af8462418b174a54022655f9d77a5f
2019-05-28 21:03:16 +00:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Harald Welte 79737b4193 ggsn: Verify that there are no duplicate PCO protocolIDs
Introduce a function to verify there's no duplicate ProtocolIDs
in the PCO returned from the GGSN.

Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405
Related: OS#3914
2019-05-10 10:46:04 +00:00
Oliver Smith ee6a088f37 ggsn: add tests to validate IPv4v6 pdp ctx
Add related templates based on 3GPP TS 29.060 Figure 37A and create
tests based on existing IPv4 and v6 ones.

Related: OS#2900
Change-Id: I3bab7df5caddc5c8b973c81544f954d5473ac234
2019-03-14 09:10:45 +00:00
Stefan Sperling 8e7a396656 fix TC_pdp4_act_deact_with_separate_dns
Do not delete the PDP context too early, and look for the second DNS
server in the correct place (2nd match on IPCP protocol, not 1st).

Update a comment which talks about a bug which has been fixed.

Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf
Related: OS#3319
Related: OS#3381
2018-07-19 19:58:06 +02:00
Pau Espin 205a384562 ggsn: Apply GPDU seqnum option to all APNs
Change-Id: I6efe926c8bb7a0056d26e15eefa282266e7bc6ca
2018-07-06 14:43:59 +00:00
Philipp Maier 33e5261154 GGSN_Tests: test what happens when PCO contains only one DNS entry
When the protocol configuration options (PCO) contain an IPCP container
then lists only one one DNS server (normally there are two included, a
primary and a secondary). Than the parser in osmo-ggsn runs into an
endles loop. This testcase tries to provoke this behavior by sending
PDP CONTEXT ACTIVATE messages with PCO that contain only a single DNS
entry per IPCP container.

The hanging of osmo-ggsn is already fixed (see Depends). However when
Primary and Secondary DNS are in separate IPCP containers, then only
the first IPCP container is parsed (see also OS#3381)

Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc
Depends: osmo-msc Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5
Closes: OS#3288
Related: OS#3381
2018-07-05 15:40:43 +00:00
Harald Welte d2394e9032 ggsn: Disable GTP-U tx sequence number by default
GTP-U transmit sequence numbers are entirely optional and probably
don't serve any real purpose in real-world deployments.

While OsmoGGSN in userspace implements support for it, the kernel GTP-U
implementation doesn't.  This means a number of tests fail against
kernel GTP-U only for that reason.

Let's switch all tests to disable GTP-U sequence numbers, and only
enable it in one specific test.  This way, we can execute the tests
also against kernel GTP-U.

Related: OS#3215
Change-Id: I666f5276749ef6a1a4dc170a3b9a747f626f6b2c
2018-04-26 09:09:32 +00:00
Harald Welte 3e0b039c56 ggsn: Fix typo: 'gptu' -> 'gtpu'
Change-Id: I1da2e0da6b94dc43c742ec551d3b5de100ce405f
2018-04-26 09:09:31 +00:00
Stefan Sperling c479e4fa3b test GGSN support for optional GTP-U sequence numbers
Add VTY functionality to GGSN tests, and use the VTY to enable/disable
GTP-U Tx sequence numbers in the running osmo-ggsn.

The GTPU packet template now makes sequence numbers optional.
A template created with its sequence number set to 'omit' will result in
a packet without a sequence number, i.e. the 'sequence number present' bit
in the packet header is cleared, and the sequence number field is omitted
from the encoded GTPU T-PDU packet.

Re-use the existing TC_pdp4_clients_interact() test for testing the
behaviour of osmo-ggsn. This test is now run twice, once with and
once without GTP-U Tx sequence numbers. Verify that packets relayed by
osmo-ggsn match its "g-pdu tx-sequence-numbers" configuration setting.

Change-Id: I1dc299407c61b1c865035add44067b8ab89001b3
Related: OS#2519
2018-04-06 12:43:25 +00:00
Stefan Sperling cb782b99ff document the purpose of IP addresses used by GGSN tests
The purpose of the various IP addresses used by our GGSN tests is not
immediately clear. Add documentation based on the current status quo.

Change-Id: I079efcff3dab09d71330625f5b661cd81e42bf38
2018-04-04 08:07:25 +00:00
Stefan Sperling 6cd217e48b improve documentation of templates used in GGSN_Tests
Various improvements to the comments documenting packet templates
used in GGSN_Tests: fix IPv4 vs. IPv6 confusion, clearly indicate
whether templates are used for sending or for receiving/matching
packets, and add a missing comment.

Found while studying code to prepare for issue OS#2519.

Change-Id: I3bfc21a5ba74e0505457e4874f93501ad7c68b7b
Related: OS#2519
2018-04-01 08:42:01 +00:00
Harald Welte c69cf4e933 ggsn: Move GTP templates to separate GTP_Templates + Add GTP_Emulation
Change-Id: I384e59738a9e0fc0186b69f0806f217a2a8d8a4b
2018-02-18 10:26:54 +01:00
Pau Espin 6c7285d682 ggsn_tests: Add test to validate if different pdp ctx can talk each other
It seems due to the current network configuration, pdp v4 ctx can talk
each other while pdp v6 ctx cannot.

Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a
2018-01-31 14:47:00 +01:00
Pau Espin 3d9338fb92 ggsn_tests: Add test case to validate packets forwarded vs dropped
New dependency is required: titan.ProtocolModules.ICMP
It tests that ICMP echo packets can be sent successfully (reply is
received or otherwise dest unreachable if routing is not set up
correctly during the test). It also tests some cases in which osmo-ggsn
is required to drop the packets (eg. unknown src ip unrelated to pdp
ctx). It also checks that IPv6 packets are dropped in IPv4 pdp ctx and
viceversa It also checks that IPv6 packets are dropped in IPv4 pdp ctx
and vice versa.

Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba
2018-01-31 14:46:02 +01:00
Pau Espin 363ba48b1f ggsn_tests: Validate DNS PCO values
Change-Id: I54124cb5269c0992e6c72af1a1ecaa8e3202bf05
2018-01-29 18:43:35 +01:00
Pau Espin f69a438010 ggsn_tests: Configure expected GGSN DNS values and improve error message
Change-Id: Ie64ca0b4cda22fd358c8c304d5b3909fd9685948
2018-01-29 13:09:00 +01:00
Harald Welte 9182704cbc ggsn: Move random number helpers to Osmocom_Types.ttcn
Change-Id: I141289cbf1807e81d72f07ac1183fa48b2dc54af
2018-01-26 10:42:53 +01:00
Harald Welte e7096c1571 ggsn: verify IPv4 addr + byte order in IPCP PCO DNS addresses 2017-12-04 19:40:44 +01:00
Harald Welte eb9184ddb4 ggsn: Encode IPCP in IPCP Request, rather than using hard-coded hex string
We now have a proper definition of IPCP in IPCP_Types and can thus
encode/decode on the fly and avoid hand-crafted octetstrings.
2017-12-04 19:04:24 +01:00
Harald Welte 71a36023dc ggsn: Verify presence of DNS addresses in IPCP of PCO
If we request DNS in IPCP in PCO, we also expect a corresponding result.
2017-12-04 19:04:24 +01:00
Harald Welte bb5a19e53c ggsn_tests: Remove incomplete user plane testing code
In commit 0b7545dff1 I accidentially
committed incomplete support for user plane (GTP-U) testing to
the GGSN test.

This code has caused the jenkins tests since August 26th to fail,
let's revert it until this is fully implemented + tested.
2017-09-21 22:50:41 +08:00
Harald Welte ab4ca94c8c ggsn: Extend IPCP PDP IPv4 test with another PCO protocol beyond IPCP
This is to test for a bug that osmo-ggsn fixed in Icc2e6716c33d78d3c3e000f529806228d8aa155e
2017-09-07 18:41:52 +02:00
Harald Welte 244cd8acf7 sysinfo: Fix the TC_telnet test case VTY command order 2017-08-26 09:25:20 +02:00
Harald Welte 3ab91d6ae4 GGSN_Tests: Fix IPv4 PCODNS matching 2017-08-25 14:46:39 +02:00
Harald Welte ddeecbb4ed GGSN_Tests: Make SGSN and GGSN addresses configurable via modulepar 2017-08-19 11:50:08 +02:00
Harald Welte 99ef9a446c GGSN_Tests: Verify EUA and PCO in PDP context creation
The EUA and PCO of the created PDP context mustmatc wat we sent in the
request.
2017-08-14 21:42:03 +02:00
Harald Welte 0ef285bbe9 GGSN_Tests: Comment on each test case 2017-08-13 20:06:01 +02:00
Harald Welte dca8005080 GGSN_Tests: Actually request the right IPv4 PCO according to the test case
Missing: Verification of returned PCO
2017-08-13 20:01:38 +02:00
Harald Welte 11dbc7b6cc GGSN_Test: Use randomized sequence numbers in every test 2017-08-13 18:57:56 +02:00
Harald Welte 41575e9bc2 GGSN_Tests: remove unneeded ctx argument from f_send_gtpc() 2017-08-13 13:49:57 +02:00
Harald Welte ed09743af5 GGSN_Tests: Randomize IMSIs and use different APN for v4 + v6 2017-08-13 13:28:49 +02:00
Harald Welte 0be142b7bf GGSN_Tests: Make sure f_init() body is traversed only once
We don't want the sequence numbers to be random-reinitialized
on every test case, but only once.
2017-08-13 13:28:10 +02:00
Harald Welte 5438b9dc27 GGSN_Tests: Sequence numbers are node-global and not per-PDP context 2017-08-13 13:27:48 +02:00
Harald Welte ed7a17750f GGSN: Test PDP Context activation wtih different PCOs 2017-08-09 20:26:20 +02:00
Harald Welte 231b94190c GGSN IPv6: Transmit Router Solicit, receive RouterAdv, transmit NeightSolicit 2017-08-09 17:16:31 +02:00
Harald Welte 811651ebdc GGSN_Tests: Get it up to PDP Ctx ACT, GTP-U and Ctx DEACT 2017-08-05 15:25:06 +02:00
Harald Welte f1e0d5a39f GGSN_Tests: Add function to send DELETE PDP CONTEXT 2017-08-05 08:51:22 +02:00
Harald Welte 3af89489ba GGSN_Tests: Implement GTP-U ping/pong response 2017-08-04 16:20:23 +02:00
Harald Welte 876345e460 GGSN_Tests: Prepare for separate IPs on control/user plane 2017-08-04 16:19:59 +02:00