Skip to content

Commit e9c213d

Browse files
David Cariellodubee
authored andcommitted
Allow exclusion of api_host validation (#276)
1 parent dfdf854 commit e9c213d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/src/test/scala/whisk/core/cli/test/WskCliBasicUsageTests.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class WskCliBasicUsageTests extends TestHelpers with WskTestHelpers {
5757
val wsk = new Wsk
5858
val defaultAction = Some(TestUtils.getTestActionFilename("hello.js"))
5959
val usrAgentHeaderRegEx = """\bUser-Agent\b": \[\s+"OpenWhisk\-CLI/1.\d+.*"""
60+
// certain environments may return router IP address instead of api_host string causing a failure
61+
// Set apiHostCheck to false to avoid apihost check
62+
val apiHostCheck = true
6063

6164
behavior of "Wsk CLI usage"
6265

@@ -555,7 +558,9 @@ class WskCliBasicUsageTests extends TestHelpers with WskTestHelpers {
555558
withActivation(wsk.activation, run) { activation =>
556559
activation.response.status shouldBe "success"
557560
val fields = activation.response.result.get.convertTo[Map[String, String]]
558-
fields("api_host") shouldBe WhiskProperties.getApiHostForAction
561+
if (apiHostCheck) {
562+
fields("api_host") shouldBe WhiskProperties.getApiHostForAction
563+
}
559564
fields("api_key") shouldBe wskprops.authKey
560565
fields("namespace") shouldBe namespace
561566
fields("action_name") shouldBe s"/$namespace/$name"

0 commit comments

Comments
 (0)