From 72508ce12379dae35ec41b321d43638135e223ba Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Thu, 31 Mar 2016 16:49:55 +0300 Subject: some david sphinx cleanup --- .../trex_control_plane/doc_stl/api/client_code.rst | 21 +++++++++++++++------ .../automation/trex_control_plane/doc_stl/conf.py | 2 +- .../automation/trex_control_plane/doc_stl/index.rst | 12 ++++++++---- 3 files changed, 24 insertions(+), 11 deletions(-) (limited to 'scripts/automation/trex_control_plane') diff --git a/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst b/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst index fff3052e..4ae2b9fd 100755 --- a/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst +++ b/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst @@ -12,10 +12,13 @@ The protocol is JSON-RPC2 over ZMQ transport. In addition to the Python API, a console-based API interface is also available. Python-like example:: -.. c.start(ports = [0, 1], mult = "5mpps", duration = 10) - + + c.start(ports = [0, 1], mult = "5mpps", duration = 10) + Console-like example:: -.. c.start_line (" -f ../../../../stl/udp_1pkt_simple.py -m 10mpps --port 0 1 ") + + c.start_line (" -f stl/udp_1pkt_simple.py -m 10mpps --port 0 1 ") + Example 1 - Typical Python API:: @@ -56,7 +59,8 @@ STLClient snippet ----------------- -Example 1: Minimal example of client interacting with the TRex server:: +.. code-block:: python + :caption: Example 1: Minimal example of client interacting with the TRex server c = STLClient() @@ -82,8 +86,9 @@ Example 1: Minimal example of client interacting with the TRex server:: c.disconnect() +.. code-block:: python + :caption: Example 2: Client can execute other functions while the TRex server is generating traffic -Example 2: Client can execute other functions while the TRex server is generating traffic:: c = STLClient() try: @@ -106,7 +111,10 @@ Example 2: Client can execute other functions while the TRex server is generatin c.disconnect() -Example 3: Console-like API interface:: + +.. code-block:: python + :caption: Example 3: Console-like API interface + def simple (): @@ -155,6 +163,7 @@ Example 3: Console-like API interface:: finally: c.disconnect() + Example 4: Load profile from a file:: def simple (): diff --git a/scripts/automation/trex_control_plane/doc_stl/conf.py b/scripts/automation/trex_control_plane/doc_stl/conf.py index fe6b27bc..45738b6e 100644 --- a/scripts/automation/trex_control_plane/doc_stl/conf.py +++ b/scripts/automation/trex_control_plane/doc_stl/conf.py @@ -69,7 +69,7 @@ author = u'TRex team, Cisco Systems Inc.' # The short X.Y version. version = '1.94' # The full version, including alpha/beta/rc tags. -release = '1.7.1' +release = '2.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/scripts/automation/trex_control_plane/doc_stl/index.rst b/scripts/automation/trex_control_plane/doc_stl/index.rst index 97a1037a..aa2abd75 100644 --- a/scripts/automation/trex_control_plane/doc_stl/index.rst +++ b/scripts/automation/trex_control_plane/doc_stl/index.rst @@ -20,19 +20,23 @@ How to Install | Put it at any place you like, preferably same place as your scripts. | (If it's not at same place as your scripts, you will need to ensure trex_client directory is in sys.path) -Un-pack it using command: tar -xzf trex_client.tar.gz +Un-pack it using command:: -How to pyATS/v2.0 + tar -xzf trex_client.tar.gz + + +How to pyATS ================== .. sectionauthor:: David Shen pyATS Compatibility -Trex only supports python2 for now, so it only works for **Python2** pyats. +TRex supports both Python2 and Python3 pyATS. -* Install python2 pyats +* Install python2/python3 pyats /auto/pyats/bin/pyats-install --python2 + /auto/pyats/bin/pyats-install --python3 * setenv TREX_PATH to the trex stateless lib path setenv TREX_PATH /automation/trex_control_plane/stl -- cgit 1.2.3-korg