diff options
author | sergey.galtsev <sergey.galtsev@mongodb.com> | 2022-05-17 13:22:57 -0700 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-18 19:33:29 +0000 |
commit | 0fdf27b6bb98760750ba41b0c246e04d395f3f2b (patch) | |
tree | 5b56aba7f47734e60a93ec7ab8e13b35c7c29d93 /evergreen | |
parent | 0edcbe9786a9ada4dd98bf158c9f5c31e9354612 (diff) | |
download | mongo-0fdf27b6bb98760750ba41b0c246e04d395f3f2b.tar.gz |
SERVER-66488 Update selinux tests to use shell from archive_dist_test
Diffstat (limited to 'evergreen')
-rwxr-xr-x | evergreen/selinux_test_executor.sh | 15 | ||||
-rwxr-xr-x | evergreen/selinux_test_setup.sh | 9 |
2 files changed, 13 insertions, 11 deletions
diff --git a/evergreen/selinux_test_executor.sh b/evergreen/selinux_test_executor.sh index 1ba889a1c80..a0616d314d6 100755 --- a/evergreen/selinux_test_executor.sh +++ b/evergreen/selinux_test_executor.sh @@ -3,6 +3,13 @@ set -o errexit set -o xtrace +mongo="$(pwd)/dist-test/bin/mongo" +export PATH="$(dirname "$mongo"):$PATH" +if [ ! -f "$mongo" ]; then + echo "Mongo shell at $mongo is missing" + exit 1 +fi + function print() { echo "$@" >&2 } @@ -19,7 +26,7 @@ if [ ! -f "$TEST_PATH" ]; then fi # test file is even good before going on -if ! mongo --nodb --norc --quiet "$TEST_PATH"; then +if ! "$mongo" --nodb --norc --quiet "$TEST_PATH"; then print "File $TEST_PATH has syntax errors" exit 1 fi @@ -42,14 +49,14 @@ sudo --non-interactive bash -c ' ' # create mongo config -mongo --nodb --norc --quiet --eval=' +"$mongo" --nodb --norc --quiet --eval=' assert(load("'"$TEST_PATH"'")); const test = new TestDefinition(); print(typeof(test.config) === "string" ? test.config : JSON.stringify(test.config, null, 2)); ' | sudo --non-interactive tee /etc/mongod.conf # setup -mongo --nodb --norc --quiet --eval=' +"$mongo" --nodb --norc --quiet --eval=' assert(load("'"$TEST_PATH"'")); const test = new TestDefinition(); jsTest.log("Running setup()"); @@ -78,7 +85,7 @@ sudo --non-interactive systemctl start mongod \ ) # run test and teardown -mongo --norc --gssapiServiceName=mockservice --eval=' +"$mongo" --norc --gssapiServiceName=mockservice --eval=' assert(load("'"$TEST_PATH"'")); // name is such to prevent collisions const test_812de7ce = new TestDefinition(); diff --git a/evergreen/selinux_test_setup.sh b/evergreen/selinux_test_setup.sh index ef2e70df2a9..b3af052617a 100755 --- a/evergreen/selinux_test_setup.sh +++ b/evergreen/selinux_test_setup.sh @@ -30,14 +30,9 @@ if [ "$SEORDER" == "0" ]; then apply_selinux_policy fi -# install shell using yum, so that dependencies are pulled -pkg="$(find "$HOME"/repo -name 'mongodb-*-shell-*.x86_64.rpm' | tee /dev/stderr)" -sudo --non-interactive yum install --assumeyes "$pkg" \ - || if [ "$?" -gt "1" ]; then exit 1; fi # exit code 1 is OK - pkg="$(find "$HOME"/repo -name 'mongodb-*-server-*.x86_64.rpm' | tee /dev/stderr)" -sudo --non-interactive rpm --install --verbose --verbose --hash --nodeps "$pkg" \ - || if [ "$?" -gt "1" ]; then exit 1; fi # exit code 1 is OK +sudo --non-interactive rpm --install --verbose --verbose --hash --nodeps "$pkg" +if [ "$?" -gt "1" ]; then exit 1; fi # exit code 1 is OK if [ "$SEORDER" == "1" ]; then apply_selinux_policy |