[Improvement](regression-test) generate user token by configured user and password rather than hard cord (#31345)

Co-authored-by: xy720 <22125576+xy720@users.noreply.github.com>
This commit is contained in:
Yulei-Yang
2024-02-28 14:06:04 +08:00
committed by yiguolei
parent d88caca44a
commit fa020b6696

View File

@ -69,8 +69,9 @@ suite("test_bloom_filter_hit") {
def dst = 'http://' + context.config.feHttpAddress
def conn = new URL(dst + url).openConnection()
conn.setRequestMethod("GET")
//token for root
conn.setRequestProperty("Authorization","Basic cm9vdDo=")
def encoding = Base64.getEncoder().encodeToString((context.config.feHttpUser + ":" +
(context.config.feHttpPassword == null ? "" : context.config.feHttpPassword)).getBytes("UTF-8"))
conn.setRequestProperty("Authorization", "Basic ${encoding}")
return conn.getInputStream().getText()
}