text: """
  Copyright (c) 2016-present, Facebook, Inc.
  All rights reserved.
  
  This source code is licensed under the BSD-style license found in the
  LICENSE file in the root directory of this source tree. An additional grant
  of patent rights can be found in the PATENTS file in the same directory.
  """
  
  import unittest
  
  
  import s1ap_types
  import s1ap_wrapper
  
  
  class TestAttachDetachMultiUe(unittest.TestCase):
  
      def setUp(self):
          self._s1ap_wrapper = s1ap_wrapper.TestWrapper()
  
      def tearDown(self):
          self._s1ap_wrapper.cleanup()
  
      def test_attach_detach_multi_ue(self):
          """ Same as attach detach but for 32 UEs """
          ue_ids = []
          num_ues = 32
          self._s1ap_wrapper.configUEDevice(num_ues)
          for _ in range(num_ues):
              req = self._s1ap_wrapper.ue_req
              print("************************* Calling attach for UE id ",
                    req.ue_id)
              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)
              # Wait on EMM Information from MME
              self._s1ap_wrapper._s1_util.receive_emm_info()
              ue_ids.append(req.ue_id)
  
          for ue in ue_ids:
              print("************************* Calling detach for UE id ", ue)
              self._s1ap_wrapper.s1_util.detach(
                  ue,
                  s1ap_types.ueDetachType_t.UE_NORMAL_DETACH.value)
  
  
  if __name__ == "__main__":
      unittest.main()
  