summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/tcp_ao/restore.c
diff options
context:
space:
mode:
authorDmitry Safonov <0x7f454c46@gmail.com>2025-03-19 06:13:35 +0300
committerJakub Kicinski <kuba@kernel.org>2025-03-25 16:10:29 +0300
commit1fe4221093d1b97b6972231b3db660c035ba156b (patch)
treeae94d39c0c8ed67fdde0d6149ab7ab56035804ed /tools/testing/selftests/net/tcp_ao/restore.c
parent65ffdf31be68aaa6b2480112e5f65b6e747a3724 (diff)
downloadlinux-1fe4221093d1b97b6972231b3db660c035ba156b.tar.xz
selftests/net: Provide tcp-ao counters comparison helper
Rename __test_tcp_ao_counters_cmp() into test_assert_counters_ao() and test_tcp_ao_key_counters_cmp() into test_assert_counters_key() as they are asserts, rather than just compare functions. Provide test_cmp_counters() helper, that's going to be used to compare ao_info and netns counters as a stop condition for polling the sockets. Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://patch.msgid.link/20250319-tcp-ao-selftests-polling-v2-2-da48040153d1@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/tcp_ao/restore.c')
-rw-r--r--tools/testing/selftests/net/tcp_ao/restore.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/tcp_ao/restore.c b/tools/testing/selftests/net/tcp_ao/restore.c
index ecc6f1e3a414..ad8505f77023 100644
--- a/tools/testing/selftests/net/tcp_ao/restore.c
+++ b/tools/testing/selftests/net/tcp_ao/restore.c
@@ -69,7 +69,7 @@ static void try_server_run(const char *tst_name, unsigned int port,
test_error("test_get_tcp_ao_counters()");
after_cnt = netstat_get_one(cnt_name, NULL);
- test_tcp_ao_counters_cmp(tst_name, &ao1, &ao2, cnt_expected);
+ test_assert_counters(tst_name, &ao1, &ao2, cnt_expected);
if (after_cnt <= before_cnt) {
test_fail("%s: %s counter did not increase: %" PRIu64 " <= %" PRIu64,
@@ -182,7 +182,7 @@ static void test_sk_restore(const char *tst_name, unsigned int server_port,
test_error("test_get_tcp_ao_counters()");
after_cnt = netstat_get_one(cnt_name, NULL);
- test_tcp_ao_counters_cmp(tst_name, &ao1, &ao2, cnt_expected);
+ test_assert_counters(tst_name, &ao1, &ao2, cnt_expected);
if (after_cnt <= before_cnt) {
test_fail("%s: %s counter did not increase: %" PRIu64 " <= %" PRIu64,