@@ -33,6 +33,7 @@ import (
33
33
"github.com/onsi/ginkgo"
34
34
"github.com/onsi/gomega"
35
35
"github.com/pkg/errors"
36
+ gtpuie "github.com/wmnsk/go-gtp/gtpv1/ie"
36
37
gtpumessage "github.com/wmnsk/go-gtp/gtpv1/message"
37
38
"github.com/wmnsk/go-pfcp/ie"
38
39
"github.com/wmnsk/go-pfcp/message"
@@ -2218,6 +2219,74 @@ var _ = ginkgo.Describe("Error handling", func() {
2218
2219
})
2219
2220
})
2220
2221
2222
+ var _ = ginkgo .Describe ("PGW Error indication" , func () {
2223
+ f := framework .NewDefaultFramework (framework .UPGModePGW , framework .UPGIPModeV4 )
2224
+ ginkgo .It ("Error indication for deleted session" , func () {
2225
+ ginkgo .By ("Configuring session" )
2226
+
2227
+ var sessionCfgs []framework.SessionConfig
2228
+ var seids []pfcp.SEID
2229
+
2230
+ // Create another session to trigger crash
2231
+ ueIPs := []net.IP {f .UEIP (), f .AddUEIP ()}
2232
+ for i , ueIP := range ueIPs {
2233
+ sessionCfgs = append (sessionCfgs , framework.SessionConfig {
2234
+ IdBase : 1 ,
2235
+ UEIP : ueIP ,
2236
+ Mode : f .Mode ,
2237
+ VolumeQuota : 100000000 ,
2238
+ TEIDPGWs5u : framework .TEIDPGWs5u + uint32 (i ),
2239
+ TEIDSGWs5u : framework .TEIDSGWs5u + uint32 (i ),
2240
+ PGWIP : f .VPPCfg .GetVPPAddress ("grx" ).IP ,
2241
+ SGWIP : f .VPPCfg .GetNamespaceAddress ("grx" ).IP ,
2242
+ })
2243
+ seids = append (seids , f .PFCP .NewSEID ())
2244
+ }
2245
+
2246
+ for i := range sessionCfgs {
2247
+ _ , err := f .PFCP .EstablishSession (f .Context , seids [i ], sessionCfgs [i ].SessionIEs ()... )
2248
+ framework .ExpectNoError (err )
2249
+ }
2250
+
2251
+ ginkgo .By ("Starting some traffic" )
2252
+ tg , clientNS , serverNS := newTrafficGen (f , & traffic.UDPPingConfig {
2253
+ PacketCount : 5 ,
2254
+ Retry : false ,
2255
+ Delay : 10 * time .Millisecond ,
2256
+ }, & traffic.SimpleTrafficRec {})
2257
+ tg .Start (f .Context , clientNS , serverNS )
2258
+
2259
+ ginkgo .By ("Sending error indication" )
2260
+
2261
+ stopSpam := make (chan struct {}, 1 )
2262
+
2263
+ spamErrorsIndications := func () {
2264
+ for {
2265
+ select {
2266
+ case _ , closed := <- stopSpam :
2267
+ if closed {
2268
+ return
2269
+ }
2270
+ default :
2271
+ err := f .GTPUs [0 ].SendErrorIndication (0 , 0 ,
2272
+ gtpuie .NewTEIDDataI (sessionCfgs [0 ].TEIDSGWs5u ),
2273
+ gtpuie .NewGSNAddress (f .VPPCfg .GetNamespaceAddress ("grx" ).IP .String ()),
2274
+ )
2275
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
2276
+ time .Sleep (time .Millisecond )
2277
+ }
2278
+ }
2279
+ }
2280
+ go spamErrorsIndications ()
2281
+
2282
+ f .PFCP .DeleteSession (f .Context , seids [0 ])
2283
+ time .Sleep (time .Second / 2 )
2284
+ f .PFCP .DeleteSession (f .Context , seids [1 ])
2285
+ close (stopSpam )
2286
+ time .Sleep (10 * time .Second )
2287
+ })
2288
+ })
2289
+
2221
2290
var _ = ginkgo .Describe ("Error handling" , func () {
2222
2291
f := framework .NewDefaultFramework (framework .UPGModeTDF , framework .UPGIPModeV4 )
2223
2292
0 commit comments