integration: Add test for execsnoop.
@@ -104,6 +104,28 @@ func TestMain(m *testing.M) {
os.Exit(ret)
}
+func TestExecsnoop(t *testing.T) {
+ execsnoopCmd := &command{
+ name: "Start execsnoop gadget",
+ cmd: "$KUBECTL_GADGET execsnoop -n test-ns",
+ expectedRegexp: `test-ns\s+test-pod\s+test-pod\s+date`,
+ startAndStop: true,
+ }
+
+ commands := []*command{
+ execsnoopCmd,
+ {
+ name: "Run pod which does a lot of exec",
+ cmd: busyboxPodCommand("while true; do date; done"),
+ expectedString: "pod/test-pod created\n",
+ },
+ waitUntilTestPodReady,
+ deleteTestPod,
+ }
+
+ runCommands(commands, t)
+}
+
func TestMountsnoop(t *testing.T) {
mountsnoopCmd := &command{
name: "Start mountsnoop gadget",
