summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/nl_netdev.py
blob: 2b8b488fb419d48e9908e179de01f69ff07ea4e6 (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
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0

from lib.py import ksft_run, ksft_pr, ksft_eq, ksft_ge, NetdevFamily


def empty_check(nf) -> None:
    devs = nf.dev_get({}, dump=True)
    ksft_ge(len(devs), 1)


def lo_check(nf) -> None:
    lo_info = nf.dev_get({"ifindex": 1})
    ksft_eq(len(lo_info['xdp-features']), 0)
    ksft_eq(len(lo_info['xdp-rx-metadata-features']), 0)


def main() -> None:
    nf = NetdevFamily()
    ksft_run([empty_check, lo_check], args=(nf, ))


if __name__ == "__main__":
    main()