28
28
from evergreen_config_lib import shell_mongoc
29
29
from pkg_resources import parse_version
30
30
31
+
31
32
class CompileTask (NamedTask ):
32
33
def __init__ (self , task_name , tags = None , config = 'debug' ,
33
34
compression = 'default' , continue_on_err = False ,
@@ -73,7 +74,7 @@ def to_dict(self):
73
74
script += 'export %s="%s"\n ' % (opt , value )
74
75
75
76
script += "CC='${CC}' MARCH='${MARCH}' sh .evergreen/compile.sh" + \
76
- self .extra_script
77
+ self .extra_script
77
78
task ['commands' ].append (shell_mongoc (script ))
78
79
task ['commands' ].append (func ('upload build' ))
79
80
task ['commands' ].extend (self .suffix_commands )
@@ -102,7 +103,7 @@ def __init__(self, *args, **kwargs):
102
103
EXTRA_CONFIGURE_FLAGS = "-DENABLE_CLIENT_SIDE_ENCRYPTION=ON" ,
103
104
** kwargs ).to_dict ()
104
105
extra_script = "rm CMakeCache.txt\n " + \
105
- compile_with_cse ["commands" ][0 ]["params" ]["script" ]
106
+ compile_with_cse ["commands" ][0 ]["params" ]["script" ]
106
107
107
108
# Skip running mock server tests, because those were already run in the non-CSE build.
108
109
super (CompileWithClientSideEncryption , self ).__init__ (* args , CFLAGS = "-fPIC" ,
@@ -123,7 +124,7 @@ def __init__(self, *args, **kwargs):
123
124
PATH = '/usr/lib/llvm-3.8/bin:$PATH' ,
124
125
** kwargs ).to_dict ()
125
126
extra_script = "rm CMakeCache.txt\n " + \
126
- compile_with_cse ["commands" ][0 ]["params" ]["script" ]
127
+ compile_with_cse ["commands" ][0 ]["params" ]["script" ]
127
128
128
129
# Skip running mock server tests, because those were already run in the non-CSE build.
129
130
super (CompileWithClientSideEncryptionAsan , self ).__init__ (* args ,
@@ -156,7 +157,8 @@ def __init__(self, task_name, suffix_commands, orchestration=True, **kwargs):
156
157
157
158
all_tasks = [
158
159
NamedTask ('check-headers' ,
159
- commands = [shell_mongoc ('sh ./.evergreen/check-public-decls.sh' ), shell_mongoc ('python ./.evergreen/check-preludes.py .' )]),
160
+ commands = [shell_mongoc ('sh ./.evergreen/check-public-decls.sh' ),
161
+ shell_mongoc ('python ./.evergreen/check-preludes.py .' )]),
160
162
FuncTask ('make-release-archive' ,
161
163
'release archive' , 'upload docs' , 'upload man pages' ,
162
164
'upload release' , 'upload build' ),
@@ -405,16 +407,16 @@ def __init__(self, task_name, suffix_commands, orchestration=True, **kwargs):
405
407
CompileTask ('debug-compile-with-warnings' ,
406
408
CFLAGS = '-Werror -Wno-cast-align' ),
407
409
CompileWithClientSideEncryption ('debug-compile-sasl-openssl-cse' , tags = [
408
- 'debug-compile' , 'sasl' , 'openssl' ], SASL = "AUTO" , SSL = "OPENSSL" ),
410
+ 'debug-compile' , 'sasl' , 'openssl' ], SASL = "AUTO" , SSL = "OPENSSL" ),
409
411
CompileWithClientSideEncryption ('debug-compile-sasl-darwinssl-cse' , tags = [
410
- 'debug-compile' , 'sasl' , 'darwinssl' ], SASL = "AUTO" , SSL = "DARWIN" ),
412
+ 'debug-compile' , 'sasl' , 'darwinssl' ], SASL = "AUTO" , SSL = "DARWIN" ),
411
413
CompileWithClientSideEncryption ('debug-compile-sasl-winssl-cse' , tags = [
412
- 'debug-compile' , 'sasl' , 'winssl' ], SASL = "AUTO" , SSL = "WINDOWS" ),
414
+ 'debug-compile' , 'sasl' , 'winssl' ], SASL = "AUTO" , SSL = "WINDOWS" ),
413
415
CompileWithClientSideEncryptionAsan ('debug-compile-asan-openssl-cse' , tags = [
414
- 'debug-compile' , 'asan-clang' ], SSL = "OPENSSL" ),
415
- CompileTask ('debug-compile-nosasl-openssl-1.0.1' ,
416
- prefix_commands = [func ("install ssl" , SSL = "openssl-1.0.1u" )],
417
- CFLAGS = "-Wno-redundant-decls" , SSL = "OPENSSL" , SASL = "OFF" )
416
+ 'debug-compile' , 'asan-clang' ], SSL = "OPENSSL" ),
417
+ CompileTask ('debug-compile-nosasl-openssl-1.0.1' ,
418
+ prefix_commands = [func ("install ssl" , SSL = "openssl-1.0.1u" )],
419
+ CFLAGS = "-Wno-redundant-decls" , SSL = "OPENSSL" , SASL = "OFF" )
418
420
]
419
421
420
422
@@ -883,8 +885,10 @@ def _check_allowed(self):
883
885
884
886
all_tasks = chain (all_tasks , [aws_compile_task ])
885
887
888
+
886
889
class AWSTestTask (MatrixTask ):
887
- axes = OD ([('testcase' , ['regular' , 'ec2' , 'ecs' , 'lambda' , 'assume_role' ])])
890
+ axes = OD ([('testcase' , ['regular' , 'ec2' , 'ecs' , 'lambda' , 'assume_role' ]),
891
+ ('version' , ['latest' , '4.4' ])])
888
892
889
893
name_prefix = 'test-aws-openssl'
890
894
@@ -893,17 +897,20 @@ def __init__(self, *args, **kwargs):
893
897
self .add_dependency ('debug-compile-aws' )
894
898
self .commands .extend ([
895
899
func ('fetch build' , BUILD_NAME = self .depends_on ['name' ]),
896
- bootstrap (AUTH = "auth" , ORCHESTRATION_FILE = "auth-aws" , VERSION = "latest" , TOPOLOGY = "server" ),
900
+ bootstrap (AUTH = "auth" , ORCHESTRATION_FILE = "auth-aws" , VERSION = self . version , TOPOLOGY = "server" ),
897
901
func ('run aws tests' , TESTCASE = self .testcase .upper ())])
898
902
899
903
@property
900
904
def name (self ):
901
- return '-' .join ([self .name_prefix , self .testcase ])
905
+ return '-' .join ([self .name_prefix , self .testcase , self .version ])
906
+
902
907
903
908
all_tasks = chain (all_tasks , AWSTestTask .matrix ())
904
909
910
+
905
911
class OCSPTask (MatrixTask ):
906
- axes = OD ([('test' , ['test_1' , 'test_2' , 'test_3' , 'test_4' , 'soft_fail_test' , 'malicious_server_test_1' , 'malicious_server_test_2' , 'cache' ]),
912
+ axes = OD ([('test' , ['test_1' , 'test_2' , 'test_3' , 'test_4' , 'soft_fail_test' , 'malicious_server_test_1' ,
913
+ 'malicious_server_test_2' , 'cache' ]),
907
914
('delegate' , ['delegate' , 'nodelegate' ]),
908
915
('cert' , ['rsa' , 'ecdsa' ]),
909
916
('ssl' , ['openssl' , 'openssl-1.0.1' , 'darwinssl' , 'winssl' ])])
@@ -917,7 +924,8 @@ def __init__(self, *args, **kwargs):
917
924
918
925
@property
919
926
def name (self ):
920
- return 'ocsp-' + self .display ('ssl' ) + '-' + self .display ('test' ) + '-' + self .display ('cert' ) + '-' + self .display ('delegate' )
927
+ return 'ocsp-' + self .display ('ssl' ) + '-' + self .display ('test' ) + '-' + self .display (
928
+ 'cert' ) + '-' + self .display ('delegate' )
921
929
922
930
def to_dict (self ):
923
931
task = super (MatrixTask , self ).to_dict ()
@@ -926,9 +934,9 @@ def to_dict(self):
926
934
func ('fetch build' , BUILD_NAME = self .depends_on ['name' ]))
927
935
928
936
stapling = 'mustStaple'
929
- if self .test in [ 'test_3' , 'test_4' , 'soft_fail_test' , 'cache' ]:
937
+ if self .test in ['test_3' , 'test_4' , 'soft_fail_test' , 'cache' ]:
930
938
stapling = 'disableStapling'
931
- if self .test in [ 'malicious_server_test_1' , 'malicious_server_test_2' ]:
939
+ if self .test in ['malicious_server_test_1' , 'malicious_server_test_2' ]:
932
940
stapling = 'mustStaple-disableStapling'
933
941
934
942
orchestration_file = '%s-basic-tls-ocsp-%s' % (self .cert , stapling )
@@ -937,35 +945,36 @@ def to_dict(self):
937
945
# The cache test expects a revoked response from an OCSP responder, exactly like TEST_4.
938
946
test_column = 'TEST_4' if self .test == 'cache' else self .test .upper ()
939
947
940
- commands .append (shell_mongoc ('TEST_COLUMN=%s CERT_TYPE=%s USE_DELEGATE=%s sh .evergreen/run-ocsp-responder.sh' % (test_column , self .cert , 'on' if self .delegate == 'delegate' else 'off' )))
948
+ commands .append (shell_mongoc (
949
+ 'TEST_COLUMN=%s CERT_TYPE=%s USE_DELEGATE=%s sh .evergreen/run-ocsp-responder.sh' % (
950
+ test_column , self .cert , 'on' if self .delegate == 'delegate' else 'off' )))
941
951
commands .append (orchestration )
942
952
if self .test == 'cache' :
943
953
commands .append (shell_mongoc ('CERT_TYPE=%s .evergreen/run-ocsp-cache-test.sh' % self .cert ))
944
954
else :
945
- commands .append (shell_mongoc ('TEST_COLUMN=%s CERT_TYPE=%s sh .evergreen/run-ocsp-test.sh' % (self .test .upper (), self .cert )))
955
+ commands .append (shell_mongoc (
956
+ 'TEST_COLUMN=%s CERT_TYPE=%s sh .evergreen/run-ocsp-test.sh' % (self .test .upper (), self .cert )))
946
957
947
958
return task
948
959
949
960
# Testing in OCSP has a lot of exceptions.
950
961
def _check_allowed (self ):
951
962
if self .ssl == 'darwinssl' :
952
963
# Secure Transport quietly ignores a must-staple certificate with no stapled response.
953
- prohibit (self .test == 'malicious_server_test_2' )
964
+ prohibit (self .test == 'malicious_server_test_2' )
954
965
955
966
# ECDSA certs can't be loaded (in the PEM format they're stored) on Windows/macOS. Skip them.
956
967
if self .ssl == 'darwinssl' or self .ssl == 'winssl' :
957
- prohibit (self .cert == 'ecdsa' )
968
+ prohibit (self .cert == 'ecdsa' )
958
969
959
970
# OCSP stapling is not supported on macOS or Windows.
960
971
if self .ssl == 'darwinssl' or self .ssl == 'winssl' :
961
- prohibit (self .test in ['test_1' , 'test_2' , 'cache' ])
972
+ prohibit (self .test in ['test_1' , 'test_2' , 'cache' ])
962
973
963
974
if self .test == 'soft_fail_test' or self .test == 'malicious_server_test_2' or self .test == 'cache' :
964
975
prohibit (self .delegate == 'delegate' )
965
976
966
977
967
-
968
978
all_tasks = chain (all_tasks , OCSPTask .matrix ())
969
979
970
-
971
- all_tasks = list (all_tasks )
980
+ all_tasks = list (all_tasks )
0 commit comments