4 from atf_python.ktest import BaseKernelTest
5 from atf_python.sys.netlink.attrs import NlAttrU32
13 class TestNetlinkMessageWriter(BaseKernelTest):
14 KTEST_MODULE_NAME = "ktest_netlink_message_writer"
16 @pytest.mark.parametrize(
19 pytest.param(M_NOWAIT, id="NOWAIT"),
20 pytest.param(M_WAITOK, id="WAITOK"),
23 @pytest.mark.parametrize(
26 pytest.param([NLMSG_SMALL, NLMSG_SMALL], id="NLMSG_SMALL"),
27 pytest.param([NLMSG_LARGE, NLMSG_LARGE], id="NLMSG_LARGE"),
28 pytest.param([NLMSG_LARGE + 256, NLMSG_LARGE + 256], id="NLMSG_LARGE+256"),
31 def test_nlbuf_writer_allocation(self, sz, malloc_flags):
32 """override to parametrize"""
35 NlAttrU32(1, sz[0]), # size
36 NlAttrU32(2, sz[1]), # expected_avail
37 NlAttrU32(3, malloc_flags),
39 self.runtest(test_meta)