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

<testCaseList>
  <htmlTabRef>TEST-SA-FR1-F1-E1-B200</htmlTabRef>
  <htmlTabName>40 MHz TDD F1+E1 SA</htmlTabName>
  <htmlTabIcon>tasks</htmlTabIcon>

  <testCase>
    <class>Pull_Local_Registry</class>
    <desc>Pull Images from Local Registry</desc>
    <node>ofqot</node>
    <images>oai-gnb oai-nr-cuup</images>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Disable Sleep States</desc>
    <node>ofqot</node>
    <command>sudo cpupower idle-set -D 0</command>
  </testCase>

  <testCase>
    <class>Initialize_UE</class>
    <desc>Initialize Quectel</desc>
    <id>idefix</id>
  </testCase>

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

  <testCase>
    <class>Deploy_Object</class>
    <desc>Deploy gNB-CU-CP/gNB-CU-UP/gNB-DU (TDD/n76/40MHz/B200)</desc>
    <node>ofqot</node>
    <yaml_path>ci-scripts/yaml_files/sa_e1_b200_gnb</yaml_path>
    <services>gnb_cucp gnb_cuup gnb_du_tdd</services>
  </testCase>

  <testCase>
    <class>Attach_UE</class>
    <desc>Attach Quectel</desc>
    <id>idefix</id>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Check UE is on dedicated BWP ID 1</desc>
    <node>ofqot</node>
    <command>echo ci get_current_bwp | nc -N 127.0.0.1 9091 | grep 'DL BWP ID 1 (dedicated) UL BWP ID 1 (dedicated)'</command>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping: 50pings in 10sec</desc>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
    <ping_args>-c 20 -i 0.2</ping_args>
    <ping_packetloss_threshold>1</ping_packetloss_threshold>
    <ping_rttavg_threshold>25</ping_rttavg_threshold>
  </testCase>

  <testCase>
    <class>Iperf</class>
    <desc>iperf (DL/TCP)(20 sec)(single-ue profile)</desc>
    <iperf_args>-t 20 -R</iperf_args>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
    <iperf_tcp_rate_target>140</iperf_tcp_rate_target>
  </testCase>

  <testCase>
    <class>Iperf</class>
    <desc>iperf (UL/TCP)(20 sec)(single-ue profile)</desc>
    <iperf_args>-t 20</iperf_args>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
    <iperf_tcp_rate_target>15</iperf_tcp_rate_target>
  </testCase>

  <testCase>
    <class>Iperf</class>
    <desc>iperf (BIDIR TCP)(20 sec)(single-ue profile)</desc>
    <iperf_args>-t 20 --bidir</iperf_args>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Trigger Reestablishment (on DU)</desc>
    <node>ofqot</node>
    <command>echo ci force_reestab | nc -N 127.0.0.1 9091 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping: 20pings</desc>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
    <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 (on CU)</desc>
    <node>ofqot</node>
    <command>echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping: 50pings in 10sec</desc>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
    <ping_args>-c 20 -i 0.2</ping_args>
    <ping_packetloss_threshold>1</ping_packetloss_threshold>
    <ping_rttavg_threshold>25</ping_rttavg_threshold>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Switch to dedicated BWP ID 2</desc>
    <node>ofqot</node>
    <command>echo ci trigger_bwp_switch 2 | nc -N 127.0.0.1 9091 | grep 'triggered BWP switch to BWP ID 2 for UE'</command>
  </testCase>

  <testCase>
    <class>Iperf</class>
    <desc>iperf (DL/TCP)(10 sec)(single-ue profile)</desc>
    <iperf_args>-t 10 -R</iperf_args>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
    <iperf_tcp_rate_target>35</iperf_tcp_rate_target>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Check UE is on dedicated BWP ID 2</desc>
    <node>ofqot</node>
    <command>echo ci get_current_bwp | nc -N 127.0.0.1 9091 | grep 'DL BWP ID 2 (dedicated) UL BWP ID 2 (dedicated)'</command>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Switch to dedicated BWP ID 3</desc>
    <node>ofqot</node>
    <command>echo ci trigger_bwp_switch 3 | nc -N 127.0.0.1 9091 | grep 'triggered BWP switch to BWP ID 3 for UE'</command>
  </testCase>

  <testCase>
    <class>Iperf</class>
    <desc>iperf (DL/TCP)(10 sec)(single-ue profile)</desc>
    <iperf_args>-t 10 -R</iperf_args>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
    <iperf_tcp_rate_target>65</iperf_tcp_rate_target>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Check UE is on dedicated BWP ID 3</desc>
    <node>ofqot</node>
    <command>echo ci get_current_bwp | nc -N 127.0.0.1 9091 | grep 'DL BWP ID 3 (dedicated) UL BWP ID 3 (dedicated)'</command>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Switch to initial BWP ID 0</desc>
    <node>ofqot</node>
    <command>echo ci trigger_bwp_switch 0 | nc -N 127.0.0.1 9091 | grep 'triggered BWP switch to BWP ID 0 for UE'</command>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping: 50pings in 10sec</desc>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
    <ping_args>-c 20 -i 0.2</ping_args>
    <ping_packetloss_threshold>1</ping_packetloss_threshold>
    <ping_rttavg_threshold>25</ping_rttavg_threshold>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Check UE is on initial BWP ID 0</desc>
    <node>ofqot</node>
    <command>echo ci get_current_bwp | nc -N 127.0.0.1 9091 | grep 'DL BWP ID 0 (initial) UL BWP ID 0 (initial)'</command>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Switch to dedicated BWP ID 1</desc>
    <node>ofqot</node>
    <command>echo ci trigger_bwp_switch 1 | nc -N 127.0.0.1 9091 | grep 'triggered BWP switch to BWP ID 1 for UE'</command>
  </testCase>

  <testCase>
    <class>Ping</class>
    <desc>Ping: 50pings in 10sec</desc>
    <id>idefix</id>
    <svr_id>sabox-nepes</svr_id>
    <ping_args>-c 20 -i 0.2</ping_args>
    <ping_packetloss_threshold>1</ping_packetloss_threshold>
    <ping_rttavg_threshold>25</ping_rttavg_threshold>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <desc>Check UE is on dedicated BWP ID 1</desc>
    <node>ofqot</node>
    <command>echo ci get_current_bwp | nc -N 127.0.0.1 9091 | grep 'DL BWP ID 1 (dedicated) UL BWP ID 1 (dedicated)'</command>
  </testCase>

  <testCase>
    <class>Detach_UE</class>
    <always_exec>true</always_exec>
    <desc>Detach Quectel</desc>
    <id>idefix</id>
  </testCase>

  <testCase>
    <class>Terminate_UE</class>
    <always_exec>true</always_exec>
    <desc>Terminate Quectel</desc>
    <id>idefix</id>
  </testCase>

  <testCase>
    <class>Undeploy_Object</class>
    <always_exec>true</always_exec>
    <desc>Undeploy CUCP/CU-UP/DU</desc>
    <node>ofqot</node>
    <yaml_path>ci-scripts/yaml_files/sa_e1_b200_gnb</yaml_path>
    <analysis>
      <services>gnb_cucp=EndsWithBye gnb_cuup=EndsWithBye gnb_du_tdd=RetxCheck=10,100,100,100 gnb_du_tdd=EndsWithBye</services>
    </analysis>
  </testCase>

  <testCase>
    <class>Custom_Command</class>
    <always_exec>true</always_exec>
    <desc>Enable Sleep States</desc>
    <node>ofqot</node>
    <command>sudo cpupower idle-set -E</command>
  </testCase>

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

</testCaseList>
