Skip to content
Snippets Groups Projects
Verified Commit 2e4d501e authored by Karel Koci's avatar Karel Koci :metal:
Browse files

tests/network: improve common Internet access tests

parent afbbf4bc
Branches
1 merge request!2Initial development
......@@ -5,30 +5,33 @@ These are implementation of tests that are run in environments environments and
import pytest
# pylint: disable=no-self-use
class InternetTests:
"""Tests for checking if connection to Internet is appropriate.
"""
@pytest.mark.parametrize("server", [
"172.16.1.1", # ISP gateway
"217.31.205.50" # nic.cz
"217.31.205.50", # nic.cz
"nic.cz",
"turris.cz",
"google.com"
])
def test_ping(self, board_shell, server):
"""Ping various IPv4 addresses.
We send only one ICMP packet to not flood.
"""
board_shell.run("ping -c 1 '{}'".format(server))
"""Ping various IPv4 servers.
@pytest.mark.parametrize("server", ["nic.cz", "turris.cz", "google.com"])
def test_ping_name(self, board_shell, server):
"""Ping various IPv4 address using DNS record.
We send only one ICMP packet to not flood and to be quickly done with it (the success takes less than second)
"""
board_shell.run("ping -c 1 '{}'".format(server))
@pytest.mark.parametrize("server", ["nic.cz", "turris.cz", "google.com"])
@pytest.mark.parametrize("server", [
"nic.cz",
"turris.cz",
"google.com"
])
def test_dns(self, board_shell, server):
"""Try to resolve verious domain names.
"""
board_shell.run("nslookup '{}'".format(server))
# TODO more excessive DNS testing
# TODO more excessive DNS testing
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment