tests: check decoding of rtnetlink tc action messages

* tests/netlink_route.c (test_rtnl_tca): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
This commit is contained in:
JingPiao Chen 2017-08-13 10:26:38 +08:00 committed by Dmitry V. Levin
parent a144fd0287
commit e729e3f0d0

View File

@ -351,6 +351,20 @@ test_rtnl_tc(const int fd)
printf("}"));
}
static void
test_rtnl_tca(const int fd)
{
void *const nlh0 = tail_alloc(NLMSG_HDRLEN);
struct tcamsg msg = {
.tca_family = AF_INET
};
TEST_NETLINK(fd, nlh0,
RTM_GETACTION, NLM_F_REQUEST,
sizeof(msg), &msg, sizeof(msg),
printf("{tca_family=AF_INET}"));
}
int main(void)
{
skip_if_unavailable("/proc/self/fd/");
@ -370,6 +384,7 @@ int main(void)
test_rtnl_neigh(fd);
test_rtnl_neightbl(fd);
test_rtnl_tc(fd);
test_rtnl_tca(fd);
printf("+++ exited with 0 +++\n");