add cp_stl build
authorHanoh Haim <[email protected]>
Sun, 13 Mar 2016 13:25:07 +0000 (15:25 +0200)
committerHanoh Haim <[email protected]>
Sun, 13 Mar 2016 13:25:07 +0000 (15:25 +0200)
draft_trex_stateless.asciidoc
wscript

index 7ff203a..4c0b578 100644 (file)
@@ -299,6 +299,12 @@ Starting traffic on port(s) [0, 1, 2, 3]:                    [SUCCESS]
 <5> Stop on all the ports
 
 
+[NOTE] 
+=====================================================================
+In case you have a connection *error* look into /etc/trex_cfg.yaml
+you should *remove* keywords like `enable_zmq_pub : true` and `zmq_pub_port   : 4501`  from the file. 
+=====================================================================
+
 To look into the streams using `streams -a`
 
 .Streams
diff --git a/wscript b/wscript
index c7823d1..d94be25 100755 (executable)
--- a/wscript
+++ b/wscript
@@ -120,7 +120,6 @@ def do_visio(bld):
        for x in bld.path.ant_glob('visio\\*.vsd'):
                tg = bld(rule='${VIS} -i ${SRC} -o ${TGT} ', source=x, target=x.change_ext('.png'))
 
-#def build_cp_docs (trex_src_dir, dest_dir = "_build", builder = "html"):
 def build_cp_docs (task):
     out_dir = task.outputs[0].abspath()
     export_path = os.path.join(os.getcwd(), 'build', 'cp_docs')
@@ -137,6 +136,36 @@ def build_cp_docs (task):
         return subprocess.call(build_doc_cmd, cwd = trex_core_docs_path)
     return (1)
 
+def build_stl_cp_docs (task):
+    out_dir = task.outputs[0].abspath()
+    export_path = os.path.join(os.getcwd(), 'build', 'cp_stl_docs')
+    trex_core_git_path = os.path.join(os.getcwd(), os.pardir, "trex-core")
+    if not os.path.isdir(trex_core_git_path):
+        trex_core_git_path = os.getenv('TREX_CORE_GIT', None)
+    if trex_core_git_path: # there exists a default directory or the desired ENV variable.
+        trex_core_docs_path = os.path.abspath(os.path.join(trex_core_git_path, 'scripts', 'automation', 'trex_control_plane', 'doc_stl'))
+        build_doc_cmd = shlex.split("/usr/local/bin/sphinx-build -W -b {bld} {src} {dst}".format(
+            bld= "html", 
+            src= ".", 
+            dst= out_dir)
+        )
+        return subprocess.call(build_doc_cmd, cwd = trex_core_docs_path)
+    return (1)
+
+
+
+def build_cp(bld,dir,root,callback):
+       export_path = os.path.join(os.getcwd(), 'build', dir)
+       trex_core_git_path = os.path.join(os.getcwd(), os.pardir, "trex-core")
+       if not os.path.isdir(trex_core_git_path):
+               trex_core_git_path = os.getenv('TREX_CORE_GIT', None)
+       if trex_core_git_path: # there exists a default directory or the desired ENV variable.
+               trex_core_docs_path = os.path.join(trex_core_git_path, 'scripts', 'automation', 'trex_control_plane', root, 'index.rst')
+               bld(rule=build_cp_docs,target = dir)
+       else:
+               raise NameError("Environment variable 'TREX_CORE_GIT' is not defined.")
+
+
 
 def build(bld):
        bld(rule=my_copy, target='symbols.lang')
@@ -218,23 +247,8 @@ def build(bld):
        bld(rule='${ASCIIDOC}   -a stylesheet=${SRC[1].abspath()} -a  icons=true -a toc2 -a max-width=55em  -o ${TGT} ${SRC[0].abspath()}',
                source='trex_console.asciidoc waf.css', target='trex_console.html', scan=ascii_doc_scan)
 
-#   bld(rule=build_cp_docs,
-#      source='1.txt', target='cp_docs', scan=ascii_doc_scan)
-
-       # generate control plane documentation
-       export_path = os.path.join(os.getcwd(), 'build', 'cp_docs')
-       trex_core_git_path = os.path.join(os.getcwd(), os.pardir, "trex-core")
-       if not os.path.isdir(trex_core_git_path):
-               trex_core_git_path = os.getenv('TREX_CORE_GIT', None)
-       if trex_core_git_path: # there exists a default directory or the desired ENV variable.
-               trex_core_docs_path = os.path.join(trex_core_git_path, 'scripts', 'automation', 'trex_control_plane', 'doc', 'index.rst')
-               bld(rule=build_cp_docs,
-#              source = '1.txt',#trex_core_docs_path,
-                       target = 'cp_docs')
-    #       build_cp_docs(trex_core_git_path, dest_dir= export_path)
-       else:
-               raise NameError("Environment variable 'TREX_CORE_GIT' is not defined.")
-
+        build_cp(bld,'cp_docs','doc',build_cp_docs)
+        build_cp(bld,'cp_stl_docs','doc_stl',build_stl_cp_docs)
 
 class Env(object):
     @staticmethod