File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1
1
use std:: env;
2
2
3
+ use bson:: rawdoc;
4
+
3
5
use crate :: {
4
6
cmap:: establish:: handshake:: {
5
7
ClientMetadata ,
@@ -192,3 +194,27 @@ async fn invalid_wrong_type() -> Result<()> {
192
194
async fn invalid_aws_not_lambda ( ) -> Result < ( ) > {
193
195
check_faas_handshake ( & [ ( "AWS_EXECUTION_ENV" , "EC2" ) ] , & BASE_CLIENT_METADATA ) . await
194
196
}
197
+
198
+ #[ tokio:: test]
199
+ async fn valid_container_and_faas ( ) -> Result < ( ) > {
200
+ check_faas_handshake (
201
+ & [
202
+ ( "AWS_EXECUTION_ENV" , "AWS_Lambda_java8" ) ,
203
+ ( "AWS_REGION" , "us-east-2" ) ,
204
+ ( "AWS_LAMBDA_FUNCTION_MEMORY_SIZE" , "1024" ) ,
205
+ ( "KUBERNETES_SERVICE_HOST" , "1" ) ,
206
+ ] ,
207
+ & ClientMetadata {
208
+ env : Some ( RuntimeEnvironment {
209
+ name : Some ( FaasEnvironmentName :: AwsLambda ) ,
210
+ runtime : Some ( "AWS_Lambda_java8" . to_string ( ) ) ,
211
+ region : Some ( "us-east-2" . to_string ( ) ) ,
212
+ memory_mb : Some ( 1024 ) ,
213
+ container : Some ( rawdoc ! { "orchestrator" : "kubernetes" } ) ,
214
+ ..RuntimeEnvironment :: UNSET
215
+ } ) ,
216
+ ..BASE_CLIENT_METADATA . clone ( )
217
+ } ,
218
+ )
219
+ . await
220
+ }
You can’t perform that action at this time.
0 commit comments