Skip to content

Commit 2b491e3

Browse files
committed
Fix test related to kernel_info struct introduction
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent fe6ead9 commit 2b491e3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/vizier/services/agent/shared/manager/registration_test.cc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@ class RegistrationHandlerTest : public ::testing::Test {
6262
agent_info_.pod_name = "pod_name";
6363
agent_info_.host_ip = "host_ip";
6464
agent_info_.capabilities.set_collects_data(true);
65-
agent_info_.kernel_version =
66-
system::ParseKernelVersionString("5.15.0-106-generic").ValueOrDie();
65+
auto kernel_info = system::KernelInfo{
66+
system::ParseKernelVersionString("5.15.0-106-generic").ValueOrDie(),
67+
true /*kernel_headers_installed*/,
68+
};
69+
agent_info_.kernel_info = kernel_info;
6770

6871
auto register_hook = [this](uint32_t asid) -> Status {
6972
called_register_++;
@@ -114,9 +117,11 @@ TEST_F(RegistrationHandlerTest, RegisterAgent) {
114117
EXPECT_EQ(agent_info_.hostname, req.info().host_info().hostname());
115118
EXPECT_EQ(agent_info_.pod_name, req.info().host_info().pod_name());
116119
EXPECT_EQ(agent_info_.host_ip, req.info().host_info().host_ip());
117-
EXPECT_EQ(agent_info_.kernel_version.version, req.info().host_info().kernel().version());
118-
EXPECT_EQ(agent_info_.kernel_version.major_rev, req.info().host_info().kernel().major_rev());
119-
EXPECT_EQ(agent_info_.kernel_version.minor_rev, req.info().host_info().kernel().minor_rev());
120+
EXPECT_EQ(agent_info_.kernel_info.version.version, req.info().host_info().kernel().version());
121+
EXPECT_EQ(agent_info_.kernel_info.version.major_rev, req.info().host_info().kernel().major_rev());
122+
EXPECT_EQ(agent_info_.kernel_info.version.minor_rev, req.info().host_info().kernel().minor_rev());
123+
EXPECT_EQ(agent_info_.kernel_info.kernel_headers_installed,
124+
req.info().host_info().kernel_headers_installed());
120125

121126
auto registration_ack = std::make_unique<messages::VizierMessage>();
122127
registration_ack->mutable_register_agent_response()->set_asid(10);

0 commit comments

Comments
 (0)