nacx commented on this pull request.


> +         int matches = 0;
+         client.getSecurityGroupExtension();
+         NodeMetadata node = getOnlyElement(client.createNodesInGroup(group + 
"inbound", 1, template));
+         DataCenterAndId datacenterAndId = 
DataCenterAndId.fromSlashEncoded(node.getId());
+         ProfitBricksApi pbApi = 
client.getContext().unwrapApi(ProfitBricksApi.class);
+         Server server = 
pbApi.serverApi().getServer(datacenterAndId.getDataCenter(), 
datacenterAndId.getId(), new DepthOptions().depth(5));
+         for (FirewallRule rule : 
server.entities().nics().items().get(0).entities().firewallrules().items()) {
+            if (rule.properties().portRangeStart() == 80 || 
rule.properties().portRangeStart() == 22 || rule.properties().portRangeStart() 
== 443) {
+               matches++;
+            }
+         }
+         Assert.assertEquals(3, matches);
+      } finally {
+         client.destroyNodesMatching(inGroup(group + "inbound"));
+      }
+   }

I'd just override the `createAndRunAServiceInGroup`, call super and add the 
validations after that. In the end, it is not a test itself, but the method 
configures a node with ports 22 and 8080 as inbound ports. Adding the 
validations after that makes sense, and a failure will produce a proper 
stacktrace and context.

In the end, we want to test as much as possible in the less time, but having 
some decent feedback. I think this approach meets both objectives.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/344

Reply via email to