openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk-cli] 14/16: Test change for api host setting which previously caused CLI to crash.
Date Mon, 18 Sep 2017 14:55:42 GMT
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 <rabbah@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" <commits@openwhisk.apache.org>.

Mime
View raw message