Skip to content

Commit f1f1128

Browse files
committed
PMM-7 fix test.
1 parent f1ad6c3 commit f1f1128

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

exporter/encryption_info_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package exporter
1717

1818
import (
1919
"context"
20+
"fmt"
2021
"io"
2122
"strings"
2223
"testing"
@@ -32,6 +33,10 @@ import (
3233

3334
func TestGetEncryptionInfo(t *testing.T) {
3435
t.Parallel()
36+
version, vendor := getMongoDBVersionInfo(t, "standalone-encrypted")
37+
if vendor != "Percona" {
38+
t.Skip("Test is only for Percona MongoDB as upstream MongoDB does not support encryption")
39+
}
3540

3641
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
3742
defer cancel()
@@ -52,13 +57,13 @@ func TestGetEncryptionInfo(t *testing.T) {
5257
c := newDiagnosticDataCollector(ctx, client, logger, true, ti, dbBuildInfo)
5358

5459
// The last \n at the end of this string is important
55-
expected := strings.NewReader(`
60+
expected := strings.NewReader(fmt.Sprintf(`
5661
# HELP mongodb_security_encryption_enabled Shows that encryption is enabled
5762
# TYPE mongodb_security_encryption_enabled gauge
5863
mongodb_security_encryption_enabled{type="localKeyFile"} 1
5964
# HELP mongodb_version_info The server version
6065
# TYPE mongodb_version_info gauge
61-
mongodb_version_info{edition="Community",mongodb="5.0.13-11",vendor="Percona"} 1` + "\n")
66+
mongodb_version_info{edition="Community",mongodb="%s",vendor="%s"} 1`, version, vendor) + "\n")
6267

6368
filter := []string{
6469
"mongodb_security_encryption_enabled",

0 commit comments

Comments
 (0)