Skip to content

Commit b376fb5

Browse files
authored
Skip Beats recipes that contain fingerprint identity on older versions (#8864) (#8866)
(cherry picked from commit b4b66af)
1 parent 3a56b61 commit b376fb5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/e2e/beat/recipes_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ const (
3636
)
3737

3838
func TestFilebeatNoAutodiscoverRecipe(t *testing.T) {
39+
skipIfFingerprintIdentityNotSupported(t)
40+
3941
name := "fb-no-autodiscover"
4042
pod, loggedString := loggingTestPod(name)
4143
customize := func(builder beat.Builder) beat.Builder {
@@ -49,6 +51,8 @@ func TestFilebeatNoAutodiscoverRecipe(t *testing.T) {
4951
}
5052

5153
func TestFilebeatAutodiscoverRecipe(t *testing.T) {
54+
skipIfFingerprintIdentityNotSupported(t)
55+
5256
name := "fb-autodiscover"
5357
pod, loggedString := loggingTestPod(name)
5458
customize := func(builder beat.Builder) beat.Builder {
@@ -63,6 +67,8 @@ func TestFilebeatAutodiscoverRecipe(t *testing.T) {
6367
}
6468

6569
func TestFilebeatAutodiscoverByMetadataRecipe(t *testing.T) {
70+
skipIfFingerprintIdentityNotSupported(t)
71+
6672
name := "fb-autodiscover-meta"
6773
podBad, badLog := loggingTestPod(name + "-bad")
6874
podLabel, goodLog := loggingTestPod(name + "-label")
@@ -100,6 +106,8 @@ func TestMetricbeatHostsRecipe(t *testing.T) {
100106
}
101107

102108
func TestMetricbeatStackMonitoringRecipe(t *testing.T) {
109+
skipIfFingerprintIdentityNotSupported(t)
110+
103111
name := "fb-autodiscover"
104112
pod, loggedString := loggingTestPod(name)
105113
customize := func(builder beat.Builder) beat.Builder {
@@ -262,6 +270,12 @@ func runBeatRecipe(
262270
helper.RunFile(t, filePath, namespace, suffix, additionalObjects, transformationsWrapped)
263271
}
264272

273+
func skipIfFingerprintIdentityNotSupported(t *testing.T) {
274+
if !SupportsFingerprintIdentity(version.MustParse(test.Ctx().ElasticStackVersion)) {
275+
t.Skipf("Skipping test %s because fingerprint identity is not supported for stack version %s", t.Name(), test.Ctx().ElasticStackVersion)
276+
}
277+
}
278+
265279
// isStackIncompatible returns true iff Beat version is higher than tested Stack version
266280
func isStackIncompatible(beat beatv1beta1.Beat) bool {
267281
stackVersion := version.MustParse(test.Ctx().ElasticStackVersion)

0 commit comments

Comments
 (0)