Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joatmon08/4e7bfa053d89ae429c5ae41696a1bf14 to your computer and use it in GitHub Desktop.
Save joatmon08/4e7bfa053d89ae429c5ae41696a1bf14 to your computer and use it in GitHub Desktop.
Behind the Talk, Part 2: Smoke Test Snippet
def run(host1_client, host2_client, network_name, cidr_block):
ip_addresses = _get_ip_addresses(cidr_block, 5, 2)
container1 = TestContainer(host1_client, ip_addresses[0], network_name)
container2 = TestContainer(host2_client, ip_addresses[1], network_name)
time.sleep(5)
output1 = container1.ping(container2.ip_address)
output2 = container2.ping(container1.ip_address)
container1.destroy()
container2.destroy()
assert _lost_packets(output1) is False, 'Container on host1 cannot reach container on host2'
assert _lost_packets(output2) is False, 'Container on host2 cannot reach container on host1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment