diff --git a/HISTORY.rst b/HISTORY.rst index 9a1624c..a6caeda 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,10 @@ Release History --------------- +0.1.10 (2018-03-28) ++++++++++++++++++++ +- Allow manual set of libiperf library path and name using lib_name kwarg on Iperf3 Class + 0.1.9 (2018-02-22) ++++++++++++++++++ - Use find_library to load libiperf (Thanks to @Austinpayne). This should allow iperf3 lib to run on Mac OS X. diff --git a/docs/source/conf.py b/docs/source/conf.py index d9b0550..746d767 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -66,9 +66,9 @@ # built documents. # # The short X.Y version. -version = '0.1.9' +version = '0.1.10' # The full version, including alpha/beta/rc tags. -release = '0.1.9' +release = '0.1.10' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/iperf3/iperf3.py b/iperf3/iperf3.py index 518b368..7aceed1 100755 --- a/iperf3/iperf3.py +++ b/iperf3/iperf3.py @@ -31,7 +31,7 @@ class provides common settings for the :class:`Client` and :class:`Server` from Queue import Queue # Python2 compatibility -__version__ = '0.1.9' +__version__ = '0.1.10' MAX_UDP_BULKSIZE = (65535 - 8 - 20) @@ -88,15 +88,19 @@ class IPerf3(object): """ def __init__(self, role, - verbose=True): + verbose=True, + lib_name=None): """Initialise the iperf shared library :param role: 'c' = client; 's' = server :param verbose: enable verbose output + :param lib_name: optional name and path for libiperf.so.0 library """ - lib_name = util.find_library('libiperf') if lib_name is None: - lib_name = 'libiperf.so.0' + lib_name = util.find_library('libiperf') + if lib_name is None: + # If we still couldn't find it lets try the manual approach + lib_name = 'libiperf.so.0' try: self.lib = cdll.LoadLibrary(lib_name) diff --git a/tests/test_iperf3.py b/tests/test_iperf3.py index 2bd3c89..5c4ff65 100644 --- a/tests/test_iperf3.py +++ b/tests/test_iperf3.py @@ -17,6 +17,10 @@ def test_init_server(self): server = iperf3.Server() assert server._test + def test_lib_name(self): + client = iperf3.Client(lib_name='libiperf.so.0') + assert client._test + def test_run_not_implemented(self): with pytest.raises(NotImplementedError): client = iperf3.IPerf3(role='c')