You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by du...@apache.org on 2018/04/18 17:00:09 UTC

[incubator-openwhisk-cli] branch master updated: Allow exclusion of api_host validation (#276)

This is an automated email from the ASF dual-hosted git repository.

dubeejw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git


The following commit(s) were added to refs/heads/master by this push:
     new e9c213d  Allow exclusion of api_host validation (#276)
e9c213d is described below

commit e9c213d9192aedc085eb92f886c850bf63f55705
Author: David Cariello <dr...@us.ibm.com>
AuthorDate: Wed Apr 18 12:00:04 2018 -0500

    Allow exclusion of api_host validation (#276)
---
 .../src/test/scala/whisk/core/cli/test/WskCliBasicUsageTests.scala | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/src/test/scala/whisk/core/cli/test/WskCliBasicUsageTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskCliBasicUsageTests.scala
index 0e8ab1c..e3c38cf 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskCliBasicUsageTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskCliBasicUsageTests.scala
@@ -57,6 +57,9 @@ class WskCliBasicUsageTests extends TestHelpers with WskTestHelpers {
   val wsk = new Wsk
   val defaultAction = Some(TestUtils.getTestActionFilename("hello.js"))
   val usrAgentHeaderRegEx = """\bUser-Agent\b": \[\s+"OpenWhisk\-CLI/1.\d+.*"""
+  // certain environments may return router IP address instead of api_host string causing a failure
+  // Set apiHostCheck to false to avoid apihost check
+  val apiHostCheck = true
 
   behavior of "Wsk CLI usage"
 
@@ -555,7 +558,9 @@ class WskCliBasicUsageTests extends TestHelpers with WskTestHelpers {
     withActivation(wsk.activation, run) { activation =>
       activation.response.status shouldBe "success"
       val fields = activation.response.result.get.convertTo[Map[String, String]]
-      fields("api_host") shouldBe WhiskProperties.getApiHostForAction
+      if (apiHostCheck) {
+        fields("api_host") shouldBe WhiskProperties.getApiHostForAction
+      }
       fields("api_key") shouldBe wskprops.authKey
       fields("namespace") shouldBe namespace
       fields("action_name") shouldBe s"/$namespace/$name"

-- 
To stop receiving notification emails like this one, please contact
dubeejw@apache.org.