You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ra...@apache.org on 2018/07/27 18:35:36 UTC
[incubator-openwhisk] branch master updated: Add api gateway test
that uses custom package for action. (#2941)
This is an automated email from the ASF dual-hosted git repository.
rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new 1a3e15e Add api gateway test that uses custom package for action. (#2941)
1a3e15e is described below
commit 1a3e15ea95a48dae7ec17215b235b0167ff7137c
Author: John Sanda <js...@redhat.com>
AuthorDate: Fri Jul 27 14:35:33 2018 -0400
Add api gateway test that uses custom package for action. (#2941)
---
.../whisk/core/cli/test/ApiGwRestBasicTests.scala | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/tests/src/test/scala/whisk/core/cli/test/ApiGwRestBasicTests.scala b/tests/src/test/scala/whisk/core/cli/test/ApiGwRestBasicTests.scala
index f599675..97b903a 100644
--- a/tests/src/test/scala/whisk/core/cli/test/ApiGwRestBasicTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/ApiGwRestBasicTests.scala
@@ -899,4 +899,37 @@ abstract class ApiGwRestBasicTests extends BaseApiGwTests {
apiDelete(basepathOrApiName = testbasepath, expectedExitCode = DONTCARE_EXIT)
}
}
+
+ it should "verify get API name that uses custom package" in {
+ val testName = "CLI_APIGWTEST25"
+ val testbasepath = "/" + testName + "_bp"
+ val testrelpath = "/path"
+ val testnewrelpath = "/path_new"
+ val testurlop = "get"
+ val testapiname = testName + " API Name"
+ val packageName = withTimestamp("pkg")
+ val actionName = packageName + "/" + testName + "_action"
+ try {
+ wsk.pkg.create(packageName).stdout should include regex (s""""name":\\s*"$packageName"""")
+
+ // Create the action for the API. It must be a "web-action" action.
+ val file = TestUtils.getTestActionFilename(s"echo.js")
+ wsk.action.create(name = actionName, artifact = Some(file), expectedExitCode = 200, web = Some("true"))
+
+ var rr = apiCreate(
+ basepath = Some(testbasepath),
+ relpath = Some(testrelpath),
+ operation = Some(testurlop),
+ action = Some(actionName),
+ apiname = Some(testapiname))
+ verifyApiCreated(rr)
+
+ rr = apiGet(basepathOrApiName = Some(testapiname))
+ verifyApiList(rr, clinamespace, testName + "_action", testurlop, testbasepath, testrelpath, testapiname)
+ } finally {
+ wsk.action.delete(name = actionName, expectedExitCode = DONTCARE_EXIT)
+ apiDelete(basepathOrApiName = testbasepath, expectedExitCode = DONTCARE_EXIT)
+ wsk.pkg.delete(packageName).stdout should include regex (s""""name":\\s*"$packageName"""")
+ }
+ }
}