<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->

<testCaseList>
  <htmlTabRef>rfsim-5gnr-ntn-geo</htmlTabRef>
  <htmlTabName>Monolithic SA NTN GEO gNB</htmlTabName>
  <htmlTabIcon>wrench</htmlTabIcon>

  <testCase>
    <class>Pull_Local_Registry</class>
    <desc>Pull Images from Local Registry</desc>
    <node>localhost</node>
    <images>oai-gnb-asan oai-nr-ue-asan</images>
  </testCase>

  <testCase>
    <class>Create_Workspace</class>
    <desc>Create new Workspace</desc>
    <node>localhost</node>
  </testCase>

  <testCase>
    <class>Deploy_Object</class>
    <desc>Deploy OAI 5G CoreNetwork</desc>
    <node>localhost</node>
    <yaml_path>ci-scripts/yaml_files/5g_rfsimulator_ntn_geo</yaml_path>
    <services>mysql oai-amf oai-smf oai-upf oai-ext-dn</services>
  </testCase>

  <testCase>
    <class>Deploy_Object</class>
    <desc>Deploy OAI 5G gNB+nrUE RF sim SA</desc>
    <node>localhost</node>
    <yaml_path>ci-scripts/yaml_files/5g_rfsimulator_ntn_geo</yaml_path>
    <services>oai-gnb oai-nr-ue</services>
  </testCase>

  <testCase>
    <class>Attach_UE</class>
    <desc>Attach OAI UE (Wait for IP)</desc>
    <id>rfsim5g_ue</id>
    <node>localhost</node>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping ext-dn from NR-UE</desc>
    <id>rfsim5g_ue</id>
    <node>localhost</node>
    <svr_id>rfsim5g_ext_dn</svr_id>
    <svr_node>localhost</svr_node>
    <ping_args>-c 20 -i 0.25</ping_args>
    <ping_packetloss_threshold>5</ping_packetloss_threshold>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping NR-UE from ext-dn</desc>
    <id>rfsim5g_ext_dn</id>
    <node>localhost</node>
    <svr_id>rfsim5g_ue</svr_id>
    <svr_node>localhost</svr_node>
    <ping_args>-c 20 -i 0.25</ping_args>
    <ping_packetloss_threshold>5</ping_packetloss_threshold>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Trigger Reestablishment</desc>
    <node>localhost</node>
    <command>echo ci force_reestab | ncat 192.168.71.140 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
    <command_fail>yes</command_fail>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping ext-dn from NR-UE</desc>
    <id>rfsim5g_ue</id>
    <node>localhost</node>
    <svr_id>rfsim5g_ext_dn</svr_id>
    <svr_node>localhost</svr_node>
    <ping_args>-c 20 -i0.5 -w25</ping_args>
    <ping_packetloss_threshold>80</ping_packetloss_threshold>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Verify Reestablishment</desc>
    <node>localhost</node>
    <command>echo ci get_reestab_count | ncat 192.168.71.140 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
    <command_fail>yes</command_fail>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping ext-dn from NR-UE</desc>
    <id>rfsim5g_ue</id>
    <node>localhost</node>
    <svr_id>rfsim5g_ext_dn</svr_id>
    <svr_node>localhost</svr_node>
    <ping_args>-c 20 -i 0.25</ping_args>
    <ping_packetloss_threshold>5</ping_packetloss_threshold>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping NR-UE from ext-dn</desc>
    <id>rfsim5g_ext_dn</id>
    <node>localhost</node>
    <svr_id>rfsim5g_ue</svr_id>
    <svr_node>localhost</svr_node>
    <ping_args>-c 20 -i 0.25</ping_args>
    <ping_packetloss_threshold>5</ping_packetloss_threshold>
  </testCase>

  <testCase>
    <class>Undeploy_Object</class>
    <always_exec>true</always_exec>
    <desc>Undeploy all OAI 5G stack</desc>
    <node>localhost</node>
    <yaml_path>ci-scripts/yaml_files/5g_rfsimulator_ntn_geo</yaml_path>
    <analysis>
      <services>oai-gnb=EndsWithBye oai-nr-ue</services>
    </analysis>
  </testCase>

  <testCase>
    <class>Clean_Test_Server_Images</class>
    <always_exec>true</always_exec>
    <desc>Clean Test Images on Test Server</desc>
    <node>localhost</node>
    <images>oai-gnb-asan oai-nr-ue-asan</images>
  </testCase>

</testCaseList>
