diff options
author | Erwin Pe <erwin.pe@mongodb.com> | 2022-01-26 23:12:39 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-26 23:45:02 +0000 |
commit | 621652e91925e944e9c13669a5c212bae7dfd662 (patch) | |
tree | 9d17437067bf9e847d1c51731b9eec014abaeb20 | |
parent | 90239f246867eb632ad03520dbe6856af50e5c7e (diff) | |
download | mongo-621652e91925e944e9c13669a5c212bae7dfd662.tar.gz |
SERVER-61595 CSFLE: test how gdb interacts with csfle library
-rw-r--r-- | etc/evergreen.yml | 113 | ||||
-rwxr-xr-x | evergreen/csfle_run_tests.sh | 40 |
2 files changed, 151 insertions, 2 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml index ab87e337a72..87530c535b3 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -2825,6 +2825,86 @@ tasks: content_type: ${content_type|application/tar} display_name: "Mongo CSFLE Library" +- name: csfle_create_debug_lib + tags: [] + commands: + - *f_expansions_write + - func: "scons compile" + vars: + targets: archive-mongo-csfle-dev archive-mongo-csfle-debug + task_compile_flags: >- + --dbg=on + --opt=off + --allocator=system + --enable-free-mon=off + --enterprise-features=fle + --js-engine=none + --link-model=dynamic-sdk + DESTDIR='$BUILD_ROOT/csfle-lib-$MONGO_VERSION' + - command: s3.put + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + local_file: "src/mongo-csfle-dev.${ext|tgz}" + remote_file: "${project}/mongo_csfle/${build_variant}/${revision}/mongo_csfle_v1_dev-${version}.${ext|tgz}" + bucket: mciuploads + permissions: public-read + content_type: ${content_type|application/tar} + display_name: "Mongo CSFLE Library dev" + - command: s3.put + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + local_file: "src/mongo-csfle-debug.${ext|tgz}" + remote_file: "${project}/mongo_csfle/${build_variant}/${revision}/mongo_csfle_v1_debug-${version}.${ext|tgz}" + bucket: mciuploads + permissions: public-read + content_type: ${content_type|application/tar} + display_name: "Mongo CSFLE Library debug" + +- name: csfle_install_tests + tags: [] + depends_on: + - name: csfle_create_debug_lib + commands: + - *f_expansions_write + - func: "scons compile" + vars: + targets: archive-mongo-csfle-shlib-test + compiling_for_test: true + task_install_action: + default + task_compile_flags: >- + --allocator=system + --enable-free-mon=off + --enterprise-features=fle + --js-engine=none + --link-model=static + DESTDIR='$BUILD_ROOT/csfle-lib-$MONGO_VERSION' + - command: s3.put + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + local_file: "src/mongo-csfle-shlib-test-runtime.${ext|tgz}" + remote_file: "${project}/mongo_csfle/${build_variant}/${revision}/mongo_csfle_shlib_test-${version}.${ext|tgz}" + bucket: mciuploads + permissions: public-read + content_type: ${content_type|application/tar} + display_name: "Mongo CSFLE Shared Library Test" + +- name: csfle_run_tests + tags: [] + depends_on: + - name: csfle_install_tests + commands: + - *f_expansions_write + - command: subprocess.exec + type: test + params: + binary: bash + args: + - "src/evergreen/csfle_run_tests.sh" + - name: compile_benchmarks tags: [] depends_on: [] @@ -7301,6 +7381,36 @@ task_groups: tasks: - "csfle_create_lib" +- name: csfle_build_debug_and_test + setup_task: + - func: "f_expansions_write" + - func: "apply compile expansions" + - func: "set task expansion macros" + - func: "f_expansions_write" + teardown_task: + - func: "attach scons logs" + setup_group_can_fail_task: true + setup_group: + - command: manifest.load + - func: "git get project and add git tag" + - func: "set task expansion macros" + - func: "f_expansions_write" + - func: "kill processes" + - func: "cleanup environment" + - func: "set up venv" + - func: "upload pip requirements" + - func: "get buildnumber" + - func: "f_expansions_write" + - func: "set up win mount script" + - func: "generate compile expansions" + teardown_group: + - func: "umount shared scons directory" + max_hosts: 1 + tasks: + - "csfle_create_debug_lib" + - "csfle_install_tests" + - "csfle_run_tests" + ####################################### # Modules # ####################################### @@ -9503,6 +9613,9 @@ buildvariants: - name: .csfle distros: - rhel80-xlarge + - name: csfle_build_debug_and_test + distros: + - rhel80-xlarge - name: .updatefuzzer - name: secondary_reads_passthrough_gen - name: server_discovery_and_monitoring_json_test_TG diff --git a/evergreen/csfle_run_tests.sh b/evergreen/csfle_run_tests.sh index e1391a8cdd6..c940daa8575 100755 --- a/evergreen/csfle_run_tests.sh +++ b/evergreen/csfle_run_tests.sh @@ -16,12 +16,24 @@ if [ "$(uname)" != "Linux" ]; then exit 0 fi -SOPATH="build/csfle-lib-${version}/lib/mongo_csfle_v1.so" -if [ ! -e "$SOPATH" ]; then +EXTRACT_DIR="build/csfle-lib-${version}" +SOPATH="${EXTRACT_DIR}/lib/mongo_csfle_v1.so" +UNITTEST_PATH="${EXTRACT_DIR}/bin/mongo_csfle_shlib_test" +GDB_PATH="/opt/mongodbtoolchain/v3/bin/gdb" + +# dump the contents of the extract dir to log +find $EXTRACT_DIR + +if [ ! -f "$SOPATH" ]; then echo "Error: can not find library at: $SOPATH" exit 1 fi +# +# Check the set of exported symbols match the expected set of symbols +# +echo "Running CSFLE exported symbols test" + expect='A MONGO_CSFLE_1.0 T mongo_csfle_v1_analyze_query T mongo_csfle_v1_bson_free @@ -43,3 +55,27 @@ if [ "$actual" != "$expect" ]; then diff <(echo "$actual") <(echo "$expect") exit 1 fi + +echo "CSFLE exported symbols test succeeded!" + +# +# If the shared library version of the unit tests exists, run it, +# and the verify it can be debugged with gdb +# +if [ ! -f "$UNITTEST_PATH" ]; then + echo "Skipping CSFLE shared library unit test. Test not found at $UNITTEST_PATH" + exit 0 +fi + +echo "Running CSFLE shared library unit test" +$UNITTEST_PATH +echo "CSFLE shared library unit test succeeded!" + +if [ ! -f "$GDB_PATH" ]; then + echo "Skipping CSFLE debuggability test. No gdb found at $GDB_PATH" + exit 0 +fi + +echo "Running CSFLE shared library debuggability test" +$GDB_PATH "$UNITTEST_PATH" --batch -ex "source ${EXTRACT_DIR}/csfle_debuggability_test.py" +echo "CSFLE shared library debuggability test succeeded!" |