Skip to content

Commit f64b85c

Browse files
committed
snappi:removed get_ixnetwork function and hardcoded reference to IXIA setup
1 parent 626fb5e commit f64b85c

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

tests/common/snappi_tests/traffic_generation.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
from tests.common.cisco_data import is_cisco_device
1919

2020
# Imported to support rest_py in ixnetwork
21-
from ixnetwork_restpy import SessionAssistant
2221
from ixnetwork_restpy.assistants.statistics.statviewassistant import StatViewAssistant
23-
from ixnetwork_restpy.testplatform.testplatform import TestPlatform
24-
import snappi
2522

2623

2724
logger = logging.getLogger(__name__)
@@ -919,34 +916,6 @@ def tgen_curr_stats(traf_metrics, flow_metrics, data_flow_names):
919916
return stats
920917

921918

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-
950919
def run_traffic_and_collect_stats(rx_duthost,
951920
tx_duthost,
952921
api,
@@ -1015,7 +984,7 @@ def check_absence(flow_name, prio_list):
1015984
api.set_capture_state(cs)
1016985

1017986
# 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
1019988

1020989
# If imix flag is set, IMIX packet-profile is enabled.
1021990
if (imix):

0 commit comments

Comments
 (0)