Skip to content

Commit 41795da

Browse files
authored
minor: fix csfle tests (#778)
1 parent 4d6ca0a commit 41795da

File tree

3 files changed

+82
-5
lines changed

3 files changed

+82
-5
lines changed

src/test/spec/client_side_encryption.rs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,29 @@ use tokio::sync::RwLockWriteGuard;
22

33
use crate::test::LOCK;
44

5-
use super::{run_spec_test_with_path, run_unified_format_test};
5+
use super::{run_spec_test_with_path, run_unified_format_test_filtered, unified_runner::TestCase};
66

77
#[cfg_attr(feature = "tokio-runtime", tokio::test(flavor = "multi_thread"))]
88
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
99
async fn run() {
1010
let _guard: RwLockWriteGuard<()> = LOCK.run_exclusively().await;
11-
run_spec_test_with_path(
12-
&["client-side-encryption", "unified"],
13-
run_unified_format_test,
14-
)
11+
run_spec_test_with_path(&["client-side-encryption", "unified"], |path, test| {
12+
run_unified_format_test_filtered(path, test, spec_predicate)
13+
})
1514
.await;
1615
}
16+
17+
#[allow(unused_variables)]
18+
fn spec_predicate(test: &TestCase) -> bool {
19+
#[cfg(not(feature = "openssl-tls"))]
20+
{
21+
if test.description == "create datakey with KMIP KMS provider" {
22+
crate::test::log_uncaptured(format!(
23+
"Skipping {:?}: KMIP test requires openssl-tls",
24+
test.description
25+
));
26+
return false;
27+
}
28+
}
29+
true
30+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"escCollection": "enxcol_.default.esc",
3+
"eccCollection": "enxcol_.default.ecc",
4+
"ecocCollection": "enxcol_.default.ecoc",
5+
"fields": [
6+
{
7+
"keyId": {
8+
"$binary": {
9+
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
10+
"subType": "04"
11+
}
12+
},
13+
"path": "encryptedIndexed",
14+
"bsonType": "string",
15+
"queries": {
16+
"queryType": "equality",
17+
"contention": {
18+
"$numberLong": "0"
19+
}
20+
}
21+
},
22+
{
23+
"keyId": {
24+
"$binary": {
25+
"base64": "q83vqxI0mHYSNBI0VniQEg==",
26+
"subType": "04"
27+
}
28+
},
29+
"path": "encryptedUnindexed",
30+
"bsonType": "string"
31+
}
32+
]
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"_id": {
3+
"$binary": {
4+
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
5+
"subType": "04"
6+
}
7+
},
8+
"keyMaterial": {
9+
"$binary": {
10+
"base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==",
11+
"subType": "00"
12+
}
13+
},
14+
"creationDate": {
15+
"$date": {
16+
"$numberLong": "1648914851981"
17+
}
18+
},
19+
"updateDate": {
20+
"$date": {
21+
"$numberLong": "1648914851981"
22+
}
23+
},
24+
"status": {
25+
"$numberInt": "0"
26+
},
27+
"masterKey": {
28+
"provider": "local"
29+
}
30+
}

0 commit comments

Comments
 (0)