diff --git a/examples/protocols/icmp_echo/example_test.py b/examples/protocols/icmp_echo/example_test.py index dcc19827ba..717153c256 100644 --- a/examples/protocols/icmp_echo/example_test.py +++ b/examples/protocols/icmp_echo/example_test.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import re import ttfw_idf +import os @ttfw_idf.idf_example_test(env_tag='Example_WIFI') @@ -11,7 +12,10 @@ def test_examples_icmp_echo(env, extra_data): dut.expect('example_connect: Connected to') dut.expect('esp>') - dut.write('ping www.espressif.com') + + ping_dest = os.getenv('EXAMPLE_ICMP_SERVER', 'www.espressif.com') + dut.write('ping {}'.format(ping_dest)) + ip_re = r'\.'.join((r'\d{1,3}',) * 4) ip = dut.expect(re.compile(r'64 bytes from ({}) icmp_seq=1 ttl=\d+ time=\d+ ms'.format(ip_re)))[0]