forked from baron/baron-sso
chore: snapshot local state before dev merge
This commit is contained in:
34
test/gpd_level_order_policy_test.sh
Normal file
34
test/gpd_level_order_policy_test.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
csv_path="$repo_root/gpd_level.csv"
|
||||
|
||||
fail() {
|
||||
echo "ERROR: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -f "$csv_path" ] || fail "gpd_level.csv must exist"
|
||||
|
||||
line_of() {
|
||||
local name="$1"
|
||||
local line
|
||||
line="$(awk -F, -v name="\"${name}\"" '$1 == name { print NR; exit }' "$csv_path")"
|
||||
[ -n "$line" ] || fail "gpd_level.csv must contain ${name}"
|
||||
printf '%s\n' "$line"
|
||||
}
|
||||
|
||||
vice_president_line="$(line_of "부사장")"
|
||||
executive_director_line="$(line_of "전무이사")"
|
||||
principal_researcher_line="$(line_of "수석 연구원")"
|
||||
|
||||
[ "$vice_president_line" -lt "$executive_director_line" ] || \
|
||||
fail "전무이사 must be below 부사장 in GPDTDC level order"
|
||||
[ "$executive_director_line" -lt "$principal_researcher_line" ] || \
|
||||
fail "전무이사 must be above 수석 연구원 in GPDTDC level order"
|
||||
|
||||
grep -Fxq '"전무이사","execdir"' "$csv_path" || \
|
||||
fail "전무이사 external key must be execdir"
|
||||
|
||||
echo "OK: GPDTDC level order includes 전무이사 between 부사장 and 수석 연구원"
|
||||
Reference in New Issue
Block a user