Skip to content

Commit a51f840

Browse files
committed
fix tests
1 parent 2d63d96 commit a51f840

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

.evergreen/config.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -554,24 +554,18 @@ functions:
554554
args: [*task-runner, evg-test-kmip]
555555

556556
start-kms-failpoint-server:
557-
- command: ec2.assume_role
558-
params:
559-
role_arn: ${aws_test_secrets_role}
560-
- command: subprocess.exec
561-
params:
562-
working_dir: src/go.mongodb.org/mongo-driver
563-
binary: bash
564-
background: true
565-
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "DRIVERS_TOOLS"]
566-
# This cannot use task because it will hang on Windows.
567-
args: [etc/setup-encryption.sh]
568557
- command: subprocess.exec
569558
params:
570559
binary: python3
560+
env:
561+
KMS_FAILPOINT_SERVERS_RUNNING: "true"
571562
background: true
572563
args: ["-u", "${DRIVERS_TOOLS}/.evergreen/csfle/kms_failpoint_server.py", "--port", "9003"]
573564

574565
run-retry-kms-requests:
566+
- command: ec2.assume_role
567+
params:
568+
role_arn: ${aws_test_secrets_role}
575569
- command: subprocess.exec
576570
type: test
577571
params:
@@ -586,7 +580,8 @@ functions:
586580
params:
587581
binary: "bash"
588582
env:
589-
KMS_FAILPOINT_SERVERS_RUNNING: "true"
583+
CSFLE_TLS_CA_FILE: "${PARENT_DIR}/x509gen/ca.pem"
584+
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "DRIVERS_TOOLS"]
590585
args: [*task-runner, evg-test-retry-kms-requests]
591586

592587
run-fuzz-tests:

internal/integration/client_side_encryption_prose_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,8 +1516,8 @@ func TestClientSideEncryptionProse(t *testing.T) {
15161516
tlsConfig := make(map[string]*tls.Config)
15171517
if tlsCAFileKMIP != "" && tlsClientCertificateKeyFileKMIP != "" {
15181518
clientAndCATlsMap := map[string]interface{}{
1519-
"tlsCertificateKeyFile": tlsClientCertificateKeyFileKMIP,
1520-
"tlsCAFile": tlsCAFileKMIP,
1519+
// "tlsCertificateKeyFile": tlsClientCertificateKeyFileKMIP,
1520+
"tlsCAFile": tlsCAFileKMIP,
15211521
}
15221522
certConfig, err := options.BuildTLSConfig(clientAndCATlsMap)
15231523
assert.Nil(mt, err, "BuildTLSConfig error: %v", err)
@@ -1637,11 +1637,11 @@ func TestClientSideEncryptionProse(t *testing.T) {
16371637
_, err = cpt.clientEnc.CreateDataKey(context.Background(), tc.name, dkOpts)
16381638
// check if current test case is KMIP, which should pass
16391639
if tc.name == "kmip" {
1640-
assert.Nil(mt, err, "expected no error, got err: %v, %s", err, tlsClientCertificateKeyFileKMIP)
1640+
assert.Nil(mt, err, "expected no error, got err: %v, %s", err, tlsCAFileKMIP)
16411641
} else {
16421642
assert.NotNil(mt, err, "expected error, got nil")
16431643
assert.True(mt, strings.Contains(err.Error(), tc.tlsError),
1644-
"expected error '%s' to contain '%s', %s", err.Error(), tc.tlsError, tlsClientCertificateKeyFileKMIP)
1644+
"expected error '%s' to contain '%s', %s", err.Error(), tc.tlsError, tlsCAFileKMIP)
16451645
}
16461646

16471647
// call CreateDataKey with expired CEO each provider and same masterKey

mongo/options/clientoptions.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,7 @@ func (c *ClientOptionsBuilder) SetSRVServiceName(srvName string) *ClientOptionsB
12521252
// addCACertFromFile adds a root CA certificate to the configuration given a path
12531253
// to the containing file.
12541254
func addCACertFromFile(cfg *tls.Config, file string) error {
1255+
fmt.Println("adding CA file", file)
12551256
data, err := ioutil.ReadFile(file)
12561257
if err != nil {
12571258
return err

0 commit comments

Comments
 (0)