Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1#!/usr/bin/env python3
2# SPDX-License-Identifier: GPL-2.0
3
4"""
5Test exercising NetDrvContEnv() itself, a NetDrvContEnv() selftest.
6"""
7
8from lib.py import ksft_run, ksft_exit
9from lib.py import NetDrvContEnv
10from lib.py import cmd
11
12
13def test_ping(cfg) -> None:
14 """ Run ping between the container and the remote system. """
15 cfg.require_ipver("6")
16
17 cmd(f"ping -c 1 -W5 {cfg.nk_guest_ipv6}", host=cfg.remote)
18 cmd(f"ping -c 1 -W5 {cfg.remote_addr_v['6']}", ns=cfg.netns)
19
20
21def main() -> None:
22 """ Ksft boiler plate main """
23 with NetDrvContEnv(__file__) as cfg:
24 ksft_run([test_ping], args=(cfg,))
25 ksft_exit()
26
27
28if __name__ == "__main__":
29 main()