You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/22 19:59:05 UTC

[GitHub] csantanapr closed pull request #226: Fix keystore

csantanapr closed pull request #226: Fix keystore
URL: https://github.com/apache/incubator-openwhisk-cli/pull/226
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/settings.gradle b/settings.gradle
index dd36ccf6..4f5a4d8b 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -33,3 +33,5 @@ gradle.ext.scala = [
     version: '2.11.8',
     compileFlags: ['-feature', '-unchecked', '-deprecation', '-Xfatal-warnings', '-Ywarn-unused-import']
 ]
+
+gradle.ext.owPath = owPath
diff --git a/tests/build.gradle b/tests/build.gradle
index ec54e0fc..22a54ec0 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -40,3 +40,25 @@ dependencies {
 tasks.withType(ScalaCompile) {
     scalaCompileOptions.additionalParameters = gradle.scala.compileFlags
 }
+
+
+def keystorePath = new File(sourceSets.test.scala.outputDir, 'keystore')
+task deleteKeystore(type: Delete) {
+    delete keystorePath
+}
+
+task createKeystore(dependsOn: deleteKeystore) {
+    doLast {
+        Properties props = new Properties()
+        props.load(new FileInputStream(file(gradle.owPath + '/whisk.properties')))
+        keystorePath.parentFile.mkdirs()
+        def cmd = ['keytool', '-import', '-alias', 'Whisk', '-noprompt', '-trustcacerts', '-file', file(props['whisk.ssl.cert']), '-keystore', keystorePath, '-storepass', 'openwhisk']
+        cmd.execute().waitForProcessOutput(System.out, System.err)
+    }
+}
+
+afterEvaluate {
+    tasks.withType(Test) {
+        dependsOn createKeystore
+    }
+}
diff --git a/tests/src/test/scala/system/basic/WskBasicTests.scala b/tests/src/test/scala/system/basic/WskBasicTests.scala
index a7855599..c78d7f17 100644
--- a/tests/src/test/scala/system/basic/WskBasicTests.scala
+++ b/tests/src/test/scala/system/basic/WskBasicTests.scala
@@ -545,20 +545,18 @@ class WskBasicTests extends TestHelpers with WskTestHelpers {
       trigger.create(name, annotations = annots)
     }
 
-    val result = wsk.trigger.get(name)
+    val result = getJSONFromResponse(wsk.trigger.get(name).stdout, true)
     val ns = wsk.namespace.whois()
-    val annos = getJSONFromResponse(result.stdout, true).fields("annotations")
 
-    getJSONFromResponse(result.stdout, true).fields("name") shouldBe name.toJson
-    getJSONFromResponse(result.stdout, true).fields("namespace") shouldBe ns.toJson
-
-    annos shouldBe JsArray(
+    result.fields("name") shouldBe name.toJson
+    result.fields("namespace") shouldBe ns.toJson
+    result.fields("annotations") shouldBe JsArray(
       JsObject("key" -> JsString("description"), "value" -> JsString("Trigger description")),
       JsObject(
         "key" -> JsString("parameters"),
         "value" -> JsArray(
-          JsObject("name" -> JsString("paramName1"), "description" -> JsString("Parameter description 1")),
-          JsObject("name" -> JsString("paramName2"), "description" -> JsString("Parameter description 2")))))
+          JsObject("description" -> JsString("Parameter description 1"), "name" -> JsString("paramName1")),
+          JsObject("description" -> JsString("Parameter description 2"), "name" -> JsString("paramName2")))))
   }
 
   it should "create a trigger with a name that contains spaces" in withAssetCleaner(wskprops) { (wp, assetHelper) =>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services