diff --git a/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala b/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala index 8e870efe7..2217e80a5 100644 --- a/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala +++ b/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala @@ -23,6 +23,7 @@ import javax.security.auth.login.Configuration import scala.collection.JavaConverters._ +import org.apache.hadoop.util.StringUtils import org.apache.zookeeper.ZooDefs import org.scalatest.time.SpanSugar._ @@ -125,8 +126,8 @@ class ServiceDiscoverySuite extends KerberizedTestHelper { assert(entries.head.getLoginModuleName === "com.sun.security.auth.module.Krb5LoginModule") val options = entries.head.getOptions.asScala.toMap - assert(options("principal") === - s"kentyao/${InetAddress.getLocalHost.getCanonicalHostName}@apache.org") + val hostname = StringUtils.toLowerCase(InetAddress.getLocalHost.getCanonicalHostName) + assert(options("principal") === s"kentyao/$hostname@apache.org") assert(options("useKeyTab").toString.toBoolean) conf.set(KyuubiConf.SERVER_KEYTAB, keytab.getName)