File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
userspace/libsinsp/test/parsers Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0
2+ /*
3+ Copyright (C) 2024 The Falco Authors.
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+ http://www.apache.org/licenses/LICENSE-2.0
8+ Unless required by applicable law or agreed to in writing, software
9+ distributed under the License is distributed on an "AS IS" BASIS,
10+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+ See the License for the specific language governing permissions and
12+ limitations under the License.
13+ */
14+
15+ #include < sinsp_with_test_input.h>
16+
17+ TEST_F (sinsp_with_test_input, SETGID_success) {
18+ add_default_init_thread ();
19+ open_inspector ();
20+
21+ int64_t return_value = 0 ;
22+ uint32_t gid = 66 ;
23+
24+ const auto evt = add_event_advance_ts (increasing_ts (),
25+ INIT_TID,
26+ PPME_SYSCALL_SETGID_X,
27+ 2 ,
28+ return_value,
29+ gid);
30+
31+ // Check that the returned value is as expected.
32+ ASSERT_EQ (evt->get_param_by_name (" res" )->as <int64_t >(), return_value);
33+
34+ // Check that the gid value is as expected.
35+ ASSERT_EQ (evt->get_param_by_name (" gid" )->as <uint32_t >(), gid);
36+ }
You can’t perform that action at this time.
0 commit comments