|
11 | 11 | """ |
12 | 12 | import logging |
13 | 13 | from contextlib import contextmanager |
| 14 | +from time import sleep |
14 | 15 | from typing import Dict, Generator, Optional, Sequence, Tuple, Union |
15 | 16 |
|
16 | 17 | import pytest |
|
32 | 33 | iperf_sequentially, |
33 | 34 | iperf_start, |
34 | 35 | iperf_wait_until_finish, |
| 36 | + multi_ue_mobility_iperf, |
35 | 37 | ping_start, |
36 | 38 | ping_wait_until_finish, |
37 | 39 | start_network, |
38 | 40 | stop, |
| 41 | + ue_move, |
39 | 42 | ue_reestablishment, |
40 | 43 | ue_reestablishment_parallel, |
41 | 44 | ue_start_and_attach, |
@@ -648,3 +651,102 @@ def _test_reestablishments( |
648 | 651 |
|
649 | 652 | finally: |
650 | 653 | get_kpis(du_or_gnb_array=[gnb], ue_array=ue_array, metrics_summary=metrics_summary) |
| 654 | + |
| 655 | + |
| 656 | +HIGH_BITRATE = int(15e6) |
| 657 | + |
| 658 | + |
| 659 | +@mark.parametrize( |
| 660 | + "protocol", |
| 661 | + ( |
| 662 | + param(IPerfProto.UDP, id="udp", marks=mark.udp), |
| 663 | + param(IPerfProto.TCP, id="tcp", marks=mark.tcp), |
| 664 | + ), |
| 665 | +) |
| 666 | +@mark.parametrize( |
| 667 | + "band, common_scs, bandwidth, noise_spd", |
| 668 | + ( |
| 669 | + param(3, 15, 50, -164, id="band:%s-scs:%s-bandwidth:%s-noise:%s"), |
| 670 | + param(41, 30, 50, -164, id="band:%s-scs:%s-bandwidth:%s-noise:%s"), |
| 671 | + ), |
| 672 | +) |
| 673 | +@mark.zmq_single_ue |
| 674 | +@mark.flaky( |
| 675 | + reruns=2, only_rerun=["failed to start", "Attach timeout reached", "StatusCode.ABORTED", "License unavailable"] |
| 676 | +) |
| 677 | +# pylint: disable=too-many-arguments,too-many-positional-arguments |
| 678 | +def test_zmq_mobility_noise_reestablishment( |
| 679 | + retina_manager: RetinaTestManager, |
| 680 | + retina_data: RetinaTestData, |
| 681 | + ue: UEStub, |
| 682 | + fivegc: FiveGCStub, |
| 683 | + gnb: GNBStub, |
| 684 | + metrics_summary: MetricsSummary, |
| 685 | + band: int, |
| 686 | + common_scs: int, |
| 687 | + bandwidth: int, |
| 688 | + noise_spd: int, |
| 689 | + protocol: IPerfProto, |
| 690 | +): |
| 691 | + """ |
| 692 | + ZMQ mobility noise reestablishment test |
| 693 | + """ |
| 694 | + |
| 695 | + with multi_ue_mobility_iperf( |
| 696 | + retina_manager=retina_manager, |
| 697 | + retina_data=retina_data, |
| 698 | + ue_array=[ue], |
| 699 | + gnb_array=[gnb], |
| 700 | + fivegc=fivegc, |
| 701 | + metrics_summary=metrics_summary, |
| 702 | + band=band, |
| 703 | + common_scs=common_scs, |
| 704 | + bandwidth=bandwidth, |
| 705 | + bitrate=HIGH_BITRATE, |
| 706 | + protocol=protocol, |
| 707 | + direction=IPerfDir.BIDIRECTIONAL, |
| 708 | + sample_rate=None, # default from testbed |
| 709 | + global_timing_advance=0, |
| 710 | + time_alignment_calibration=0, |
| 711 | + always_download_artifacts=True, |
| 712 | + noise_spd=noise_spd, |
| 713 | + sleep_between_movement_steps=1, |
| 714 | + warning_as_errors=True, |
| 715 | + allow_failure=True, |
| 716 | + ) as (ue_attach_info_dict, movements, _): |
| 717 | + |
| 718 | + for ue_stub, ue_attach_info in ue_attach_info_dict.items(): |
| 719 | + logging.info( |
| 720 | + "Zigzag mobility reestablishment for UE [%s] (%s) + iPerf running in background for all UEs", |
| 721 | + id(ue_stub), |
| 722 | + ue_attach_info.ipv4, |
| 723 | + ) |
| 724 | + |
| 725 | + for _from_position, _to_position, _movement_steps, _sleep_between_movement_steps in movements: |
| 726 | + logging.info( |
| 727 | + "Moving UE [%s] from %s to %s (allowing handover failure)", |
| 728 | + id(ue_stub), |
| 729 | + _from_position, |
| 730 | + _to_position, |
| 731 | + ) |
| 732 | + |
| 733 | + for i in range(_movement_steps + 1): |
| 734 | + ue_move( |
| 735 | + ue_stub=ue_stub, |
| 736 | + x_coordinate=( |
| 737 | + int( |
| 738 | + round(_from_position[0] + (i * (_to_position[0] - _from_position[0]) / _movement_steps)) |
| 739 | + ) |
| 740 | + ), |
| 741 | + y_coordinate=( |
| 742 | + int( |
| 743 | + round(_from_position[1] + (i * (_to_position[1] - _from_position[1]) / _movement_steps)) |
| 744 | + ) |
| 745 | + ), |
| 746 | + z_coordinate=( |
| 747 | + int( |
| 748 | + round(_from_position[2] + (i * (_to_position[2] - _from_position[2]) / _movement_steps)) |
| 749 | + ) |
| 750 | + ), |
| 751 | + ) |
| 752 | + sleep(_sleep_between_movement_steps) |
0 commit comments