You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/09/18 14:55:42 UTC

[incubator-openwhisk-cli] 14/16: Test change for api host setting which previously caused CLI to crash.

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

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

commit a8e3016ad1edb3d44652d99c4e11d5cec9937de7
Author: Rodric Rabbah <ra...@us.ibm.com>
AuthorDate: Thu Sep 7 23:20:58 2017 -0400

    Test change for api host setting which previously caused CLI to crash.
---
 .../scala/whisk/core/cli/test/WskConfigTests.scala  | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala
index 90b014d..8e34aea 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala
@@ -259,6 +259,27 @@ class WskConfigTests extends TestHelpers with WskTestHelpers {
     }
   }
 
+  it should "set api host with or without http prefix" in {
+    val tmpwskprops = File.createTempFile("wskprops", ".tmp")
+    try {
+      val env = Map("WSK_CONFIG_FILE" -> tmpwskprops.getAbsolutePath())
+      Seq("", "http://", "https://").foreach { prefix =>
+        Seq("10", "10:123", "aaa", "aaa:123").foreach { host =>
+          val apihost = s"$prefix$host"
+          withClue(apihost) {
+            val rr = wsk.cli(Seq("property", "set", "--apihost", apihost), env = env)
+            rr.stdout.trim shouldBe s"ok: whisk API host set to $apihost"
+            rr.stderr shouldBe 'empty
+            val fileContent = FileUtils.readFileToString(tmpwskprops)
+            fileContent should include(s"APIHOST=$apihost")
+          }
+        }
+      }
+    } finally {
+      tmpwskprops.delete()
+    }
+  }
+
   it should "set auth in property file" in {
     val tmpwskprops = File.createTempFile("wskprops", ".tmp")
     val env = Map("WSK_CONFIG_FILE" -> tmpwskprops.getAbsolutePath())

-- 
To stop receiving notification emails like this one, please contact
"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>.