snappi-1.9.1
1.9.1
1.9.0
1.8.0
1.7.2
1.7.1
1.7.0
1.6.2
1.6.1
1.5.1
1.5.0
1.46.0
1.45.1
1.45.0
1.44.0
1.43.0
1.42.2
1.42.1
1.42.0
1.41.0
1.40.3
1.40.2
1.40.1
1.40.0
1.4.0
1.39.0
1.38.0
1.37.0
1.36.0
1.35.0
1.34.1
1.34.0
1.33.4
1.33.3
1.33.2
1.33.1
1.33.0
1.32.0
1.31.1
1.31.0
1.30.1
1.30.0
1.3.0
1.29.0
1.28.2
1.28.1
1.28.0
1.27.1
1.27.0
1.26.1
1.26.0
1.25.2
1.25.1
1.25.0
1.24.1
1.24.0
1.23.0
1.22.0
1.21.1
1.21.0
1.20.1
1.20.0
1.2.0
1.19.1
1.19.0
1.18.0
1.17.1
1.17.0
1.16.0
1.15.0
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11.0
1.10.0
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0
0.9.8
0.9.7
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.7.9
0.7.8
0.7.7
0.7.6
0.7.5
0.7.45
0.7.44
0.7.43
0.7.42
0.7.41
0.7.40
0.7.4
0.7.39
0.7.38
0.7.37
0.7.36
0.7.35
0.7.34
0.7.33
0.7.31
0.7.3
0.7.29
0.7.28
0.7.26
0.7.25
0.7.24
0.7.23
0.7.22
0.7.21
0.7.20
0.7.2
0.7.19
0.7.18
0.7.17
0.7.16
0.7.15
0.7.14
0.7.13
0.7.12
0.7.11
0.7.10
0.7.1
0.6.9
0.6.8
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.21
0.6.20
0.6.2
0.6.19
0.6.18
0.6.17
0.6.16
0.6.15
0.6.14
0.6.13
0.6.12
0.6.11
0.6.10
0.6.1
0.5.9
0.5.8
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.14
0.5.13
0.5.12
0.5.11
0.5.10
0.5.1
0.4.9
0.4.7
0.4.5
0.4.4
0.4.38
0.4.37
0.4.36
0.4.35
0.4.34
0.4.33
0.4.32
0.4.31
0.4.30
0.4.3
0.4.29
0.4.28
0.4.27
0.4.26
0.4.25
0.4.24
0.4.23
0.4.22
0.4.21
0.4.20
0.4.2
0.4.19
0.4.18
0.4.17
0.4.16
0.4.15
0.4.14
0.4.13
0.4.12
0.4.11
0.4.10
0.4.1
0.4.0
0.3.9
0.3.8
0.3.7
0.3.6
0.3.4
0.3.3
0.3.22
0.3.21
0.3.20
0.3.19
0.3.18
0.3.17
0.3.16
0.3.15
0.3.14
0.3.13
0.3.12
0.3.11
0.3.1
0.13.7
0.13.6
0.13.5
0.13.4
0.13.3
0.13.2
0.13.1
0.13.0
0.12.6
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.11.8
0.11.7
0.11.6
0.11.5
0.11.4
0.11.3
0.11.2
0.11.17
0.11.16
0.11.15
0.11.14
0.11.13
0.11.12
0.11.11
0.11.1
0.10.9
0.10.8
0.10.7
0.10.6
0.10.5
0.10.4
0.10.3
0.10.2
0.10.11
0.10.10
0.10.1
0.1.9
0.1.7
0.1.6
0.1.5
0.1.46
0.1.45
0.1.44
0.1.43
0.1.42
0.1.41
0.1.40
0.1.4
0.1.39
0.1.38
0.1.37
0.1.36
0.1.35
0.1.34
0.1.32
0.1.31
0.1.30
0.1.3
0.1.29
0.1.28
0.1.27
0.1.26
0.1.25
0.1.24
0.1.23
0.1.22
0.1.21
0.1.20
0.1.2
0.1.19
0.1.18
0.1.16
0.1.15
0.1.14
0.1.13
0.1.12
0.1.11
0.1.1
0.0.5
0.0.1
1.9.1
1.9.0
1.8.0
1.7.2
1.7.1
1.7.0
1.6.2
1.6.1
1.5.1
1.5.0
1.46.0
1.45.1
1.45.0
1.44.0
1.43.0
1.42.2
1.42.1
1.42.0
1.41.0
1.40.3
1.40.2
1.40.1
1.40.0
1.4.0
1.39.0
1.38.0
1.37.0
1.36.0
1.35.0
1.34.1
1.34.0
1.33.4
1.33.3
1.33.2
1.33.1
1.33.0
1.32.0
1.31.1
1.31.0
1.30.1
1.30.0
1.3.0
1.29.0
1.28.2
1.28.1
1.28.0
1.27.1
1.27.0
1.26.1
1.26.0
1.25.2
1.25.1
1.25.0
1.24.1
1.24.0
1.23.0
1.22.0
1.21.1
1.21.0
1.20.1
1.20.0
1.2.0
1.19.1
1.19.0
1.18.0
1.17.1
1.17.0
1.16.0
1.15.0
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11.0
1.10.0
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0
0.9.8
0.9.7
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.7.9
0.7.8
0.7.7
0.7.6
0.7.5
0.7.45
0.7.44
0.7.43
0.7.42
0.7.41
0.7.40
0.7.4
0.7.39
0.7.38
0.7.37
0.7.36
0.7.35
0.7.34
0.7.33
0.7.31
0.7.3
0.7.29
0.7.28
0.7.26
0.7.25
0.7.24
0.7.23
0.7.22
0.7.21
0.7.20
0.7.2
0.7.19
0.7.18
0.7.17
0.7.16
0.7.15
0.7.14
0.7.13
0.7.12
0.7.11
0.7.10
0.7.1
0.6.9
0.6.8
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.21
0.6.20
0.6.2
0.6.19
0.6.18
0.6.17
0.6.16
0.6.15
0.6.14
0.6.13
0.6.12
0.6.11
0.6.10
0.6.1
0.5.9
0.5.8
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.14
0.5.13
0.5.12
0.5.11
0.5.10
0.5.1
0.4.9
0.4.7
0.4.5
0.4.4
0.4.38
0.4.37
0.4.36
0.4.35
0.4.34
0.4.33
0.4.32
0.4.31
0.4.30
0.4.3
0.4.29
0.4.28
0.4.27
0.4.26
0.4.25
0.4.24
0.4.23
0.4.22
0.4.21
0.4.20
0.4.2
0.4.19
0.4.18
0.4.17
0.4.16
0.4.15
0.4.14
0.4.13
0.4.12
0.4.11
0.4.10
0.4.1
0.4.0
0.3.9
0.3.8
0.3.7
0.3.6
0.3.4
0.3.3
0.3.22
0.3.21
0.3.20
0.3.19
0.3.18
0.3.17
0.3.16
0.3.15
0.3.14
0.3.13
0.3.12
0.3.11
0.3.1
0.13.7
0.13.6
0.13.5
0.13.4
0.13.3
0.13.2
0.13.1
0.13.0
0.12.6
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.11.8
0.11.7
0.11.6
0.11.5
0.11.4
0.11.3
0.11.2
0.11.17
0.11.16
0.11.15
0.11.14
0.11.13
0.11.12
0.11.11
0.11.1
0.10.9
0.10.8
0.10.7
0.10.6
0.10.5
0.10.4
0.10.3
0.10.2
0.10.11
0.10.10
0.10.1
0.1.9
0.1.7
0.1.6
0.1.5
0.1.46
0.1.45
0.1.44
0.1.43
0.1.42
0.1.41
0.1.40
0.1.4
0.1.39
0.1.38
0.1.37
0.1.36
0.1.35
0.1.34
0.1.32
0.1.31
0.1.30
0.1.3
0.1.29
0.1.28
0.1.27
0.1.26
0.1.25
0.1.24
0.1.23
0.1.22
0.1.21
0.1.20
0.1.2
0.1.19
0.1.18
0.1.16
0.1.15
0.1.14
0.1.13
0.1.12
0.1.11
0.1.1
0.0.5
0.0.1
توضیحات
The Snappi Open Traffic Generator Python Package
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | snappi-1.9.1 |
| نام | snappi |
| نسخه کتابخانه | 1.9.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Keysight Technologies <andy.balogh@keysight.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/snappi/ |
| مجوز | - |
# 
[](https://en.wikipedia.org/wiki/MIT_License)
[](https://www.repostatus.org/#active)
[](https://github.com/open-traffic-generator/snappi/actions)
[](https://lgtm.com/projects/g/open-traffic-generator/snappi/alerts/)
[](https://lgtm.com/projects/g/open-traffic-generator/snappi/context:python)
[](https://pypi.org/project/snappi)
[](https://pypi.python.org/pypi/snappi)
Test scripts written in `snappi`, an auto-generated python SDK, can be executed against any traffic generator conforming to [Open Traffic Generator API](https://github.com/open-traffic-generator/models).
[Ixia-c](https://github.com/open-traffic-generator/ixia-c) is one such reference implementation of Open Traffic Generator API.
> The repository is under active development and is subject to updates. All efforts will be made to keep the updates backwards compatible.
## Setup Client
```sh
python -m pip install --upgrade snappi
```
## Start Testing
```python
import datetime
import time
import snappi
import pytest
@pytest.mark.example
def test_quickstart():
# Create a new API handle to make API calls against OTG
# with HTTP as default transport protocol
api = snappi.api(location="https://localhost:8443")
# Create a new traffic configuration that will be set on OTG
config = api.config()
# Add a test port to the configuration
ptx = config.ports.add(name="ptx", location="veth-a")
# Configure a flow and set previously created test port as one of endpoints
flow = config.flows.add(name="flow")
flow.tx_rx.port.tx_name = ptx.name
# and enable tracking flow metrics
flow.metrics.enable = True
# Configure number of packets to transmit for previously configured flow
flow.duration.fixed_packets.packets = 100
# and fixed byte size of all packets in the flow
flow.size.fixed = 128
# Configure protocol headers for all packets in the flow
eth, ip, udp, cus = flow.packet.ethernet().ipv4().udp().custom()
eth.src.value = "00:11:22:33:44:55"
eth.dst.value = "00:11:22:33:44:66"
ip.src.value = "10.1.1.1"
ip.dst.value = "20.1.1.1"
# Configure repeating patterns for source and destination UDP ports
udp.src_port.values = [5010, 5015, 5020, 5025, 5030]
udp.dst_port.increment.start = 6010
udp.dst_port.increment.step = 5
udp.dst_port.increment.count = 5
# Configure custom bytes (hex string) in payload
cus.bytes = "".join([hex(c)[2:] for c in b"..QUICKSTART SNAPPI.."])
# Optionally, print JSON representation of config
print("Configuration: ", config.serialize(encoding=config.JSON))
# Push traffic configuration constructed so far to OTG
api.set_config(config)
# Start transmitting the packets from configured flow
ts = api.transmit_state()
ts.state = ts.START
api.set_transmit_state(ts)
# Fetch metrics for configured flow
req = api.metrics_request()
req.flow.flow_names = [flow.name]
# and keep polling until either expectation is met or deadline exceeds
start = datetime.datetime.now()
while True:
metrics = api.get_metrics(req)
if (datetime.datetime.now() - start).seconds > 10:
raise Exception("deadline exceeded")
# print YAML representation of flow metrics
print(metrics)
if metrics.flow_metrics[0].transmit == metrics.flow_metrics[0].STOPPED:
break
time.sleep(0.1)
```
نیازمندی
| مقدار | نام |
|---|---|
| - | protobuf~=5.29.5 |
| - | PyYAML |
| - | grpcio-tools~=1.70.0 |
| - | grpcio~=1.70.0 |
| - | requests |
| - | urllib3 |
| - | semantic_version |
| xtr | snappi_ixnetwork==1.42.1; |
| xtr | snappi_trex; |
| xtr | pytest; |
| xtr | flask; |
| ython_versio | opentelemetry-api==1.17.0; |
| ython_versio | opentelemetry-sdk; |
| ython_versio | opentelemetry-exporter-otlp-proto-http; |
| ython_versio | opentelemetry-exporter-otlp-proto-grpc; |
| ython_versio | opentelemetry-instrumentation-grpc; |
| ython_versio | opentelemetry-instrumentation-requests; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| <4,>=3.8 | Python |
نحوه نصب
نصب پکیج whl snappi-1.9.1:
pip install snappi-1.9.1.whl
نصب پکیج tar.gz snappi-1.9.1:
pip install snappi-1.9.1.tar.gz