Esempio n. 1
0
 def __init__(self, *args, **kwargs):
     super(AWSTestTask, self).__init__(*args, **kwargs)
     self.add_dependency('debug-compile-aws')
     self.commands.extend([
         func('fetch build', BUILD_NAME=self.depends_on['name']),
         bootstrap(AUTH="auth", ORCHESTRATION_FILE="auth-aws", VERSION=self.version, TOPOLOGY="server"),
         func('run aws tests', TESTCASE=self.testcase.upper())])
Esempio n. 2
0
    def to_dict(self):
        task = super(IntegrationTask, self).to_dict()
        commands = task['commands']
        if self.depends_on:
            commands.append(
                func('fetch build', BUILD_NAME=self.depends_on['name']))
        if self.coverage:
            commands.append(
                func('debug-compile-coverage-notest-%s-%s' %
                     (self.display('sasl'), self.display('ssl'))))
        commands.append(
            bootstrap(VERSION=self.version,
                      TOPOLOGY=self.topology,
                      AUTH='auth' if self.auth else 'noauth',
                      SSL=self.display('ssl')))
        extra = {}
        if self.cse:
            extra["CLIENT_SIDE_ENCRYPTION"] = "on"
        commands.append(
            run_tests(VALGRIND=self.on_off('valgrind'),
                      ASAN=self.on_off('asan'),
                      AUTH=self.display('auth'),
                      SSL=self.display('ssl'),
                      **extra))
        if self.coverage:
            commands.append(func('update codecov.io'))

        return task
Esempio n. 3
0
    def to_dict(self):
        task = super(MatrixTask, self).to_dict()
        commands = task['commands']
        commands.append(
            func('fetch build', BUILD_NAME=self.depends_on['name']))

        orchestration = bootstrap(TOPOLOGY='sharded_cluster' if self.loadbalanced else 'replica_set',
                                  AUTH='auth' if self.auth else 'noauth',
                                  SSL='ssl')

        if self.auth:
            orchestration['vars']['AUTHSOURCE'] = 'thisDB'

        commands.append(orchestration)

        dns = 'on'
        if self.loadbalanced:
            dns = 'loadbalanced'
            commands.append (func("clone drivers-evergreen-tools"))
            commands.append (func("start load balancer", MONGODB_URI="mongodb://localhost:27017,localhost:27018"))
        elif self.auth:
            dns = 'dns-auth'
        commands.append(run_tests(SSL='ssl',
                                  AUTH=self.display('auth'),
                                  DNS=dns))

        return task
Esempio n. 4
0
    def __init__(self,
                 version,
                 patch,
                 cflags=None,
                 fips=False,
                 enable_ssl=False,
                 **kwargs):
        full_version = version + patch + ('-fips' if fips else '')
        script = ''
        if cflags:
            script += 'export CFLAGS=%s\n' % (cflags, )

        script += "DEBUG=ON CC='${CC}' MARCH='${MARCH}' SASL=OFF"
        if enable_ssl:
            script += " SSL=" + enable_ssl
        elif 'libressl' in version:
            script += " SSL=LIBRESSL"
        else:
            script += " SSL=OPENSSL"

        if fips:
            script += " OPENSSL_FIPS=1"

        script += " sh .evergreen/compile.sh"

        super(SSLTask, self).__init__(commands=[
            func('install ssl', SSL=full_version),
            shell_mongoc(script),
            func('run auth tests', **kwargs),
            func('upload build')
        ])

        self.version = version
        self.fips = fips
        self.enable_ssl = enable_ssl
Esempio n. 5
0
    def __init__(self, *args, **kwargs):
        super(AuthTask, self).__init__(*args, **kwargs)
        self.add_tags('authentication-tests', self.display('ssl'),
                      self.display('sasl'))

        self.add_dependency('debug-compile-%s-%s' %
                            (self.display('sasl'), self.display('ssl')))

        self.commands.extend([
            func('fetch build', BUILD_NAME=self.depends_on['name']),
            func('run auth tests')
        ])
Esempio n. 6
0
    def to_dict(self):
        task = super(MatrixTask, self).to_dict()
        commands = task['commands']
        commands.append(
            func('fetch build', BUILD_NAME=self.depends_on['name']))

        stapling = 'mustStaple'
        if self.test in ['test_3', 'test_4', 'soft_fail_test', 'cache']:
            stapling = 'disableStapling'
        if self.test in ['malicious_server_test_1', 'malicious_server_test_2']:
            stapling = 'mustStaple-disableStapling'

        orchestration_file = '%s-basic-tls-ocsp-%s' % (self.cert, stapling)
        orchestration = bootstrap(VERSION=self.version, TOPOLOGY='server', SSL='ssl', OCSP='on', ORCHESTRATION_FILE=orchestration_file)

        # The cache test expects a revoked response from an OCSP responder, exactly like TEST_4.
        test_column = 'TEST_4' if self.test == 'cache' else self.test.upper()

        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')))
        commands.append(orchestration)
        if self.test == 'cache':
            commands.append(shell_mongoc('CERT_TYPE=%s .evergreen/run-ocsp-cache-test.sh' % self.cert))
        else:
            commands.append(shell_mongoc(
                'TEST_COLUMN=%s CERT_TYPE=%s sh .evergreen/run-ocsp-test.sh' % (self.test.upper(), self.cert)))

        return task
Esempio n. 7
0
    def to_dict(self):
        task = super(MatrixTask, self).to_dict()
        commands = task['commands']
        commands.append(func('fetch build',
                             BUILD_NAME=self.depends_on['name']))

        stapling = 'mustStaple'
        if self.test in ['test_3', 'test_4', 'soft_fail_test']:
            stapling = 'disableStapling'
        if self.test in ['malicious_server_test_1', 'malicious_server_test_2']:
            stapling = 'mustStaple-disableStapling'

        orchestration_file = '%s-basic-tls-ocsp-%s' % (self.cert, stapling)
        orchestration = bootstrap(TOPOLOGY='server',
                                  SSL='ssl',
                                  OCSP='on',
                                  ORCHESTRATION_FILE=orchestration_file)

        commands.append(
            shell_mongoc(
                'TEST_COLUMN=%s CERT_TYPE=%s USE_DELEGATE=%s sh .evergreen/run-ocsp-responder.sh'
                % (self.test.upper(), self.cert,
                   'on' if self.delegate == 'delegate' else 'off')))
        commands.append(orchestration)
        commands.append(
            shell_mongoc(
                'TEST_COLUMN=%s CERT_TYPE=%s sh .evergreen/run-ocsp-test.sh' %
                (self.test.upper(), self.cert)))

        return task
Esempio n. 8
0
 def __init__(self, task_name, depends_on='debug-compile-sasl-openssl',
              suffix_commands=None, uri=None,
              tags=None, version='latest', topology='server'):
     commands = [func('fetch build', BUILD_NAME=depends_on),
                 bootstrap(VERSION=version, TOPOLOGY=topology),
                 run_tests(uri)] + (suffix_commands or [])
     super(SpecialIntegrationTask, self).__init__(task_name,
                                                  commands=commands,
                                                  depends_on=depends_on,
                                                  tags=tags)
Esempio n. 9
0
 def __init__(self, *args, **kwargs):
     super(IPTask, self).__init__(*args, **kwargs)
     self.add_tags('nossl', 'nosasl', 'server', 'ipv4-ipv6', 'latest')
     self.add_dependency('debug-compile-nosasl-nossl')
     self.commands.extend([
         func('fetch build', BUILD_NAME=self.depends_on['name']),
         bootstrap(IPV4_ONLY=self.on_off(server='ipv4')),
         run_tests(IPV4_ONLY=self.on_off(server='ipv4'),
                   URI={'ipv6': 'mongodb://[::1]/',
                        'ipv4': 'mongodb://127.0.0.1/',
                        'localhost': 'mongodb://localhost/'}[self.client])])
Esempio n. 10
0
    def to_dict(self):
        task = super(CompileTask, self).to_dict()

        script = ''
        for opt, value in sorted(self.compile_sh_opt.items()):
            script += 'export %s="%s"\n' % (opt, value)

        script += "CC='${CC}' MARCH='${MARCH}' sh .evergreen/compile.sh"
        task['commands'].append(shell_mongoc(script))
        task['commands'].append(func('upload build'))
        task['commands'].extend(self.extra_commands)
        return task
Esempio n. 11
0
    def to_dict(self):
        task = super(MatrixTask, self).to_dict()
        commands = task['commands']
        commands.append(
            func('fetch build', BUILD_NAME=self.depends_on['name']))


        orchestration = bootstrap(TOPOLOGY='sharded_cluster',
                                  AUTH='auth' if self.test_auth else 'noauth',
                                  SSL='ssl' if self.test_ssl else 'nossl',
                                  VERSION=self.version)
        commands.append(orchestration)
        commands.append (func("clone drivers-evergreen-tools"))
        commands.append (func("start load balancer",
            MONGODB_URI="mongodb://localhost:27017,localhost:27018"))
        commands.append(run_tests(ASAN='on' if self.asan else 'off',
                                  SSL='ssl' if self.test_ssl else 'nossl',
                                  AUTH='auth' if self.test_auth else 'noauth',
                                  LOADBALANCED='loadbalanced'))

        return task
Esempio n. 12
0
    def to_dict(self):
        task = super(MatrixTask, self).to_dict()
        commands = task['commands']
        commands.append(
            func('fetch build', BUILD_NAME=self.depends_on['name']))

        orchestration = bootstrap(TOPOLOGY='replica_set',
                                  AUTH='auth' if self.auth else 'noauth',
                                  SSL='ssl')

        if self.auth:
            orchestration['vars']['AUTHSOURCE'] = 'thisDB'

        commands.append(orchestration)
        commands.append(run_tests(SSL='ssl',
                                  AUTH=self.display('auth'),
                                  DNS='dns-auth' if self.auth else 'on'))

        return task
Esempio n. 13
0
    def to_dict(self):
        task = super(CompressionTask, self).to_dict()
        commands = task['commands']
        commands.append(func('fetch build',
                             BUILD_NAME=self.depends_on['name']))
        if self.compression == 'compression':
            orchestration_file = 'snappy-zlib-zstd'
        else:
            orchestration_file = self.compression

        commands.append(
            bootstrap(AUTH='noauth',
                      SSL='nossl',
                      ORCHESTRATION_FILE=orchestration_file))
        commands.append(
            run_tests(AUTH='noauth',
                      SSL='nossl',
                      COMPRESSORS=','.join(self._compressor_list())))

        return task
Esempio n. 14
0
 def __init__(self, *args, **kwargs):
     super(PostCompileTask, self).__init__(*args, **kwargs)
     self.commands.insert(
         0, func('fetch build', BUILD_NAME=self.depends_on['name']))
Esempio n. 15
0
 SpecialTask('debug-compile-c99',
             tags=['debug-compile', 'c99', 'stdflags'],
             CFLAGS='-std=c99 -D_XOPEN_SOURCE=600'),
 SpecialTask('debug-compile-c89',
             tags=['debug-compile', 'c89', 'stdflags'],
             CFLAGS='-std=c89 -D_POSIX_C_SOURCE=200112L -pedantic'),
 SpecialTask('debug-compile-valgrind',
             tags=['debug-compile', 'valgrind'],
             SASL='OFF',
             SSL='OPENSSL',
             VALGRIND='ON',
             CFLAGS='-DBSON_MEMCHECK'),
 SpecialTask('debug-compile-coverage',
             tags=['debug-compile', 'coverage'],
             COVERAGE='ON',
             extra_commands=[func('upload coverage')]),
 CompileTask('debug-compile-no-counters',
             tags=['debug-compile', 'no-counters'],
             ENABLE_SHM_COUNTERS='OFF'),
 SpecialTask('debug-compile-asan-clang',
             tags=['debug-compile', 'asan-clang'],
             compression='zlib',
             CC='clang-3.8',
             CFLAGS='-fsanitize=address -fno-omit-frame-pointer'
             ' -DBSON_MEMCHECK',
             CHECK_LOG='ON',
             EXTRA_CONFIGURE_FLAGS='-DENABLE_EXTRA_ALIGNMENT=OFF',
             PATH='/usr/lib/llvm-3.8/bin:$PATH'),
 # include -pthread in CFLAGS on gcc to address the issue explained here:
 # https://groups.google.com/forum/#!topic/address-sanitizer/JxnwgrWOLuc
 SpecialTask('debug-compile-asan-gcc',
Esempio n. 16
0
 SpecialTask('debug-compile-c99',
             tags=['debug-compile', 'c99', 'stdflags'],
             CFLAGS='-std=c99 -D_XOPEN_SOURCE=600'),
 SpecialTask('debug-compile-c89',
             tags=['debug-compile', 'c89', 'stdflags'],
             CFLAGS='-std=c89 -D_POSIX_C_SOURCE=200112L -pedantic'),
 SpecialTask('debug-compile-valgrind',
             tags=['debug-compile', 'valgrind'],
             SASL='OFF',
             SSL='OPENSSL',
             VALGRIND='ON',
             CFLAGS='-DBSON_MEMCHECK'),
 SpecialTask('debug-compile-coverage',
             tags=['debug-compile', 'coverage'],
             COVERAGE='ON',
             suffix_commands=[func('upload coverage')]),
 CompileTask('debug-compile-no-counters',
             tags=['debug-compile', 'no-counters'],
             ENABLE_SHM_COUNTERS='OFF'),
 SpecialTask('debug-compile-asan-clang',
             tags=['debug-compile', 'asan-clang'],
             compression='zlib',
             CC='clang-3.8',
             CFLAGS='-fsanitize=address -fno-omit-frame-pointer'
             ' -DBSON_MEMCHECK',
             CHECK_LOG='ON',
             EXTRA_CONFIGURE_FLAGS='-DENABLE_EXTRA_ALIGNMENT=OFF',
             PATH='/usr/lib/llvm-3.8/bin:$PATH'),
 # include -pthread in CFLAGS on gcc to address the issue explained here:
 # https://groups.google.com/forum/#!topic/address-sanitizer/JxnwgrWOLuc
 SpecialTask('debug-compile-asan-gcc',
Esempio n. 17
0
 def __init__(self, task_name, *args, **kwargs):
     commands = [func(func_name) for func_name in args]
     super(FuncTask, self).__init__(task_name, commands=commands, **kwargs)
Esempio n. 18
0
 SpecialTask('debug-compile-c99',
             tags=['debug-compile', 'c99', 'stdflags'],
             CFLAGS='-std=c99 -D_XOPEN_SOURCE=600'),
 SpecialTask('debug-compile-c89',
             tags=['debug-compile', 'c89', 'stdflags'],
             CFLAGS='-std=c89 -D_POSIX_C_SOURCE=200112L -pedantic'),
 SpecialTask('debug-compile-valgrind',
             tags=['debug-compile', 'valgrind'],
             SASL='OFF',
             SSL='OPENSSL',
             VALGRIND='ON',
             CFLAGS='-DBSON_MEMCHECK'),
 SpecialTask('debug-compile-coverage',
             tags=['debug-compile', 'coverage'],
             COVERAGE='ON',
             suffix_commands=[func('upload coverage')]),
 CompileTask('debug-compile-no-counters',
             tags=['debug-compile', 'no-counters'],
             ENABLE_SHM_COUNTERS='OFF'),
 SpecialTask('debug-compile-asan-clang',
             tags=['debug-compile', 'asan-clang'],
             compression='zlib',
             CC='clang-3.8',
             CFLAGS='-fsanitize=address -fno-omit-frame-pointer'
                    ' -DBSON_MEMCHECK',
             CHECK_LOG='ON',
             EXTRA_CONFIGURE_FLAGS='-DENABLE_EXTRA_ALIGNMENT=OFF',
             PATH='/usr/lib/llvm-3.8/bin:$PATH'),
 # include -pthread in CFLAGS on gcc to address the issue explained here:
 # https://groups.google.com/forum/#!topic/address-sanitizer/JxnwgrWOLuc
 SpecialTask('debug-compile-asan-gcc',