free(conn);
}
-static int send_and_test_data(struct subtest_cfg *cfg, bool must_succeed)
+static int send_and_test_data(struct subtest_cfg *cfg)
{
struct connection *conn;
int err, res = -1;
conn = connect_client_to_server(cfg);
- if (!must_succeed && !ASSERT_ERR_PTR(conn, "connection that must fail"))
- goto end;
- else if (!must_succeed)
- return 0;
-
- if (!ASSERT_OK_PTR(conn, "connection that must succeed"))
+ if (!ASSERT_OK_PTR(conn, "connect to server"))
return -1;
err = send(conn->client_fd, tx_buffer, DEFAULT_TEST_DATA_SIZE, 0);
goto fail;
/* Basic communication must work */
- if (!ASSERT_OK(send_and_test_data(cfg, true), "connect without any encap"))
+ if (!ASSERT_OK(send_and_test_data(cfg), "connect without any encap"))
goto fail;
/* Attach encapsulation program to client */
if (!ASSERT_OK(configure_kernel_decapsulation(cfg),
"configure kernel decapsulation"))
goto fail;
- if (!ASSERT_OK(send_and_test_data(cfg, true),
+ if (!ASSERT_OK(send_and_test_data(cfg),
"connect with encap prog and kern decap"))
goto fail;
}
/* Replace kernel decapsulation with BPF decapsulation, test must pass */
if (!ASSERT_OK(configure_ebpf_decapsulation(cfg), "configure ebpf decapsulation"))
goto fail;
- ASSERT_OK(send_and_test_data(cfg, true), "connect with encap and decap progs");
+ ASSERT_OK(send_and_test_data(cfg), "connect with encap and decap progs");
fail:
close_netns(nstoken);