xref: /freebsd/tests/examples/test_ktest_example.py (revision 2ff63af9b88c7413b7d71715b5532625752a248e)
1import pytest
2
3from atf_python.ktest import BaseKernelTest
4
5from atf_python.sys.netlink.attrs import NlAttrStr
6from atf_python.sys.netlink.attrs import NlAttrU32
7
8
9class TestExample(BaseKernelTest):
10    KTEST_MODULE_NAME = "ktest_example"
11
12    @pytest.mark.parametrize(
13        "numbers",
14        [
15            pytest.param([1, 2], id="1_2_Sum"),
16            pytest.param([3, 4], id="3_4_Sum"),
17        ],
18    )
19    def test_with_params(self, numbers):
20        """override to parametrize"""
21
22        test_meta = [
23            NlAttrU32(1, numbers[0]),
24            NlAttrU32(2, numbers[1]),
25            NlAttrStr(3, "test string"),
26        ]
27        self.runtest(test_meta)
28
29    @pytest.mark.skip(reason="comment me ( or delete the func) to run the test")
30    def test_failed(self):
31        pass
32
33    @pytest.mark.skip(reason="comment me ( or delete the func) to run the test")
34    def test_failed2(self):
35        pass
36