Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] Fix packetbeat system tests on windows #42172

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [[ "${BUILDKITE_LABEL:-}" == *"Pipeline upload"* || "${BUILDKITE_LABEL:-}" ==
fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-packetbeat" && "$BUILDKITE_STEP_KEY" == *"system-tests"* ]]; then
PRIVATE_CI_GCS_CREDENTIALS_SECRET=$(retry -t 5 -- vault kv get -field plaintext -format=json ${PRIVATE_CI_GCS_CREDENTIALS_PATH})
PRIVATE_CI_GCS_CREDENTIALS_SECRET=$(vault kv get -field plaintext -format=json ${PRIVATE_CI_GCS_CREDENTIALS_PATH})
export PRIVATE_CI_GCS_CREDENTIALS_SECRET
fi

Expand Down
2 changes: 0 additions & 2 deletions .buildkite/x-pack/pipeline.xpack.packetbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ steps:

- label: ":windows: x-pack/packetbeat: Win 2022 System Tests"
key: "mandatory-win-2022-system-tests"
skip: "skipping due to elastic/beats#38142"
command: |
Set-Location -Path x-pack/packetbeat
mage systemTest
Expand Down Expand Up @@ -321,7 +320,6 @@ steps:

- label: ":windows: x-pack/packetbeat: Win 10 System Tests"
key: "extended-win-10-system-tests"
skip: "skipping due to elastic/beats#38142"
command: |
Set-Location -Path x-pack/packetbeat
mage systemTest
Expand Down
21 changes: 20 additions & 1 deletion x-pack/packetbeat/tests/system/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Loading