/
test_attach_detach_with_pco_ipcp.py
61 lines (48 loc) · 1.8 KB
/
test_attach_detach_with_pco_ipcp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest
import s1ap_types
from integ_tests.s1aptests import s1ap_wrapper
class TestAttachDetachWithPcoIpcp(unittest.TestCase):
def setUp(self):
self._s1ap_wrapper = s1ap_wrapper.TestWrapper()
def tearDown(self):
self._s1ap_wrapper.cleanup()
def test_attach_detach_with_pco_ipcp(self):
""" Test case to test PCO option IPCP during attach"""
num_ues = 1
self._s1ap_wrapper.configUEDevice(num_ues)
req = self._s1ap_wrapper.ue_req
print(
"************************* Running End to End attach for ",
"UE id ",
req.ue_id,
)
# Now actually complete the attach
self._s1ap_wrapper._s1_util.attach(
req.ue_id,
s1ap_types.tfwCmd.UE_END_TO_END_ATTACH_REQUEST,
s1ap_types.tfwCmd.UE_ATTACH_ACCEPT_IND,
s1ap_types.ueAttachAccept_t,
ipcp=True,
)
# Wait on EMM Information from MME
self._s1ap_wrapper._s1_util.receive_emm_info()
print(
"************************* Running UE detach for UE id ",
req.ue_id,
)
# Now detach the UE
self._s1ap_wrapper.s1_util.detach(
req.ue_id, s1ap_types.ueDetachType_t.UE_NORMAL_DETACH.value, True,
)
if __name__ == "__main__":
unittest.main()