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/03/07 13:33:05 UTC

[GitHub] markusthoemmes closed pull request #3397: Partially revert change to route all action proxy tests through port mapping

markusthoemmes closed pull request #3397: Partially revert change to route all action proxy tests through port mapping
URL: https://github.com/apache/incubator-openwhisk/pull/3397
 
 
   

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/tests/src/test/scala/actionContainers/ActionContainer.scala b/tests/src/test/scala/actionContainers/ActionContainer.scala
index 4f6ef24347..ccd6748be6 100644
--- a/tests/src/test/scala/actionContainers/ActionContainer.scala
+++ b/tests/src/test/scala/actionContainers/ActionContainer.scala
@@ -144,17 +144,21 @@ object ActionContainer {
     }
 
     // ...find out its IP address...
-    val (ip, port) = if (WhiskProperties.getProperty("whisk.version.name") == "local") {
-      val p = 8988 // port must be available or docker run will fail
-      createContainer(Some(p))
-      Thread.sleep(1500) // let container/server come up cleanly
-      ("localhost", p)
-    } else { // "mac"
-      createContainer()
-      val ipOut = awaitDocker(s"""inspect --format '{{.NetworkSettings.IPAddress}}' $name""", 10 seconds)
-      assert(ipOut._1 == 0, "'docker inspect did not exit with 0")
-      (ipOut._2.replaceAll("""[^0-9.]""", ""), 8080)
-    }
+    val (ip, port) =
+      if (WhiskProperties.getProperty("whisk.version.name") == "local" &&
+          WhiskProperties.onMacOSX()) {
+        // on MacOSX, where docker for mac does not permit communicating with container directly
+        val p = 8988 // port must be available or docker run will fail
+        createContainer(Some(p))
+        Thread.sleep(1500) // let container/server come up cleanly
+        ("localhost", p)
+      } else {
+        // not "mac" i.e., docker-for-mac, use direct container IP directly (this is OK for Ubuntu, and docker-machine)
+        createContainer()
+        val ipOut = awaitDocker(s"""inspect --format '{{.NetworkSettings.IPAddress}}' $name""", 10 seconds)
+        assert(ipOut._1 == 0, "'docker inspect did not exit with 0")
+        (ipOut._2.replaceAll("""[^0-9.]""", ""), 8080)
+      }
 
     // ...we create an instance of the mock container interface...
     val mock = new ActionContainer {


 

----------------------------------------------------------------
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