From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

Added iperf 3 app

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
diff --git a/iperf3/Makefile b/iperf3/Makefile
--- a/iperf3/Makefile
+++ b/iperf3/Makefile
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2014 Cloudius Systems, Ltd.
+#
+# This work is open source software, licensed under the terms of the
+# BSD license as described in the LICENSE file in the top-level directory.
+#
+
+iperfv = iperf-3.6
+tarball = $(iperfv).tar.gz
+url = https://downloads.es.net/pub/iperf/$(tarball)
+
+module: iperf3
+
+iperf3: $(iperfv)/src/.libs/iperf3
+       cp $^ $@
+       cp $(iperfv)/src/.libs/libiperf.so.0.0.0 libiperf.so.0
+
+$(iperfv)/src/.libs/iperf3: $(tarball)
+       tar xzf $^
+ cd $(iperfv) && CFLAGS='-fPIC -g' CXXFLAGS='-fPIC -g' ./configure --with-openssl=no
+       +$(MAKE) -C $(iperfv)
+
+$(tarball):
+       wget -c -O $@ $(url)
+
+clean:
+       rm -rf $(tarball) $(iperfv) iperf3 libiperf.so.0
diff --git a/iperf3/README b/iperf3/README
--- a/iperf3/README
+++ b/iperf3/README
@@ -0,0 +1,4 @@
+This is a newer version of iperf version 3.
+
+Please note that this app does not work with ROFS until
+the issue https://github.com/cloudius-systems/osv/issues/1035 is fixed.
diff --git a/iperf3/jenkins/iperf-xml.py b/iperf3/jenkins/iperf-xml.py
--- a/iperf3/jenkins/iperf-xml.py
+++ b/iperf3/jenkins/iperf-xml.py
@@ -0,0 +1,51 @@
+#!/usr/bin/python3
+
+import xml.etree.ElementTree as ET
+from optparse import OptionParser
+import sys
+import datetime
+
+op = OptionParser()
+op.add_option('-o', '--output', metavar = 'FILE',
+              help = 'write output to FILE')
+op.add_option('-m', '--metric', metavar='NAME',
+              help = 'name metric as NAME')
+
+options, args = op.parse_args()
+
+def iter_results(lines):
+    i = iter(lines)
+    while True:
+        line = next(i)
+        if line.startswith('[ ID]'):
+            line = next(i)
+            print('processing {}\n'.format(line))
+            yield line[5:].split()[4]
+
+with open(args[0]) as f:
+    results = list(iter_results(f))
+    if not results:
+        print('No results found')
+        sys.exit(1)
+    result = results[0]
+
+def add_time(parent, name):
+    e = ET.SubElement(parent, name)
+    t = datetime.datetime.utcnow()
+ ET.SubElement(e, 'date', val = t.date().isoformat(), format = 'ISO8601') + ET.SubElement(e, 'time', val = t.time().isoformat(), format = 'ISO8601')
+
+report = ET.Element('report', categ = 'iperf')
+add_time(report, 'start')
+test = ET.SubElement(report, 'test', name = 'iperf-tcp-4cpu-1s-stream', executed = 'yes') +ET.SubElement(test, 'description').text = 'iperf single stream bandwidth to 4 cpu guest'
+res = ET.SubElement(test, 'result')
+ET.SubElement(res, 'success', passed = 'yes', state = '1', hasTimeOut = 'no') +ET.SubElement(res, 'performance', unit = 'Mbps', mesure = result, isRelevant = 'true')
+add_time(report, 'end')
+
+w = sys.stdout
+if options.output:
+    w = open(options.output, 'w')
+
+w.write(str(ET.tostring(report), 'UTF8'))
\ No newline at end of file
diff --git a/iperf3/module.py b/iperf3/module.py
--- a/iperf3/module.py
+++ b/iperf3/module.py
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2014 Cloudius Systems, Ltd.
+#
+# This work is open source software, licensed under the terms of the
+# BSD license as described in the LICENSE file in the top-level directory.
+#
+
+from osv.modules import api
+
+#api.require('openssl')
+
+default = api.run('/tools/iperf3 -s')
diff --git a/iperf3/usr.manifest b/iperf3/usr.manifest
--- a/iperf3/usr.manifest
+++ b/iperf3/usr.manifest
@@ -0,0 +1,2 @@
+/tools/iperf3: ${MODULE_DIR}/iperf3
+/usr/lib/libiperf.so.0: ${MODULE_DIR}/libiperf.so.0

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to