From 24ac472c3694e2b64b1383265930c3f1dc36fdf8 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Wed, 8 Feb 2017 10:28:48 +0200 Subject: STL example of using IPv6 in automation Change-Id: I976f38f491e5310ae708ff482f8cdf33df3c92d4 Signed-off-by: Yaroslav Brustinov --- .../stl/examples/stl_ipv6_tools.py | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 scripts/automation/trex_control_plane/stl/examples/stl_ipv6_tools.py (limited to 'scripts/automation/trex_control_plane') diff --git a/scripts/automation/trex_control_plane/stl/examples/stl_ipv6_tools.py b/scripts/automation/trex_control_plane/stl/examples/stl_ipv6_tools.py new file mode 100644 index 00000000..6a652795 --- /dev/null +++ b/scripts/automation/trex_control_plane/stl/examples/stl_ipv6_tools.py @@ -0,0 +1,30 @@ +#!/usr/bin/python +import stl_path +from trex_stl_lib.api import * +import sys + +''' +Simple script that demonstrates: +1) Automatic discovery of IPv6 nodes +2) Ping first node in the list +''' + +c = STLClient(verbose_level = LoggerApi.VERBOSE_REGULAR_SYNC) +c.connect() +c.reset() +c.set_service_mode() + +results = c.scan6(ports = [0], timeout = 2, verbose = True)[0] + +if not results: + print('No devices found.') + sys.exit(0) + +# Setting default destination to MAC of first result and ping it + +c.set_l2_mode(port = 0, dst_mac = results[0]['mac']) + +c.ping_ip(src_port = 0, dst_ip = results[0]['ipv6']) + + +print('\nDone.\n') \ No newline at end of file -- cgit 1.2.3-korg