-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ownership): change Kong permissions to be kong:root
- Loading branch information
Showing
5 changed files
with
60 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
function run_test { | ||
# the suite name below will only be used when running this file directly, when | ||
# running through "test.sh" it must be provided using the "--suite" option. | ||
tinitialize "Docker-Kong test suite" "${BASH_SOURCE[0]}" | ||
|
||
tchapter "ownership is root:kong" | ||
|
||
|
||
for filename in \ | ||
/usr/local/share/lua/5.1/ \ | ||
/usr/local/share/lua/5.1/kong/plugins/ \ | ||
/usr/local/lib/lua/5.1/ \ | ||
/usr/local/lib/luarocks/rocks-5.1/ | ||
do | ||
ttest "owenership $filename" | ||
local USR | ||
local GRP | ||
USR=$(docker run -ti --rm "kong-$BASE" ls -ld $filename | awk '{print $3}') | ||
GRP=$(docker run -ti --rm "kong-$BASE" ls -ld $filename | awk '{print $4}') | ||
if [ "$USR:$GRP" == "root:kong" ]; then | ||
tsuccess | ||
else | ||
tmessage "user and group found to be $USR:$GRP" | ||
tfailure | ||
fi | ||
done | ||
|
||
tfinish | ||
} | ||
|
||
# No need to modify anything below this comment | ||
|
||
# shellcheck disable=SC1090 # do not follow source | ||
[[ "$T_PROJECT_NAME" == "" ]] && set -e && if [[ -f "${1:-$(dirname "$(realpath "$0")")/test.sh}" ]]; then source "${1:-$(dirname "$(realpath "$0")")/test.sh}"; else source "${1:-$(dirname "$(realpath "$0")")/run.sh}"; fi && set +e | ||
run_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters