|
18 | 18 | from tests.common.cisco_data import is_cisco_device |
19 | 19 |
|
20 | 20 | # Imported to support rest_py in ixnetwork |
21 | | -from ixnetwork_restpy import SessionAssistant |
22 | 21 | from ixnetwork_restpy.assistants.statistics.statviewassistant import StatViewAssistant |
23 | | -from ixnetwork_restpy.testplatform.testplatform import TestPlatform |
24 | | -import snappi |
25 | 22 |
|
26 | 23 |
|
27 | 24 | logger = logging.getLogger(__name__) |
@@ -919,34 +916,6 @@ def tgen_curr_stats(traf_metrics, flow_metrics, data_flow_names): |
919 | 916 | return stats |
920 | 917 |
|
921 | 918 |
|
922 | | -def get_ixnet_rest_api(api): |
923 | | - """ |
924 | | - To enable the data-slicing on IXIA session. |
925 | | - This is for ARES chassis as we cannot capture more than 1024 packets in PCAP. |
926 | | - Enabling data-slicing helps to capture more than 1000 packets. |
927 | | -
|
928 | | - Args: |
929 | | - snappi_api(obj): Snappi API object. |
930 | | - Returns: |
931 | | - ixnetwork(obj): rest_py API object. |
932 | | - """ |
933 | | - |
934 | | - api = snappi.api(location="1.1.30.1", ext="ixnetwork") |
935 | | - api._username = "admin" |
936 | | - api._password = "admin" |
937 | | - username = api._username |
938 | | - ip = api._address |
939 | | - password = api._password |
940 | | - test_platform = TestPlatform(ip) |
941 | | - test_platform.Authenticate(username, password) |
942 | | - |
943 | | - id = test_platform.Sessions.find()[-1].Id # takes the latest session id |
944 | | - session = SessionAssistant(IpAddress=ip, UserName=username, SessionId=id, Password=password) |
945 | | - ixnetwork = session.Ixnetwork |
946 | | - |
947 | | - return ixnetwork |
948 | | - |
949 | | - |
950 | 919 | def run_traffic_and_collect_stats(rx_duthost, |
951 | 920 | tx_duthost, |
952 | 921 | api, |
@@ -1015,7 +984,7 @@ def check_absence(flow_name, prio_list): |
1015 | 984 | api.set_capture_state(cs) |
1016 | 985 |
|
1017 | 986 | # Returns the rest API object for features not present in Snappi |
1018 | | - ixnet_rest_api = get_ixnet_rest_api(api) |
| 987 | + ixnet_rest_api = api._ixnetwork |
1019 | 988 |
|
1020 | 989 | # If imix flag is set, IMIX packet-profile is enabled. |
1021 | 990 | if (imix): |
|
0 commit comments