...
1
2
3
4
5
6
7
8
9
10 package integration
11
12 import (
13 "os"
14 "path"
15 "regexp"
16 "testing"
17 )
18
19 const (
20 encryptionSpecName = "client-side-encryption/legacy"
21 )
22
23 func verifyClientSideEncryptionVarsSet(t *testing.T) {
24 t.Helper()
25
26
27
28
29
30 if awsAccessKeyID == "" {
31 t.Fatal("AWS access key ID not set")
32 }
33 if awsSecretAccessKey == "" {
34 t.Fatal("AWS secret access key not set")
35 }
36 if azureTenantID == "" {
37 t.Fatal("azure tenant ID not set")
38 }
39 if azureClientID == "" {
40 t.Fatal("azure client ID not set")
41 }
42 if azureClientSecret == "" {
43 t.Fatal("azure client secret not set")
44 }
45 if gcpEmail == "" {
46 t.Fatal("GCP email not set")
47 }
48 if gcpPrivateKey == "" {
49 t.Fatal("GCP private key not set")
50 }
51 }
52
53 func TestClientSideEncryptionSpec(t *testing.T) {
54 verifyClientSideEncryptionVarsSet(t)
55
56 for _, fileName := range jsonFilesInDir(t, path.Join(dataPath, encryptionSpecName)) {
57 t.Run(fileName, func(t *testing.T) {
58 re := regexp.MustCompile(`fle2\-Range\-.*\-Correctness`)
59 if re.Match([]byte(fileName)) {
60 t.Skipf("skipping test on macOS due to slow runtime")
61 }
62 if fileName == "kmipKMS.json" && "" == os.Getenv("KMS_MOCK_SERVERS_RUNNING") {
63 t.Skipf("Skipping test as KMS_MOCK_SERVERS_RUNNING is not set")
64 }
65 runSpecTestFile(t, encryptionSpecName, fileName)
66 })
67 }
68 }
69
View as plain text