Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added code to reuse Ixia Traffic Gen Session #174

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ixnetwork_restpy.assistants.statistics.statviewassistant import StatViewAssistant as SVA
from ixnetwork_restpy.files import Files
from ixnetwork_restpy.testplatform.testplatform import TestPlatform
from ixnetwork_restpy import SessionAssistant, Files


class IxnetworkIxiaClientImpl(IxnetworkIxiaClient):
Expand Down Expand Up @@ -69,12 +70,17 @@ def run_connect(self, device, command, *argv, **kwarg):
cport = param.get("client_port", 443)
if not caddr:
return 0, "No Address to connect!"
gw = TestPlatform(ip_address=caddr, rest_port=cport)
gw.Authenticate(device.username, device.password)
# session = gw.Sessions.find()[0]
# device.applog.info(session)
# if session.Id == -1:
session = gw.Sessions.add()

gw = SessionAssistant(
IpAddress=caddr,
RestPort=cport,
UserName=device.username,
Password=device.password,
SessionName="DENT",
ClearConfig=True
) # ,LogLevel='info'
session = gw.Session

device.applog.info("Connected to Linux Gateway Session ID: %d" % session.Id)
device.applog.info("Reserving test ports, and may take a minute...")
IxnetworkIxiaClientImpl.session = session
Expand Down