Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mmat11 committed Jan 10, 2024
1 parent 7570c1c commit d1f0499
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions testing/test_bins/create_rename_delete_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ int main()
CHECK(rename(filename_orig, filename_new), -1);
CHECK(chmod(filename_new, S_IRWXU | S_IRWXG | S_IRWXO), -1);
CHECK(fprintf(f, "test"), -1);
CHECK(truncate(filename_new, 0), -1);
CHECK(unlink(filename_new), -1);

CHECK(ftruncate(fileno(f), 0), -1);
CHECK(fclose(f), EOF);
CHECK(unlink(filename_new), -1);

return 0;
}
8 changes: 4 additions & 4 deletions testing/testrunner/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,9 @@ func TestFileDeleteContainer(et *EventsTraceInstance) {
func TestFileModify(et *EventsTraceInstance) {
outputStr := runTestBin("create_rename_delete_file")
var binOutput struct {
ChildPid int64 `json:"child_pid"`
FileNameOrig string `json:"filename_orig"`
FileNameNew string `json:"filename_new"`
PidInfo TestPidInfo `json:"pid_info"`
FileNameOrig string `json:"filename_orig"`
FileNameNew string `json:"filename_new"`
}
if err := json.Unmarshal(outputStr, &binOutput); err != nil {
TestFail("failed to unmarshal json", err)
Expand All @@ -410,7 +410,7 @@ func TestFileModify(et *EventsTraceInstance) {
TestFail("failed to unmarshal JSON: ", err)
}

if event.Pids.Tgid == binOutput.ChildPid {
if event.Pids.Tid == binOutput.PidInfo.Tid {
events = append(events, event)
eventsCount--
if eventsCount == 0 {
Expand Down

0 comments on commit d1f0499

Please sign in to comment.