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 /evergreen | |
parent | 90239f246867eb632ad03520dbe6856af50e5c7e (diff) | |
download | mongo-621652e91925e944e9c13669a5c212bae7dfd662.tar.gz |
SERVER-61595 CSFLE: test how gdb interacts with csfle library
Diffstat (limited to 'evergreen')
-rwxr-xr-x | evergreen/csfle_run_tests.sh | 40 |
1 files changed, 38 insertions, 2 deletions
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!" |