Skip to content

Commit

Permalink
add task
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Nov 13, 2024
1 parent 02a60a5 commit fd682b7
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,42 @@ functions:
KMS_MOCK_SERVERS_RUNNING: "true"
args: [*task-runner, evg-test-kmip]

start-kms-failpoint-server:
- command: ec2.assume_role
params:
role_arn: ${aws_test_secrets_role}
- command: subprocess.exec
params:
working_dir: src/go.mongodb.org/mongo-driver
binary: bash
background: true
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "DRIVERS_TOOLS"]
# This cannot use task because it will hang on Windows.
args: [etc/setup-encryption.sh]
- command: subprocess.exec
params:
binary: python3
background: true
args: ["-u", "${DRIVERS_TOOLS}/.evergreen/csfle/kms_failpoint_server.py", "--port", "9003"]

run-retry-kms-requests:
- command: subprocess.exec
type: test
params:
binary: "bash"
env:
GO_BUILD_TAGS: cse
include_expansions_in_env: [AUTH, SSL, MONGODB_URI, TOPOLOGY,
MONGO_GO_DRIVER_COMPRESSOR]
args: [*task-runner, setup-test]
- command: subprocess.exec
type: test
params:
binary: "bash"
env:
KMS_FAILPOINT_SERVERS_RUNNING: "true"
args: [*task-runner, evg-test-retry-kms-requests]

run-fuzz-tests:
- command: subprocess.exec
type: test
Expand Down Expand Up @@ -1486,6 +1522,21 @@ tasks:
AUTH: "noauth"
SSL: "nossl"

- name: "test-retry-kms-requests"
tags: ["retry-kms-requests"]
commands:
- func: bootstrap-mongo-orchestration
vars:
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"
- func: start-kms-failpoint-server
- func: run-retry-kms-requests
vars:
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"

- name: "test-serverless"
tags: ["serverless"]
commands:
Expand Down Expand Up @@ -2195,6 +2246,12 @@ buildvariants:
tasks:
- name: ".kms-kmip"

- matrix_name: "retry-kms-requests-test"
matrix_spec: { version: ["7.0"], os-ssl-40: ["rhel87-64"] }
display_name: "Retry KMS Requests ${os-ssl-40}"
tasks:
- name: ".retry-kms-requests"

- matrix_name: "fuzz-test"
matrix_spec: { version: ["5.0"], os-ssl-40: ["rhel87-64"] }
display_name: "Fuzz ${version} ${os-ssl-40}"
Expand Down
3 changes: 3 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ tasks:
evg-test-kms:
- go test -exec "env PKG_CONFIG_PATH=${PKG_CONFIG_PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" ${BUILD_TAGS} -v -timeout {{.TEST_TIMEOUT}}s ./internal/integration -run TestClientSideEncryptionProse/kms_tls_tests >> test.suite

evg-test-retry-kms-requests:
- go test -exec "env PKG_CONFIG_PATH=${PKG_CONFIG_PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" ${BUILD_TAGS} -v -timeout {{.TEST_TIMEOUT}}s ./internal/integration -run TestClientSideEncryptionProse/kms_retry_tests >> test.suite

evg-test-load-balancers:
# Load balancer should be tested with all unified tests as well as tests in the following
# components: retryable reads, retryable writes, change streams, initial DNS seedlist discovery.
Expand Down
10 changes: 8 additions & 2 deletions internal/integration/client_side_encryption_prose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2983,7 +2983,12 @@ func TestClientSideEncryptionProse(t *testing.T) {
})
})

mt.RunOpts("24. KMS Retry Tests", qeRunOpts22, func(mt *mtest.T) {
mt.RunOpts("24. kms retry tests", noClientOpts, func(mt *mtest.T) {
kmsTlsTestcase := os.Getenv("KMS_FAILPOINT_SERVERS_RUNNING")
if kmsTlsTestcase == "" {
mt.Skipf("Skipping test as KMS_FAILPOINT_SERVERS_RUNNING is not set")
}

setFailPoint := func(failure string, count int) error {
url := fmt.Sprintf("https://localhost:9003/set_failpoint/%s", failure)
var payloadBuf bytes.Buffer
Expand All @@ -3005,7 +3010,8 @@ func TestClientSideEncryptionProse(t *testing.T) {
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: certPool,
RootCAs: certPool,
InsecureSkipVerify: true,
},
},
}
Expand Down

0 comments on commit fd682b7

Please sign in to comment.