Skip to content

Commit

Permalink
fix(libsinsp_e2e): remove user and group after test
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
  • Loading branch information
therealbobo committed Oct 7, 2024
1 parent 43aaeb4 commit a3a6e55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/libsinsp_e2e/container/container_cri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void container_cri::fake_cri_test_timing(const std::string& pb_prefix,
evt->get_type() == PPME_CONTAINER_JSON_2_E;
};

run_callback_t test = [&](sinsp* inspector)
run_callback_async_t test = [&]()
{
subprocess handle(LIBSINSP_TEST_PATH "/test_helper", {"cri_container_echo"});
handle.in() << "\n";
Expand Down
4 changes: 4 additions & 0 deletions test/libsinsp_e2e/sys_call_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,10 @@ TEST_F(sys_call_test, getsetresuid_and_gid) {
result += setresuid(orig_uids[0], orig_uids[1], orig_uids[2]);
result += setresgid(orig_gids[0], orig_gids[1], orig_gids[2]);

// Clean environment
result += system("userdel testsetresuid");
result += system("groupdel testsetresgid");

if(result != 0) {
FAIL() << "Cannot restore initial id state.";
}
Expand Down

0 comments on commit a3a6e55

Please sign in to comment.