diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index ffc86d477c4..be542ba0b89 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -10,6 +10,10 @@ if [[ "${BUILDKITE_LABEL:-}" == *"Pipeline upload"* || "${BUILDKITE_LABEL:-}" == fi fi +if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-packetbeat" && "$BUILDKITE_STEP_KEY" == *"system-tests"* ]]; then + source "$BUILDKITE_BUILD_CHECKOUT_PATH/.buildkite/scripts/gcp_auth.sh" +fi + if [[ "$BUILDKITE_PIPELINE_SLUG" == "auditbeat" || \ "$BUILDKITE_PIPELINE_SLUG" == "beats-libbeat" || \ "$BUILDKITE_PIPELINE_SLUG" == "beats-macos-tests" || \ diff --git a/.buildkite/x-pack/pipeline.xpack.packetbeat.yml b/.buildkite/x-pack/pipeline.xpack.packetbeat.yml index 5b3625e0fc9..58db6bf793e 100644 --- a/.buildkite/x-pack/pipeline.xpack.packetbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.packetbeat.yml @@ -207,9 +207,7 @@ steps: - label: ":windows: x-pack/packetbeat: Win 2022 System Tests" key: "mandatory-win-2022-system-tests" - skip: "skipping due to elastic/beats#38142" command: | - source .buildkite/scripts/gcp_auth.sh Set-Location -Path x-pack/packetbeat mage systemTest retry: @@ -322,9 +320,7 @@ steps: - label: ":windows: x-pack/packetbeat: Win 10 System Tests" key: "extended-win-10-system-tests" - skip: "skipping due to elastic/beats#38142" command: | - source .buildkite/scripts/gcp_auth.sh Set-Location -Path x-pack/packetbeat mage systemTest retry: diff --git a/x-pack/packetbeat/magefile.go b/x-pack/packetbeat/magefile.go index 5e938cbbda7..220c430e5d8 100644 --- a/x-pack/packetbeat/magefile.go +++ b/x-pack/packetbeat/magefile.go @@ -137,12 +137,7 @@ func TestPackages() error { } func SystemTest(ctx context.Context) error { - // Buildkite (CI) images have preinstalled npcap - if os.Getenv("CI") == "true" { - mg.SerialDeps(devtools.BuildSystemTestBinary) - } else { - mg.SerialDeps(xpacketbeat.GetNpcapInstaller, devtools.BuildSystemTestBinary) - } + mg.SerialDeps(xpacketbeat.GetNpcapInstaller, devtools.BuildSystemTestBinary) args := devtools.DefaultGoTestIntegrationArgs() args.Packages = []string{"./tests/system/..."} diff --git a/x-pack/packetbeat/tests/system/app_test.go b/x-pack/packetbeat/tests/system/app_test.go index 214cd9c2369..d298b915737 100644 --- a/x-pack/packetbeat/tests/system/app_test.go +++ b/x-pack/packetbeat/tests/system/app_test.go @@ -24,7 +24,7 @@ import ( ) // Keep in sync with NpcapVersion in magefile.go. -const NpcapVersion = "1.79" +const NpcapVersion = "1.80" func TestWindowsNpcapInstaller(t *testing.T) { if runtime.GOOS != "windows" { @@ -65,7 +65,26 @@ func TestDevices(t *testing.T) { } t.Log("Expect interfaces:\n", expected) +ifcsLoop: for _, ifc := range ifcs { - assert.Contains(t, stdout, ifc.Name) + if strings.Contains(stdout, ifc.Name) { + continue ifcsLoop + } + addrs, err := ifc.Addrs() + assert.NoError(t, err) + maddrs, err := ifc.MulticastAddrs() + assert.NoError(t, err) + addrs = append(addrs, maddrs...) + for _, addr := range addrs { + s := addr.String() + // remove the network mask suffix + if idx := strings.Index(s, "/"); idx > -1 { + s = s[:idx] + } + if strings.Contains(stdout, s) { + continue ifcsLoop + } + } + t.Errorf("interface %q not found", ifc.Name) } }