Skip to content

Commit 3346a69

Browse files
Merge pull request #2171 from periklis/fix-multi-tenancy-test
Fix multitenancy check of project users to infra indices
2 parents 61b666f + 658b712 commit 3346a69

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

hack/testing/util.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ EOF
232232
function get_test_user_token() {
233233
local current_project; current_project="$( oc project -q )"
234234
create_users ${1:-${LOG_ADMIN_USER:-admin}} ${2:-${LOG_ADMIN_PW:-admin}} ${3:-true}
235-
oc login --username=${1:-${LOG_ADMIN_USER:-admin}} --password=${2:-${LOG_ADMIN_PW:-admin}} > /dev/null
235+
oc login --username="${1:-${LOG_ADMIN_USER:-admin}}" --password="${2:-${LOG_ADMIN_PW:-admin}}" > /dev/null
236236
test_token="$(oc whoami -t)"
237237
test_name="$(oc whoami)"
238238
test_ip="127.0.0.1"

test/multi_tenancy.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ function test_user_has_proper_access() {
156156
exit 1
157157
fi
158158

159-
# verify normal user has no access to .operations
160-
os::log::info See if user $user is denied /.operations.*
159+
# verify normal user has no access to infra
160+
os::log::info See if user $user is denied /infra*
161161
get_test_user_token $user $pw false
162-
nrecs=$( curl_es_pod_from_kibana_with_token $kpod $eshost "/.operations.*/_count" $test_token -XPOST | \
162+
nrecs=$( curl_es_pod_from_kibana_with_token $kpod $eshost "/infra*/_count" $test_token -XPOST | \
163163
get_count_from_json )
164164
if ! os::cmd::expect_success "test $nrecs = 0" ; then
165-
os::log::error $LOG_NORMAL_USER has improper access to .operations.* indices
166-
curl_es_pod_from_kibana_with_token $kpod $eshost "/.operations.*/_count" $test_token -XPOST | python -mjson.tool
165+
os::log::error $LOG_NORMAL_USER has improper access to infra* indices
166+
curl_es_pod_from_kibana_with_token $kpod $eshost "/infra*/_count" $test_token -XPOST | python -mjson.tool
167167
exit 1
168168
fi
169169
}

0 commit comments

Comments
 (0)