brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [05/13] incubator-brooklyn git commit: Redis: support disabling direct connection
Date Wed, 25 Nov 2015 12:17:50 GMT
Redis: support disabling direct connection


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/c3d75915
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/c3d75915
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/c3d75915

Branch: refs/heads/master
Commit: c3d759156f6ae80f205bf146df4f0a8eb0044441
Parents: d01dc7c
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue Nov 24 13:25:12 2015 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Tue Nov 24 13:53:46 2015 +0000

----------------------------------------------------------------------
 .../entity/nosql/redis/RedisEc2LiveTest.java    | 30 ++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c3d75915/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/redis/RedisEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/redis/RedisEc2LiveTest.java
b/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/redis/RedisEc2LiveTest.java
index 2db5287..1307b17 100644
--- a/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/redis/RedisEc2LiveTest.java
+++ b/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/redis/RedisEc2LiveTest.java
@@ -18,10 +18,16 @@
  */
 package org.apache.brooklyn.entity.nosql.redis;
 
+import static org.testng.Assert.assertNotNull;
+
 import javax.annotation.Nullable;
 
 import org.apache.brooklyn.api.entity.EntitySpec;
 import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.Attributes;
+import org.apache.brooklyn.core.entity.EntityAsserts;
+import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
+import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
 import org.apache.brooklyn.entity.AbstractEc2LiveTest;
 import org.apache.brooklyn.test.EntityTestUtils;
 import org.slf4j.Logger;
@@ -30,6 +36,7 @@ import org.testng.annotations.Test;
 
 import com.google.common.base.Predicate;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 
 public class RedisEc2LiveTest extends AbstractEc2LiveTest {
 
@@ -60,6 +67,25 @@ public class RedisEc2LiveTest extends AbstractEc2LiveTest {
 
     }
 
-    @Test(enabled=false)
-    public void testDummy() {} // Convince testng IDE integration that this really does have
test methods  
+    @Test(groups = {"Live"})
+    public void testWithOnlyPort22() throws Exception {
+        // CentOS-6.3-x86_64-GA-EBS-02-85586466-5b6c-4495-b580-14f72b4bcf51-ami-bb9af1d2.1
+        jcloudsLocation = mgmt.getLocationRegistry().resolve(LOCATION_SPEC, ImmutableMap.of(
+                "tags", ImmutableList.of(getClass().getName()),
+                "imageId", "us-east-1/ami-a96b01c0", 
+                "hardwareId", SMALL_HARDWARE_ID));
+
+        RedisStore server = app.createAndManageChild(EntitySpec.create(RedisStore.class)
+                .configure(RedisStore.PROVISIONING_PROPERTIES.subKey(CloudLocationConfig.INBOUND_PORTS.getName()),
ImmutableList.of(22)));
+        
+        app.start(ImmutableList.of(jcloudsLocation));
+        
+        EntityAsserts.assertAttributeEqualsEventually(server, Attributes.SERVICE_UP, true);
+        EntityAsserts.assertAttributeEqualsEventually(server, Attributes.SERVICE_STATE_ACTUAL,
Lifecycle.RUNNING);
+        
+        Integer port = server.getAttribute(RedisStore.REDIS_PORT);
+        assertNotNull(port);
+        
+        assertViaSshLocalPortListeningEventually(server, port);
+    }
 }


Mime
View raw message