brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [09/13] incubator-brooklyn git commit: MySQL: support disabling direct connection
Date Wed, 25 Nov 2015 12:17:54 GMT
MySQL: 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/571de2db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/571de2db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/571de2db

Branch: refs/heads/master
Commit: 571de2db081ed79ba97f74b220271f12c5607d10
Parents: e0afa32
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue Nov 24 13:26:22 2015 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Tue Nov 24 13:53:48 2015 +0000

----------------------------------------------------------------------
 .../entity/database/mysql/MySqlLiveEc2Test.java | 32 +++++++++++++++++---
 1 file changed, 28 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/571de2db/software/database/src/test/java/org/apache/brooklyn/entity/database/mysql/MySqlLiveEc2Test.java
----------------------------------------------------------------------
diff --git a/software/database/src/test/java/org/apache/brooklyn/entity/database/mysql/MySqlLiveEc2Test.java
b/software/database/src/test/java/org/apache/brooklyn/entity/database/mysql/MySqlLiveEc2Test.java
index 6b04c49..c727d2f 100644
--- a/software/database/src/test/java/org/apache/brooklyn/entity/database/mysql/MySqlLiveEc2Test.java
+++ b/software/database/src/test/java/org/apache/brooklyn/entity/database/mysql/MySqlLiveEc2Test.java
@@ -18,14 +18,21 @@
  */
 package org.apache.brooklyn.entity.database.mysql;
 
+import static org.testng.Assert.assertNotNull;
+
 import org.apache.brooklyn.api.entity.EntitySpec;
 import org.apache.brooklyn.api.location.Location;
-import org.testng.annotations.Test;
+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.entity.database.DatastoreMixins.DatastoreCommon;
 import org.apache.brooklyn.entity.database.VogellaExampleAccess;
+import org.testng.annotations.Test;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 
 @Test(groups = { "Live" })
 public class MySqlLiveEc2Test extends AbstractEc2LiveTest {
@@ -45,8 +52,25 @@ public class MySqlLiveEc2Test extends AbstractEc2LiveTest {
     @Test(enabled=false, groups = "Live")
     public void test_Debian_7_2() throws Exception { } // Disabled because MySQl not available
 
-    @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));
 
+        MySqlNode server = app.createAndManageChild(EntitySpec.create(MySqlNode.class)
+                .configure(MySqlNode.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(MySqlNode.MYSQL_PORT);
+        assertNotNull(port);
+        
+        assertViaSshLocalPortListeningEventually(server, port);
+    }
 }
-


Mime
View raw message