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:41 UTC

[incubator-openwhisk-cli] 13/16: CLI User Agent Header (#2591)

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 2038ba5507f79b6e953736e66e4343b52cab9d04
Author: David Cariello <dr...@us.ibm.com>
AuthorDate: Thu Sep 7 22:33:17 2017 -0500

    CLI User Agent Header (#2591)
---
 tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
index 03b4fc3..6514963 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
@@ -58,6 +58,7 @@ class WskBasicUsageTests extends TestHelpers with WskTestHelpers {
   implicit val wskprops = WskProps()
   val wsk = new Wsk
   val defaultAction = Some(TestUtils.getTestActionFilename("hello.js"))
+  val usrAgentHeaderRegEx = """\bUser-Agent\b": \[\s+"OpenWhisk\-CLI/1.\d+.*"""
 
   behavior of "Wsk CLI usage"
 
@@ -117,6 +118,11 @@ class WskBasicUsageTests extends TestHelpers with WskTestHelpers {
       wsk.action.get(fullQualifiedName).stdout should include(s"ok: got action ${packageName}/${actionName}")
   }
 
+  it should "include CLI user agent headers with outbound requests" in {
+    val stdout = wsk.cli(Seq("list", "--auth", wskprops.authKey) ++ wskprops.overrides, verbose = true).stdout
+    stdout should include regex (usrAgentHeaderRegEx)
+  }
+
   behavior of "Wsk actions"
 
   it should "reject creating entities with invalid names" in withAssetCleaner(wskprops) { (wp, assetHelper) =>

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