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 | |
parent | 0edcbe9786a9ada4dd98bf158c9f5c31e9354612 (diff) | |
download | mongo-0fdf27b6bb98760750ba41b0c246e04d395f3f2b.tar.gz |
SERVER-66488 Update selinux tests to use shell from archive_dist_test
-rw-r--r-- | etc/evergreen_yml_components/definitions.yml | 12 | ||||
-rwxr-xr-x | evergreen/selinux_test_executor.sh | 15 | ||||
-rwxr-xr-x | evergreen/selinux_test_setup.sh | 9 |
3 files changed, 25 insertions, 11 deletions
diff --git a/etc/evergreen_yml_components/definitions.yml b/etc/evergreen_yml_components/definitions.yml index 90e27290f8a..565ba1d57b6 100644 --- a/etc/evergreen_yml_components/definitions.yml +++ b/etc/evergreen_yml_components/definitions.yml @@ -6127,6 +6127,7 @@ tasks: - name: selinux_rhel8_org tags: [] depends_on: + - name: archive_dist_test - name: package commands: - command: manifest.load @@ -6134,6 +6135,8 @@ tasks: - *f_expansions_write - func: "set up venv" - func: "fetch packages" + - func: "fetch binaries" + - func: "extract binaries" - func: "run selinux tests" vars: distro: rhel80-selinux @@ -6142,6 +6145,7 @@ tasks: - name: selinux_rhel8_enterprise tags: [] depends_on: + - name: archive_dist_test - name: package commands: - command: manifest.load @@ -6149,6 +6153,8 @@ tasks: - *f_expansions_write - func: "set up venv" - func: "fetch packages" + - func: "fetch binaries" + - func: "extract binaries" - func: "run selinux tests" vars: distro: rhel80-selinux @@ -6157,6 +6163,7 @@ tasks: - name: selinux_rhel7_org tags: [] depends_on: + - name: archive_dist_test - name: package commands: - command: manifest.load @@ -6164,6 +6171,8 @@ tasks: - *f_expansions_write - func: "set up venv" - func: "fetch packages" + - func: "fetch binaries" + - func: "extract binaries" - func: "run selinux tests" vars: user: root @@ -6173,6 +6182,7 @@ tasks: - name: selinux_rhel7_enterprise tags: [] depends_on: + - name: archive_dist_test - name: package commands: - command: manifest.load @@ -6180,6 +6190,8 @@ tasks: - *f_expansions_write - func: "set up venv" - func: "fetch packages" + - func: "fetch binaries" + - func: "extract binaries" - func: "run selinux tests" vars: user: root 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 |