-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup(sinsp): remove some dead code
Signed-off-by: Andrea Terzolo <[email protected]>
- Loading branch information
1 parent
e6db0e6
commit 0754fba
Showing
2 changed files
with
48 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
/* | ||
Copyright (C) 2023 The Falco Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#include <test/helpers/threads_helpers.h> | ||
|
||
TEST_F(sinsp_with_test_input, FD_FILTER_extract_from_null_type_filename) | ||
{ | ||
add_default_init_thread(); | ||
|
||
open_inspector(); | ||
|
||
std::string path = "/home/file.txt"; | ||
int64_t fd = 3; | ||
int64_t dirfd = 4; | ||
|
||
auto evt = add_event_advance_ts(increasing_ts(), INIT_TID, PPME_SYSCALL_OPEN_E, fd, path.c_str(), | ||
(uint32_t)PPM_O_RDWR | PPM_O_CREAT, (uint32_t)0); | ||
ASSERT_FALSE(field_has_value(evt, "fd.filename")); | ||
|
||
evt = add_event_advance_ts(increasing_ts(), INIT_TID, PPME_SYSCALL_OPENAT_2_E, 4, dirfd, path.c_str(), 0, 0); | ||
ASSERT_FALSE(field_has_value(evt, "fd.filename")); | ||
|
||
evt = add_event_advance_ts(increasing_ts(), INIT_TID, PPME_SYSCALL_OPENAT2_E, 5, dirfd, path.c_str(), 0, 0, 0); | ||
ASSERT_FALSE(field_has_value(evt, "fd.filename")); | ||
|
||
evt = add_event_advance_ts(increasing_ts(), INIT_TID, PPME_SYSCALL_CREAT_E, 2, path.c_str(), 0); | ||
ASSERT_FALSE(field_has_value(evt, "fd.filename")); | ||
|
||
evt = add_event_advance_ts(increasing_ts(), INIT_TID, PPME_SYSCALL_OPENAT_E, 4, dirfd, path.c_str(), | ||
PPM_O_RDONLY | PPM_O_CLOEXEC, 0); | ||
ASSERT_FALSE(field_has_value(evt, "fd.filename")); | ||
} |