> @@ -150,7 +154,53 @@ public boolean apply(VolumeAttachmentApi > volumeAttachmentApi) { > if (server_id != null) > api.getServerApiForZone(zone).delete(server_id); > } > + } > + } > + > + @Test(dependsOnMethods = "testCreateVolume") > + public void testAttachmentAtBoot() { > + if (volumeApi.isPresent()) { > + String server_id = null; > + try { > + CreateServerOptions createServerOptions = > + CreateServerOptions.Builder.blockDeviceMapping( > + Collections.singletonList(new > BlockDeviceMapping().deviceName("/dev/vdf").volumeId(testVolume.getId()))); > + final String serverId = server_id = createServerInZone(zone, > createServerOptions).getId();
@demobox : For this and most of your other comments: mostly tried to stick close to the original volume attachment test (for postboot attachment) because I figured I wouldn't know all the decisions behind the writing of the test. Perfectly happy to make the corresponding changes over the entire class if you think that's a good idea. (Though I do like this particular bit of Java cuteness; it's a pretty clean way of ensuring that we have some value for the server id in our "finally" clause even though we want to treat it as a final variable in the "try"). --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/326/files#r12566254