-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: make integration tests more robust
- Add generic functions to check received events in different manners: - ExpectAllInOrder - ExpectAllEqualTo - ExpectAtLeastOneOfEach - ExpectAnyOfEach - Add waitForTraceeOutputEvents function to wait for tracee output events until buffer fills with certain number of events or timeout occurs. - Add waitforTraceeStop function to wait for tracee to stop or until timeout occurs. - Remove tester.sh concentrating all event filter tests in event_filters_test.go. - Create syscaller tool to easily generate syscalls from the command line (strictly for integration tests). It reuses the tracee events package. - Fix goroutine leaks, deadlocks and race conditions.
- Loading branch information
Showing
14 changed files
with
2,152 additions
and
641 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
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
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,18 @@ | ||
package cpu | ||
|
||
import "golang.org/x/sys/unix" | ||
|
||
const CPUForTests = 0 // CPU to pin test processes to | ||
|
||
// SetCPUs pins the current process to a specific CPU | ||
func SetCPUs(id ...int) { | ||
if len(id) == 0 { | ||
id = append(id, CPUForTests) | ||
} | ||
|
||
cpuMask := unix.CPUSet{} | ||
for _, i := range id { | ||
cpuMask.Set(i) | ||
} | ||
_ = unix.SchedSetaffinity(0, &cpuMask) | ||
} |
Oops, something went wrong.