Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dipendughosh committed Aug 14, 2024
1 parent f92b114 commit 2b21e34
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
26 changes: 11 additions & 15 deletions snappi_cyperf/cyperfapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

from RESTasV3 import RESTasV3

# mdw_address = sys.argv[1]
rest = RESTasV3(ipAddress="10.39.44.178")
# rest = RESTasV3(ipAddress="10.39.47.88")

# import sys
# sys.path.insert(0, "/home/dipendu/otg/open_traffic_generator/snappi/artifacts/snappi")
import snappi
Expand Down Expand Up @@ -43,8 +39,8 @@ def __init__(
self,
host,
version,
username=rest.username,
password=rest.password,
username,
password,
gateway_port=8080,
log_level="info",
**kwargs,
Expand Down Expand Up @@ -135,11 +131,11 @@ def set_config(self, config):
self._connect()
# self._ip_list = self.common.get_protocol_ip(config)
self._l47config = config
self.interfaces.config(rest)
self.tcp.config(rest)
self.http.config(rest)
# self.objectiveandtimeline.config(rest)
self.port.config(rest)
self.interfaces.config(self.rest)
self.tcp.config(self.rest)
self.http.config(self.rest)
# self.objectiveandtimeline.config(self.rest)
self.port.config(self.rest)
# self._apply_config()
except Exception as err:
self.logger.info(f"error:{err}")
Expand All @@ -159,12 +155,12 @@ def get_config(self):
def set_control_state(self, config):
try:
if config.app.state == "start":
self.start_test(rest)
self.start_test(self.rest)

elif config.app.state == "stop":
self.stop_test(rest)
self.stop_test(self.rest)
elif config.app.state == "abort":
self.abort_test(rest)
self.abort_test(self.rest)
except Exception as err:
self.logger.info(f"error:{err}")
raise Snappil47Exception(err)
Expand Down Expand Up @@ -284,7 +280,7 @@ def session_assistance(self):
# self.configID = "appsec-appmix-and-attack"
# self.configID = "appsec-empty-config"
self.configID = "appsec-appmix"
response = rest.create_session(self.configID)
response = self.rest.create_session(self.configID)
if response:
self.session_id = response.json()[0]["id"]
print("Config successfully opened, session ID: {}".format(self.session_id))
Expand Down
7 changes: 6 additions & 1 deletion snappi_cyperf/l47server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
# sys.path.append("/home/dipendu/otg/open_traffic_generator/snappi-cyperf")
from snappi_cyperf import cyperfapi

API = cyperfapi.Api(host="10.39.44.178", version="10.00.0.152")
API = cyperfapi.Api(
host="10.39.44.178",
version="10.00.0.152",
username="admin",
password="CyPerf&Keysight#1",
)
# API = cyperfapi.Api(host="10.39.47.88", version="10.00.0.152")


Expand Down

0 comments on commit 2b21e34

Please sign in to comment.