byteblower-test-cases-rfc-2544 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- byteblower_test_cases_rfc_2544-1.0.0/PKG-INFO +293 -0
- byteblower_test_cases_rfc_2544-1.0.0/README.rst +236 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/.gitignore +2 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/__init__.py +3 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/__main__.py +4 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/_endpoint_factory.py +92 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/_port_factory.py +74 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/_version.py +4 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/cli.py +112 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/definitions.py +102 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/exceptions.py +84 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/report_generator.py +338 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/scouting_flow.py +64 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/config_summary.html +56 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/css/embedded-fonts.css +880 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/css/rfc2544.css +74 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/css/testframework.css +471 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/frame_results.html +95 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/pass_fail.html +39 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/report.html +29 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/report_footer.html +731 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/report_head_style.html +8 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/report_header.html +119 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/report_main.html +10 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/templates/results_summary.html +63 -0
- byteblower_test_cases_rfc_2544-1.0.0/byteblower/test_cases/rfc_2544/throughput.py +704 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/.gitignore +1 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/Makefile +20 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/make.bat +35 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/_include/_example_test_scenario.rst +23 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/_static/.gitkeep +0 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/cli.rst +171 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/conf.py +215 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/config.rst +206 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/extra/test-cases/rfc-2544/json/config-schema.json +254 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/extra/test-cases/rfc-2544/json/endpoint/rfc_2544.json +69 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/extra/test-cases/rfc-2544/json/port/rfc_2544.json +69 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/images/html_report_config.png +0 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/images/html_report_error.png +0 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/images/html_report_frame.png +0 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/images/html_report_sum.png +0 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/images/json_results.png +0 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/images/rfc2544_overview.png +0 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/images/rfc2544_setup.png +0 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/images/simple_rfc2544_overview.png +0 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/index.rst +13 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/master_index.rst +17 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/overview.rst +136 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/quick_start.rst +249 -0
- byteblower_test_cases_rfc_2544-1.0.0/docs/source/results_highlights.rst +231 -0
- byteblower_test_cases_rfc_2544-1.0.0/pyproject.toml +268 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: byteblower-test-cases-rfc-2544
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Perform throughput test based on RFC 2544 using ByteBlower.
|
|
5
|
+
Keywords: ByteBlower,network test,traffic test,test case,throughput,RFC 2544
|
|
6
|
+
Author-email: ByteBlower Development Team <support.byteblower@excentis.com>
|
|
7
|
+
Maintainer-email: Abdennour Rachedi <abdennour.rachedi@excentis.com>, Tom Ghyselinck <tom.ghyselinck@excentis.com>
|
|
8
|
+
Requires-Python: >=3.7
|
|
9
|
+
Description-Content-Type: text/x-rst
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Telecommunications Industry
|
|
13
|
+
Classifier: License :: Other/Proprietary License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Topic :: Software Development
|
|
23
|
+
Classifier: Topic :: Software Development :: Testing
|
|
24
|
+
Classifier: Topic :: Software Development :: Testing :: Acceptance
|
|
25
|
+
Classifier: Topic :: Software Development :: Testing :: Traffic Generation
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
+
Requires-Dist: byteblower-test-framework >=1.1.0
|
|
29
|
+
Requires-Dist: jinja2
|
|
30
|
+
Requires-Dist: yapf[pyproject] ; extra == "dev"
|
|
31
|
+
Requires-Dist: isort ; extra == "dev"
|
|
32
|
+
Requires-Dist: rstcheck[toml] ; extra == "dev"
|
|
33
|
+
Requires-Dist: doc8 ; extra == "dev"
|
|
34
|
+
Requires-Dist: Pygments ; extra == "dev"
|
|
35
|
+
Requires-Dist: pydocstyle[toml] ; extra == "dev"
|
|
36
|
+
Requires-Dist: toml ~=0.10.2 ; extra == "dev"
|
|
37
|
+
Requires-Dist: rstcheck[sphinx,toml] ; extra == "docs-dev"
|
|
38
|
+
Requires-Dist: Sphinx >= 5.0 ; extra == "docs-dev"
|
|
39
|
+
Requires-Dist: sphinx-rtd-theme >=1.0 ; extra == "docs-dev"
|
|
40
|
+
Requires-Dist: sphinx-tabs >= 3.4 ; extra == "docs-dev"
|
|
41
|
+
Requires-Dist: sphinx-jsonschema >= 1.19 ; extra == "docs-dev"
|
|
42
|
+
Requires-Dist: importlib-metadata>=4.8.3 ; extra == "docs-dev" and ( python_version<'3.8')
|
|
43
|
+
Requires-Dist: pylint[spelling] ; extra == "test"
|
|
44
|
+
Requires-Dist: pydocstyle[toml] ; extra == "test"
|
|
45
|
+
Requires-Dist: rstcheck[toml] ; extra == "test"
|
|
46
|
+
Requires-Dist: pytest >=6.0 ; extra == "test"
|
|
47
|
+
Requires-Dist: pytest-cov ; extra == "test"
|
|
48
|
+
Requires-Dist: pytest-pydocstyle ; extra == "test"
|
|
49
|
+
Requires-Dist: toml ~=0.10.2 ; extra == "test"
|
|
50
|
+
Project-URL: Documentation, https://api.byteblower.com/test-framework
|
|
51
|
+
Project-URL: Homepage, https://www.byteblower.com
|
|
52
|
+
Project-URL: Support Portal, https://support.excentis.com
|
|
53
|
+
Provides-Extra: dev
|
|
54
|
+
Provides-Extra: docs-dev
|
|
55
|
+
Provides-Extra: test
|
|
56
|
+
|
|
57
|
+
*****************************************
|
|
58
|
+
ByteBlower Test Case: RFC 2544 Throughput
|
|
59
|
+
*****************************************
|
|
60
|
+
|
|
61
|
+
.. footer::
|
|
62
|
+
Copyright |copy| |year| - Excentis N.V.
|
|
63
|
+
|
|
64
|
+
.. |copy| unicode:: U+00A9 .. copyright sign
|
|
65
|
+
.. |year| date:: %Y
|
|
66
|
+
|
|
67
|
+
Introduction
|
|
68
|
+
============
|
|
69
|
+
|
|
70
|
+
This package contains an implementation of the `RFC 2544`_ Throughput
|
|
71
|
+
Test using the `ByteBlower Test Framework`_.
|
|
72
|
+
|
|
73
|
+
.. _RFC 2544: https://www.ietf.org/rfc/rfc2544.txt
|
|
74
|
+
.. _ByteBlower Test Framework: https://pypi.org/project/byteblower-test-framework/.
|
|
75
|
+
|
|
76
|
+
A throughput test aims to measure, under given circumstances,
|
|
77
|
+
the highest throughput the DUT can handle correctly without exceeding a given
|
|
78
|
+
threshold of frame loss (theoretically, this threshold is 0).
|
|
79
|
+
|
|
80
|
+
This ByteBlower RFC 2544 throughput test case allows you to:
|
|
81
|
+
|
|
82
|
+
#. Run throughput tests based on RFC 2544
|
|
83
|
+
#. Collect & Analyse statistics
|
|
84
|
+
#. Generate HTML & JSON reports
|
|
85
|
+
|
|
86
|
+
For more detailed documentation, please have a look
|
|
87
|
+
at `Test Case: RFC 2544 Throughput`_ in the ByteBlower API documentation.
|
|
88
|
+
|
|
89
|
+
.. _Test Case\: RFC 2544 Throughput: https://api.byteblower.com/test-framework/latest/test-cases/rfc-2544/overview.html
|
|
90
|
+
|
|
91
|
+
Installation
|
|
92
|
+
============
|
|
93
|
+
|
|
94
|
+
Requirements
|
|
95
|
+
------------
|
|
96
|
+
|
|
97
|
+
* `ByteBlower Test Framework`_: ByteBlower |registered| is a traffic
|
|
98
|
+
generator/analyser system for TCP/IP networks.
|
|
99
|
+
* Highcharts-excentis_: Used for generating graphs
|
|
100
|
+
* jinja2_: To create HTML reports
|
|
101
|
+
|
|
102
|
+
.. _Highcharts-excentis: https://pypi.org/project/highcharts-excentis/
|
|
103
|
+
.. |registered| unicode:: U+00AE .. registered sign
|
|
104
|
+
.. _jinja2: https://pypi.org/project/Jinja2/
|
|
105
|
+
|
|
106
|
+
Prepare runtime environment
|
|
107
|
+
---------------------------
|
|
108
|
+
|
|
109
|
+
We recommend managing the runtime environment in a Python virtual
|
|
110
|
+
environment. This guarantees proper separation of the system-wide
|
|
111
|
+
installed Python and pip packages.
|
|
112
|
+
|
|
113
|
+
Python
|
|
114
|
+
------
|
|
115
|
+
|
|
116
|
+
The ByteBlower Test Framework currently supports Python versions
|
|
117
|
+
3.7 up to 3.11.
|
|
118
|
+
|
|
119
|
+
Important: Working directory
|
|
120
|
+
----------------------------
|
|
121
|
+
|
|
122
|
+
All the following sections expect that you first moved to your working
|
|
123
|
+
directory where you want to run this project. You may also want to create
|
|
124
|
+
your configuration files under a sub-directory of your choice.
|
|
125
|
+
|
|
126
|
+
#. On Unix-based systems (Linux, WSL, macOS):
|
|
127
|
+
|
|
128
|
+
.. code-block:: shell
|
|
129
|
+
|
|
130
|
+
cd '/path/to/working/directory'
|
|
131
|
+
|
|
132
|
+
#. On Windows systems using PowerShell:
|
|
133
|
+
|
|
134
|
+
.. code-block:: shell
|
|
135
|
+
|
|
136
|
+
cd 'c:\path\to\working\directory'
|
|
137
|
+
|
|
138
|
+
Python virtual environment
|
|
139
|
+
--------------------------
|
|
140
|
+
|
|
141
|
+
Make sure to use the right Python version (>= 3.7, <= 3.11),
|
|
142
|
+
list all Python versions installed in your machine by running:
|
|
143
|
+
|
|
144
|
+
#. On Windows systems using PowerShell:
|
|
145
|
+
|
|
146
|
+
.. code-block:: shell
|
|
147
|
+
|
|
148
|
+
py --list
|
|
149
|
+
|
|
150
|
+
If no Python version is in the required range, you can download and install
|
|
151
|
+
Python 3.7 or above using your system package manager
|
|
152
|
+
or from https://www.python.org/ftp/python.
|
|
153
|
+
|
|
154
|
+
Prepare Python virtual environment: Create the virtual environment
|
|
155
|
+
and install/update ``pip`` and ``build``.
|
|
156
|
+
|
|
157
|
+
#. On Unix-based systems (Linux, WSL, macOS):
|
|
158
|
+
|
|
159
|
+
**Note**: *Mind the leading* ``.`` *which means* **sourcing**
|
|
160
|
+
``./env/bin/activate``.
|
|
161
|
+
|
|
162
|
+
.. code-block:: shell
|
|
163
|
+
|
|
164
|
+
python3 -m venv --clear env
|
|
165
|
+
. ./env/bin/activate
|
|
166
|
+
pip install -U pip build
|
|
167
|
+
|
|
168
|
+
#. On Windows systems using PowerShell:
|
|
169
|
+
|
|
170
|
+
**Note**: On Microsoft Windows, it may be required to enable the
|
|
171
|
+
Activate.ps1 script by setting the execution policy for the user.
|
|
172
|
+
You can do this by issuing the following PowerShell command:
|
|
173
|
+
|
|
174
|
+
.. code-block:: shell
|
|
175
|
+
|
|
176
|
+
PS C:> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
177
|
+
|
|
178
|
+
See `About Execution Policies`_ for more information.
|
|
179
|
+
|
|
180
|
+
Make sure to specify the python version you're using.
|
|
181
|
+
For example, for Python 3.8:
|
|
182
|
+
|
|
183
|
+
.. code-block:: shell
|
|
184
|
+
|
|
185
|
+
py -3.8 -m venv --clear env
|
|
186
|
+
& ".\env\Scripts\activate.ps1"
|
|
187
|
+
python -m pip install -U pip build
|
|
188
|
+
|
|
189
|
+
.. _About Execution Policies: https://go.microsoft.com/fwlink/?LinkID=135170
|
|
190
|
+
|
|
191
|
+
To install the ByteBlower RFC 2544 throughput test case and its dependencies,
|
|
192
|
+
first make sure that you have activated your virtual environment:
|
|
193
|
+
|
|
194
|
+
#. On Unix-based systems (Linux, WSL, macOS):
|
|
195
|
+
|
|
196
|
+
.. code-block:: shell
|
|
197
|
+
|
|
198
|
+
. ./env/bin/activate
|
|
199
|
+
|
|
200
|
+
#. On Windows systems using PowerShell:
|
|
201
|
+
|
|
202
|
+
.. code-block:: shell
|
|
203
|
+
|
|
204
|
+
./env/Scripts/activate.ps1
|
|
205
|
+
|
|
206
|
+
Then, run:
|
|
207
|
+
|
|
208
|
+
.. code-block:: shell
|
|
209
|
+
|
|
210
|
+
pip install -U byteblower-test-cases-rfc-2544
|
|
211
|
+
|
|
212
|
+
Quick start
|
|
213
|
+
===========
|
|
214
|
+
|
|
215
|
+
Command-line interface
|
|
216
|
+
----------------------
|
|
217
|
+
|
|
218
|
+
After providing the appropriate test setup and frame configurations,
|
|
219
|
+
the test script can be run either as python module or as a command-line script.
|
|
220
|
+
|
|
221
|
+
For example (*to get help for the command-line arguments*):
|
|
222
|
+
|
|
223
|
+
#. As a python module:
|
|
224
|
+
|
|
225
|
+
.. code-block:: shell
|
|
226
|
+
|
|
227
|
+
# To get help for the command-line arguments:
|
|
228
|
+
python -m byteblower.test_case.rfc_2544 --help
|
|
229
|
+
|
|
230
|
+
#. As a command-line script:
|
|
231
|
+
|
|
232
|
+
.. code-block:: shell
|
|
233
|
+
|
|
234
|
+
# To get help for the command-line arguments:
|
|
235
|
+
byteblower-test-cases-rfc-2544-throughput --help
|
|
236
|
+
|
|
237
|
+
For a quick start, you can run a simple test using the JSON configuration of
|
|
238
|
+
one of the example files below:
|
|
239
|
+
|
|
240
|
+
* Using `ByteBlower Ports scenario <https://api.byteblower.com/test-framework/json/test-cases/rfc-2544/port/rfc_2544.json>`_
|
|
241
|
+
* Using `ByteBlower Endpoint scenario <https://api.byteblower.com/test-framework/json/test-cases/rfc-2544/endpoint/rfc_2544.json>`_
|
|
242
|
+
|
|
243
|
+
Save you configuration in your working directory as ``rfc_2544.json``.
|
|
244
|
+
Make sure you change the ``"server"`` and ``"ports"`` configuration
|
|
245
|
+
according to the setup you want to run your test on.
|
|
246
|
+
|
|
247
|
+
More detailed documentation is available in the `Configuration file`_ section
|
|
248
|
+
of the documentation.
|
|
249
|
+
|
|
250
|
+
.. _Configuration file: https://api.byteblower.com/test-framework/latest/test-cases/rfc-2544/config.html
|
|
251
|
+
|
|
252
|
+
The ``rfc_2544.json`` can be used then to run the test in the
|
|
253
|
+
command line interface using the following commands:
|
|
254
|
+
|
|
255
|
+
**Note**: *The reports will be stored under a subdirectory* ``reports/``.
|
|
256
|
+
|
|
257
|
+
#. On Unix-based systems (Linux, WSL, macOS):
|
|
258
|
+
|
|
259
|
+
.. code-block:: shell
|
|
260
|
+
|
|
261
|
+
# Optional: create rfc_2544.json, then copy the configuration to it
|
|
262
|
+
touch rfc_2544.json
|
|
263
|
+
# Create reports folder to store HTML/JSON files
|
|
264
|
+
mkdir reports
|
|
265
|
+
# Run test
|
|
266
|
+
byteblower-test-cases-rfc-2544-throughput --report-path reports
|
|
267
|
+
|
|
268
|
+
#. On Windows systems using PowerShell:
|
|
269
|
+
|
|
270
|
+
.. code-block:: shell
|
|
271
|
+
|
|
272
|
+
# Optional: create rfc_2544.json, then copy the configuration to it
|
|
273
|
+
New-Item rfc_2544.json
|
|
274
|
+
# Create reports folder to store HTML/JSON files
|
|
275
|
+
md reports
|
|
276
|
+
# Run test
|
|
277
|
+
byteblower-test-cases-rfc-2544-throughput --report-path reports
|
|
278
|
+
|
|
279
|
+
Integrated
|
|
280
|
+
----------
|
|
281
|
+
|
|
282
|
+
.. code-block:: python
|
|
283
|
+
|
|
284
|
+
from byteblower.test_case.rfc_2544 import run
|
|
285
|
+
|
|
286
|
+
# Defining test configuration, report path and report file name prefix:
|
|
287
|
+
test_config = {} # Here you should provide your test setup + frame(s') configuration(s)
|
|
288
|
+
report_path = 'my-output-folder' # Optional: provide the path to the output folder, defaults to the current working directory
|
|
289
|
+
report_prefix = 'my-dut-feature-test' # Optional: provide prefix of the output files, defaults to 'report'
|
|
290
|
+
|
|
291
|
+
# Run the RFC 2544 throughput test:
|
|
292
|
+
run(test_config, report_path=report_path, report_prefix=report_prefix)
|
|
293
|
+
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
*****************************************
|
|
2
|
+
ByteBlower Test Case: RFC 2544 Throughput
|
|
3
|
+
*****************************************
|
|
4
|
+
|
|
5
|
+
.. footer::
|
|
6
|
+
Copyright |copy| |year| - Excentis N.V.
|
|
7
|
+
|
|
8
|
+
.. |copy| unicode:: U+00A9 .. copyright sign
|
|
9
|
+
.. |year| date:: %Y
|
|
10
|
+
|
|
11
|
+
Introduction
|
|
12
|
+
============
|
|
13
|
+
|
|
14
|
+
This package contains an implementation of the `RFC 2544`_ Throughput
|
|
15
|
+
Test using the `ByteBlower Test Framework`_.
|
|
16
|
+
|
|
17
|
+
.. _RFC 2544: https://www.ietf.org/rfc/rfc2544.txt
|
|
18
|
+
.. _ByteBlower Test Framework: https://pypi.org/project/byteblower-test-framework/.
|
|
19
|
+
|
|
20
|
+
A throughput test aims to measure, under given circumstances,
|
|
21
|
+
the highest throughput the DUT can handle correctly without exceeding a given
|
|
22
|
+
threshold of frame loss (theoretically, this threshold is 0).
|
|
23
|
+
|
|
24
|
+
This ByteBlower RFC 2544 throughput test case allows you to:
|
|
25
|
+
|
|
26
|
+
#. Run throughput tests based on RFC 2544
|
|
27
|
+
#. Collect & Analyse statistics
|
|
28
|
+
#. Generate HTML & JSON reports
|
|
29
|
+
|
|
30
|
+
For more detailed documentation, please have a look
|
|
31
|
+
at `Test Case: RFC 2544 Throughput`_ in the ByteBlower API documentation.
|
|
32
|
+
|
|
33
|
+
.. _Test Case\: RFC 2544 Throughput: https://api.byteblower.com/test-framework/latest/test-cases/rfc-2544/overview.html
|
|
34
|
+
|
|
35
|
+
Installation
|
|
36
|
+
============
|
|
37
|
+
|
|
38
|
+
Requirements
|
|
39
|
+
------------
|
|
40
|
+
|
|
41
|
+
* `ByteBlower Test Framework`_: ByteBlower |registered| is a traffic
|
|
42
|
+
generator/analyser system for TCP/IP networks.
|
|
43
|
+
* Highcharts-excentis_: Used for generating graphs
|
|
44
|
+
* jinja2_: To create HTML reports
|
|
45
|
+
|
|
46
|
+
.. _Highcharts-excentis: https://pypi.org/project/highcharts-excentis/
|
|
47
|
+
.. |registered| unicode:: U+00AE .. registered sign
|
|
48
|
+
.. _jinja2: https://pypi.org/project/Jinja2/
|
|
49
|
+
|
|
50
|
+
Prepare runtime environment
|
|
51
|
+
---------------------------
|
|
52
|
+
|
|
53
|
+
We recommend managing the runtime environment in a Python virtual
|
|
54
|
+
environment. This guarantees proper separation of the system-wide
|
|
55
|
+
installed Python and pip packages.
|
|
56
|
+
|
|
57
|
+
Python
|
|
58
|
+
------
|
|
59
|
+
|
|
60
|
+
The ByteBlower Test Framework currently supports Python versions
|
|
61
|
+
3.7 up to 3.11.
|
|
62
|
+
|
|
63
|
+
Important: Working directory
|
|
64
|
+
----------------------------
|
|
65
|
+
|
|
66
|
+
All the following sections expect that you first moved to your working
|
|
67
|
+
directory where you want to run this project. You may also want to create
|
|
68
|
+
your configuration files under a sub-directory of your choice.
|
|
69
|
+
|
|
70
|
+
#. On Unix-based systems (Linux, WSL, macOS):
|
|
71
|
+
|
|
72
|
+
.. code-block:: shell
|
|
73
|
+
|
|
74
|
+
cd '/path/to/working/directory'
|
|
75
|
+
|
|
76
|
+
#. On Windows systems using PowerShell:
|
|
77
|
+
|
|
78
|
+
.. code-block:: shell
|
|
79
|
+
|
|
80
|
+
cd 'c:\path\to\working\directory'
|
|
81
|
+
|
|
82
|
+
Python virtual environment
|
|
83
|
+
--------------------------
|
|
84
|
+
|
|
85
|
+
Make sure to use the right Python version (>= 3.7, <= 3.11),
|
|
86
|
+
list all Python versions installed in your machine by running:
|
|
87
|
+
|
|
88
|
+
#. On Windows systems using PowerShell:
|
|
89
|
+
|
|
90
|
+
.. code-block:: shell
|
|
91
|
+
|
|
92
|
+
py --list
|
|
93
|
+
|
|
94
|
+
If no Python version is in the required range, you can download and install
|
|
95
|
+
Python 3.7 or above using your system package manager
|
|
96
|
+
or from https://www.python.org/ftp/python.
|
|
97
|
+
|
|
98
|
+
Prepare Python virtual environment: Create the virtual environment
|
|
99
|
+
and install/update ``pip`` and ``build``.
|
|
100
|
+
|
|
101
|
+
#. On Unix-based systems (Linux, WSL, macOS):
|
|
102
|
+
|
|
103
|
+
**Note**: *Mind the leading* ``.`` *which means* **sourcing**
|
|
104
|
+
``./env/bin/activate``.
|
|
105
|
+
|
|
106
|
+
.. code-block:: shell
|
|
107
|
+
|
|
108
|
+
python3 -m venv --clear env
|
|
109
|
+
. ./env/bin/activate
|
|
110
|
+
pip install -U pip build
|
|
111
|
+
|
|
112
|
+
#. On Windows systems using PowerShell:
|
|
113
|
+
|
|
114
|
+
**Note**: On Microsoft Windows, it may be required to enable the
|
|
115
|
+
Activate.ps1 script by setting the execution policy for the user.
|
|
116
|
+
You can do this by issuing the following PowerShell command:
|
|
117
|
+
|
|
118
|
+
.. code-block:: shell
|
|
119
|
+
|
|
120
|
+
PS C:> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
121
|
+
|
|
122
|
+
See `About Execution Policies`_ for more information.
|
|
123
|
+
|
|
124
|
+
Make sure to specify the python version you're using.
|
|
125
|
+
For example, for Python 3.8:
|
|
126
|
+
|
|
127
|
+
.. code-block:: shell
|
|
128
|
+
|
|
129
|
+
py -3.8 -m venv --clear env
|
|
130
|
+
& ".\env\Scripts\activate.ps1"
|
|
131
|
+
python -m pip install -U pip build
|
|
132
|
+
|
|
133
|
+
.. _About Execution Policies: https://go.microsoft.com/fwlink/?LinkID=135170
|
|
134
|
+
|
|
135
|
+
To install the ByteBlower RFC 2544 throughput test case and its dependencies,
|
|
136
|
+
first make sure that you have activated your virtual environment:
|
|
137
|
+
|
|
138
|
+
#. On Unix-based systems (Linux, WSL, macOS):
|
|
139
|
+
|
|
140
|
+
.. code-block:: shell
|
|
141
|
+
|
|
142
|
+
. ./env/bin/activate
|
|
143
|
+
|
|
144
|
+
#. On Windows systems using PowerShell:
|
|
145
|
+
|
|
146
|
+
.. code-block:: shell
|
|
147
|
+
|
|
148
|
+
./env/Scripts/activate.ps1
|
|
149
|
+
|
|
150
|
+
Then, run:
|
|
151
|
+
|
|
152
|
+
.. code-block:: shell
|
|
153
|
+
|
|
154
|
+
pip install -U byteblower-test-cases-rfc-2544
|
|
155
|
+
|
|
156
|
+
Quick start
|
|
157
|
+
===========
|
|
158
|
+
|
|
159
|
+
Command-line interface
|
|
160
|
+
----------------------
|
|
161
|
+
|
|
162
|
+
After providing the appropriate test setup and frame configurations,
|
|
163
|
+
the test script can be run either as python module or as a command-line script.
|
|
164
|
+
|
|
165
|
+
For example (*to get help for the command-line arguments*):
|
|
166
|
+
|
|
167
|
+
#. As a python module:
|
|
168
|
+
|
|
169
|
+
.. code-block:: shell
|
|
170
|
+
|
|
171
|
+
# To get help for the command-line arguments:
|
|
172
|
+
python -m byteblower.test_case.rfc_2544 --help
|
|
173
|
+
|
|
174
|
+
#. As a command-line script:
|
|
175
|
+
|
|
176
|
+
.. code-block:: shell
|
|
177
|
+
|
|
178
|
+
# To get help for the command-line arguments:
|
|
179
|
+
byteblower-test-cases-rfc-2544-throughput --help
|
|
180
|
+
|
|
181
|
+
For a quick start, you can run a simple test using the JSON configuration of
|
|
182
|
+
one of the example files below:
|
|
183
|
+
|
|
184
|
+
* Using `ByteBlower Ports scenario <https://api.byteblower.com/test-framework/json/test-cases/rfc-2544/port/rfc_2544.json>`_
|
|
185
|
+
* Using `ByteBlower Endpoint scenario <https://api.byteblower.com/test-framework/json/test-cases/rfc-2544/endpoint/rfc_2544.json>`_
|
|
186
|
+
|
|
187
|
+
Save you configuration in your working directory as ``rfc_2544.json``.
|
|
188
|
+
Make sure you change the ``"server"`` and ``"ports"`` configuration
|
|
189
|
+
according to the setup you want to run your test on.
|
|
190
|
+
|
|
191
|
+
More detailed documentation is available in the `Configuration file`_ section
|
|
192
|
+
of the documentation.
|
|
193
|
+
|
|
194
|
+
.. _Configuration file: https://api.byteblower.com/test-framework/latest/test-cases/rfc-2544/config.html
|
|
195
|
+
|
|
196
|
+
The ``rfc_2544.json`` can be used then to run the test in the
|
|
197
|
+
command line interface using the following commands:
|
|
198
|
+
|
|
199
|
+
**Note**: *The reports will be stored under a subdirectory* ``reports/``.
|
|
200
|
+
|
|
201
|
+
#. On Unix-based systems (Linux, WSL, macOS):
|
|
202
|
+
|
|
203
|
+
.. code-block:: shell
|
|
204
|
+
|
|
205
|
+
# Optional: create rfc_2544.json, then copy the configuration to it
|
|
206
|
+
touch rfc_2544.json
|
|
207
|
+
# Create reports folder to store HTML/JSON files
|
|
208
|
+
mkdir reports
|
|
209
|
+
# Run test
|
|
210
|
+
byteblower-test-cases-rfc-2544-throughput --report-path reports
|
|
211
|
+
|
|
212
|
+
#. On Windows systems using PowerShell:
|
|
213
|
+
|
|
214
|
+
.. code-block:: shell
|
|
215
|
+
|
|
216
|
+
# Optional: create rfc_2544.json, then copy the configuration to it
|
|
217
|
+
New-Item rfc_2544.json
|
|
218
|
+
# Create reports folder to store HTML/JSON files
|
|
219
|
+
md reports
|
|
220
|
+
# Run test
|
|
221
|
+
byteblower-test-cases-rfc-2544-throughput --report-path reports
|
|
222
|
+
|
|
223
|
+
Integrated
|
|
224
|
+
----------
|
|
225
|
+
|
|
226
|
+
.. code-block:: python
|
|
227
|
+
|
|
228
|
+
from byteblower.test_case.rfc_2544 import run
|
|
229
|
+
|
|
230
|
+
# Defining test configuration, report path and report file name prefix:
|
|
231
|
+
test_config = {} # Here you should provide your test setup + frame(s') configuration(s)
|
|
232
|
+
report_path = 'my-output-folder' # Optional: provide the path to the output folder, defaults to the current working directory
|
|
233
|
+
report_prefix = 'my-dut-feature-test' # Optional: provide prefix of the output files, defaults to 'report'
|
|
234
|
+
|
|
235
|
+
# Run the RFC 2544 throughput test:
|
|
236
|
+
run(test_config, report_path=report_path, report_prefix=report_prefix)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Factory functions to create and initialize :class:`~Endpoint` instances.
|
|
3
|
+
|
|
4
|
+
.. versionchanged:: 1.0.0
|
|
5
|
+
Add support for ByteBlower Endpoint.
|
|
6
|
+
"""
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
from byteblower_test_framework.endpoint import Endpoint # for type hinting
|
|
10
|
+
from byteblower_test_framework.endpoint import IPv4Endpoint, IPv6Endpoint
|
|
11
|
+
from byteblower_test_framework.exceptions import InvalidInput
|
|
12
|
+
from byteblower_test_framework.host import MeetingPoint # for type hinting
|
|
13
|
+
|
|
14
|
+
from .definitions import LOGGING_PREFIX as _LOGGING_PREFIX
|
|
15
|
+
from .definitions import PortConfig # for type hinting
|
|
16
|
+
|
|
17
|
+
__all__ = ('initialize_endpoint', )
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class EndpointFactory(object): # pylint: disable=too-few-public-methods
|
|
21
|
+
"""
|
|
22
|
+
Factory for :class:`Endpoint` objects.
|
|
23
|
+
|
|
24
|
+
.. versionchanged:: 1.0.0
|
|
25
|
+
Add support for ByteBlower Endpoint.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
@staticmethod
|
|
29
|
+
def build_endpoint(meeting_point: MeetingPoint, **port_config) -> Endpoint:
|
|
30
|
+
"""Create a :class:`Endpoint`.
|
|
31
|
+
|
|
32
|
+
The function can create either :class:`IPv4Endpoint`
|
|
33
|
+
or :class:`IPv6Endpoint` objects.
|
|
34
|
+
|
|
35
|
+
:param meeting_point: The :class:`MeetingPoint` object to create
|
|
36
|
+
the port on
|
|
37
|
+
:type meeting_point: MeetingPoint
|
|
38
|
+
:param port_config: The configuration for the port.
|
|
39
|
+
:type port_config: PortConfig
|
|
40
|
+
:return: The newly created endpoint
|
|
41
|
+
:rtype: Endpoint
|
|
42
|
+
"""
|
|
43
|
+
ipv4 = port_config.pop('ipv4', False)
|
|
44
|
+
ipv6 = port_config.pop('ipv6', False)
|
|
45
|
+
if ipv4 and ipv6:
|
|
46
|
+
raise InvalidInput(
|
|
47
|
+
'Please provide either IPv4 or IPv6 configuration,'
|
|
48
|
+
' but not both.'
|
|
49
|
+
)
|
|
50
|
+
if ipv4:
|
|
51
|
+
endpoint_class = IPv4Endpoint
|
|
52
|
+
elif ipv6:
|
|
53
|
+
endpoint_class = IPv6Endpoint
|
|
54
|
+
else:
|
|
55
|
+
raise InvalidInput(
|
|
56
|
+
'Please provide either IPv4 or IPv6 configuration'
|
|
57
|
+
)
|
|
58
|
+
endpoint = endpoint_class(meeting_point, **port_config)
|
|
59
|
+
return endpoint
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def initialize_endpoint(
|
|
63
|
+
meeting_point: MeetingPoint,
|
|
64
|
+
port_config: PortConfig,
|
|
65
|
+
) -> Endpoint:
|
|
66
|
+
"""Create a :class:`Endpoint`.
|
|
67
|
+
|
|
68
|
+
The function can create either :class:`IPv4Endpoint`
|
|
69
|
+
or :class:`IPv6Endpoint` objects.
|
|
70
|
+
|
|
71
|
+
:param meeting_point: The :class:`MeetingPoint` object to get
|
|
72
|
+
the endpoint on
|
|
73
|
+
:type meeting_point: MeetingPoint
|
|
74
|
+
:param port_config: The configuration for the endpoint.
|
|
75
|
+
:type port_config: PortConfig
|
|
76
|
+
:return: The newly created Endpoint
|
|
77
|
+
:rtype: Endpoint
|
|
78
|
+
|
|
79
|
+
.. versionchanged:: 1.0.0
|
|
80
|
+
Add support for ByteBlower Endpoint.
|
|
81
|
+
"""
|
|
82
|
+
logging.info('%sInitializing endpoint', _LOGGING_PREFIX)
|
|
83
|
+
endpoint: Endpoint = EndpointFactory.build_endpoint(
|
|
84
|
+
meeting_point, **port_config
|
|
85
|
+
)
|
|
86
|
+
logging.info(
|
|
87
|
+
'%sInitialized endpoint %r'
|
|
88
|
+
' with IP address %r, UUID %r', _LOGGING_PREFIX, endpoint.name,
|
|
89
|
+
endpoint.ip, endpoint.uuid
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return endpoint
|