Lines Matching refs:test

6 static struct mptcp_subflow_request_sock *build_req_sock(struct kunit *test)  in build_req_sock()  argument
10 req = kunit_kzalloc(test, sizeof(struct mptcp_subflow_request_sock), in build_req_sock()
12 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, req); in build_req_sock()
18 static void mptcp_token_test_req_basic(struct kunit *test) in mptcp_token_test_req_basic() argument
20 struct mptcp_subflow_request_sock *req = build_req_sock(test); in mptcp_token_test_req_basic()
23 KUNIT_ASSERT_EQ(test, 0, in mptcp_token_test_req_basic()
25 KUNIT_EXPECT_NE(test, 0, (int)req->token); in mptcp_token_test_req_basic()
26 KUNIT_EXPECT_PTR_EQ(test, null_msk, mptcp_token_get_sock(&init_net, req->token)); in mptcp_token_test_req_basic()
32 static struct inet_connection_sock *build_icsk(struct kunit *test) in build_icsk() argument
36 icsk = kunit_kzalloc(test, sizeof(struct inet_connection_sock), in build_icsk()
38 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, icsk); in build_icsk()
42 static struct mptcp_subflow_context *build_ctx(struct kunit *test) in build_ctx() argument
46 ctx = kunit_kzalloc(test, sizeof(struct mptcp_subflow_context), in build_ctx()
48 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, ctx); in build_ctx()
52 static struct mptcp_sock *build_msk(struct kunit *test) in build_msk() argument
56 msk = kunit_kzalloc(test, sizeof(struct mptcp_sock), GFP_USER); in build_msk()
57 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, msk); in build_msk()
63 static void mptcp_token_test_msk_basic(struct kunit *test) in mptcp_token_test_msk_basic() argument
65 struct inet_connection_sock *icsk = build_icsk(test); in mptcp_token_test_msk_basic()
66 struct mptcp_subflow_context *ctx = build_ctx(test); in mptcp_token_test_msk_basic()
67 struct mptcp_sock *msk = build_msk(test); in mptcp_token_test_msk_basic()
75 KUNIT_ASSERT_EQ(test, 0, in mptcp_token_test_msk_basic()
77 KUNIT_EXPECT_NE(test, 0, (int)ctx->token); in mptcp_token_test_msk_basic()
78 KUNIT_EXPECT_EQ(test, ctx->token, msk->token); in mptcp_token_test_msk_basic()
79 KUNIT_EXPECT_PTR_EQ(test, msk, mptcp_token_get_sock(&init_net, ctx->token)); in mptcp_token_test_msk_basic()
80 KUNIT_EXPECT_EQ(test, 2, (int)refcount_read(&sk->sk_refcnt)); in mptcp_token_test_msk_basic()
83 KUNIT_EXPECT_PTR_EQ(test, null_msk, mptcp_token_get_sock(&init_net, ctx->token)); in mptcp_token_test_msk_basic()
86 static void mptcp_token_test_accept(struct kunit *test) in mptcp_token_test_accept() argument
88 struct mptcp_subflow_request_sock *req = build_req_sock(test); in mptcp_token_test_accept()
89 struct mptcp_sock *msk = build_msk(test); in mptcp_token_test_accept()
91 KUNIT_ASSERT_EQ(test, 0, in mptcp_token_test_accept()
95 KUNIT_EXPECT_PTR_EQ(test, msk, mptcp_token_get_sock(&init_net, msk->token)); in mptcp_token_test_accept()
99 KUNIT_EXPECT_PTR_EQ(test, msk, mptcp_token_get_sock(&init_net, msk->token)); in mptcp_token_test_accept()
105 static void mptcp_token_test_destroyed(struct kunit *test) in mptcp_token_test_destroyed() argument
107 struct mptcp_subflow_request_sock *req = build_req_sock(test); in mptcp_token_test_destroyed()
108 struct mptcp_sock *msk = build_msk(test); in mptcp_token_test_destroyed()
114 KUNIT_ASSERT_EQ(test, 0, in mptcp_token_test_destroyed()
121 KUNIT_EXPECT_PTR_EQ(test, null_msk, mptcp_token_get_sock(&init_net, msk->token)); in mptcp_token_test_destroyed()