tools/net/ynl/tests/ovs.c
Source file repositories/reference/linux-study-clean/tools/net/ynl/tests/ovs.c
File Facts
- System
- Linux kernel
- Corpus path
tools/net/ynl/tests/ovs.c- Extension
.c- Size
- 2474 bytes
- Lines
- 109
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hstring.hynl.hkselftest_harness.hovs_datapath-user.h
Detected Declarations
function ovs_print_datapathfunction ynl_dump_foreach
Annotated Snippet
if (req) {
ovs_datapath_del_req_set_name(req, self->dp_name);
ovs_datapath_del(self->ys, req);
ovs_datapath_del_req_free(req);
}
}
ynl_sock_destroy(self->ys);
}
TEST_F(ovs, crud)
{
struct ovs_datapath_get_req_dump *dreq;
struct ovs_datapath_new_req *new_req;
struct ovs_datapath_get_list *dps;
struct ovs_datapath_get_rsp *dp;
struct ovs_datapath_get_req *req;
bool found = false;
int err;
new_req = ovs_datapath_new_req_alloc();
ASSERT_NE(NULL, new_req);
ovs_datapath_new_req_set_upcall_pid(new_req, 1);
ovs_datapath_new_req_set_name(new_req, "ynl-test");
err = ovs_datapath_new(self->ys, new_req);
ovs_datapath_new_req_free(new_req);
ASSERT_EQ(0, err) {
TH_LOG("new failed: %s", self->ys->err.msg);
}
self->dp_name = "ynl-test";
ksft_print_msg("get:\n");
req = ovs_datapath_get_req_alloc();
ASSERT_NE(NULL, req);
ovs_datapath_get_req_set_name(req, "ynl-test");
dp = ovs_datapath_get(self->ys, req);
ovs_datapath_get_req_free(req);
ASSERT_NE(NULL, dp) {
TH_LOG("get failed: %s", self->ys->err.msg);
}
ovs_print_datapath(_metadata, dp);
EXPECT_STREQ("ynl-test", dp->name);
ovs_datapath_get_rsp_free(dp);
ksft_print_msg("dump:\n");
dreq = ovs_datapath_get_req_dump_alloc();
ASSERT_NE(NULL, dreq);
dps = ovs_datapath_get_dump(self->ys, dreq);
ovs_datapath_get_req_dump_free(dreq);
ASSERT_NE(NULL, dps) {
TH_LOG("dump failed: %s", self->ys->err.msg);
}
ynl_dump_foreach(dps, d) {
ovs_print_datapath(_metadata, d);
if (d->name && !strcmp(d->name, "ynl-test"))
found = true;
}
ovs_datapath_get_list_free(dps);
EXPECT_TRUE(found);
}
TEST_HARNESS_MAIN
Annotation
- Immediate include surface: `stdio.h`, `string.h`, `ynl.h`, `kselftest_harness.h`, `ovs_datapath-user.h`.
- Detected declarations: `function ovs_print_datapath`, `function ynl_dump_foreach`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.