magma / S1APTester

A test tool that simulates the s1aptest functionality of a LTE network
Other
54 stars 43 forks source link

fix(agw): Fixed S1 Handover Failure Issue #66

Closed VinashakAnkitAman closed 2 years ago

VinashakAnkitAman commented 2 years ago

Title

Fixed S1 Handover Failure Issue

Summary

The S1 Handover test case is failing on CI with assert failure. The reason of failure is that one of the flag to used in Dam module was reset from ENB app thread before its use for some of the cases. This PR fixes the issue.

The S1APTester assert failure log is as below:

vagrant@magma-test:~/magma/lte/gateway/python/integ_tests$ make integ_test TESTS=s1aptests/test_s1_handover.py
. /home/vagrant/build/python/bin/activate
echo "Running test: s1aptests/test_s1_handover.py"
Running test: s1aptests/test_s1_handover.py
timeout --foreground -k 930s 900s sudo -E PATH=/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin PYTHONPATH=:/home/vagrant/s1ap-tester/bin /home/vagrant/build/python/bin/nosetests --with-xunit --xunit-file=/var/tmp/test_results/test_s1_handover.xml -x -s s1aptests/test_s1_handover.py || exit 1
Start time 18:16:54
tag: AUTH_TYPE tagVal: MILENAGE
************************* Enb tester config

**********************TPT open server******** 0

 Server Socket FD =[13]
************* Testing *Time elapsed(in usec): for timer expiry               :9599 usec
AGW is stateless
APN Correction configured
Health service is disabled
***************** Sending Multiple Enb Config Request

**** data->numOfEnbs = 2
Waiting for 2 seconds for multiple ENBs to get configured
Using subscriber IMSI IMSI001010000000001
Using IMEI 3805468432113171
************************* UE device config for ue_id  1
************************* Configuring IP block
************************* Waiting for IP changes to propagate
************************* S1 setup
************************* UE App config
************************* Running End to End attach for UE Id: 1
ue id 1 found

*************NbUiNbuHdlUeRadioCapMsg: Send UE cap msg SUCCESS*********
PDN_TYPE: 1
IPv4 PDN_ADDRESS:192 168 128 12
Waiting for 3 seconds for the flow rules creation
************ Verifying flow rules
Checking for uplink flow
Get uplink flows: attempt  0
Checking for downlink flow
************************* Sending S1 Handover Required for UE Id: 1
************************* Received S1 Handover Request Indication (UeId: 1, Connected EnbId: 0) (HO SrcEnbId: 0, HO TgtEnbId: 1)
Deleting Ue Context from Traffic Handler
************************* Received S1 Handover Command Indication (UeId: 1, Connected EnbId: 0) (HO SrcEnbId: 0, HO TgtEnbId: 1)
************************* send SCTP SHUTDOWN
/home/vagrant/build/python/lib/python3.8/site-packages/redis/connection.py:72: UserWarning: redis-py works best with hiredis. Please consider installing
  warnings.warn(msg)
/home/vagrant/build/python/lib/python3.8/site-packages/redis/connection.py:72: UserWarning: redis-py works best with hiredis. Please consider installing
  warnings.warn(msg)
/home/vagrant/build/python/lib/python3.8/site-packages/redis/connection.py:72: UserWarning: redis-py works best with hiredis. Please consider installing
  warnings.warn(msg)
/home/vagrant/build/python/lib/python3.8/site-packages/redis/connection.py:72: UserWarning: redis-py works best with hiredis. Please consider installing
  warnings.warn(msg)
Keys left in Redis (list should be empty)[
 IMSI001010000000001:MME
IMSI001010000000001:SPGW
IMSI001010000000001.magma.ipv4,ipv4:mobilityd_ipdesc_record

nb_ue_attached: 1
]
Entries in s1ap_imsi_map (should be zero): 0
Entries left in hashtables (should be zero): 3
Entries in mme_ueip_imsi_map (should be zero): 1
F
======================================================================
FAIL: S1 Handover Successful Scenario:
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/magma/lte/gateway/python/integ_tests/s1aptests/test_s1_handover.py", line 172, in test_s1_handover
    s1ap_types.tfwCmd.S1_MME_STATUS_TRSFR_IND.value,
AssertionError: 52 != 101
-------------------- >> begin captured logging << --------------------
root: ERROR: Could not load magmad yml config for mconfig modules
urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): 192.168.60.142:3333
urllib3.connectionpool: DEBUG: http://192.168.60.142:3333 "GET /stats/switches HTTP/1.1" 200 17
root: INFO: Adding subscriber : IMSI001010000000001
root: DEBUG: s1ap response expected, received: 12, 12
root: DEBUG: s1ap message expected, received: 68, 68
urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): 192.168.60.142:3333
urllib3.connectionpool: DEBUG: http://192.168.60.142:3333 "POST /stats/flow/226783538176074 HTTP/1.1" 200 765
urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): 192.168.60.142:3333
urllib3.connectionpool: DEBUG: http://192.168.60.142:3333 "POST /stats/flow/226783538176074 HTTP/1.1" 200 965
root: INFO: Deleting subscriber : IMSI001010000000001
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 13.749s

FAILED (failures=1)
Makefile:42: recipe for target 'integ_test' failed
make: *** [integ_test] Error 1

Test plan

Verified with sanity and individual test cases