summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/drivers/net/ping.py
blob: 9f65a0764aab3dfc66385ab966da8471037fe111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0

from lib.py import ksft_run, ksft_exit
from lib.py import NetDrvEpEnv
from lib.py import cmd


def test_v4(cfg) -> None:
    cmd(f"ping -c 1 -W0.5 {cfg.remote_v4}")
    cmd(f"ping -c 1 -W0.5 {cfg.v4}", host=cfg.remote)


def test_v6(cfg) -> None:
    cmd(f"ping -c 1 -W0.5 {cfg.remote_v6}")
    cmd(f"ping -c 1 -W0.5 {cfg.v6}", host=cfg.remote)


def main() -> None:
    with NetDrvEpEnv(__file__) as cfg:
        ksft_run(globs=globals(), case_pfx={"test_"}, args=(cfg, ))
    ksft_exit()


if __name__ == "__main__":
    main()