@Test public void testApplyWhereTagDoesntMatchAndImageAndLocationFoundAndHardwareNotFound() throws UnknownHostException { RunningInstanceToNodeMetadata parser = createNodeParser(ImmutableSet.<Hardware> of(), ImmutableSet.of(provider), EC2ImageParserTest.convertImages("/amzn_images.xml"), ImmutableMap.<String, Credentials> of()); RunningInstance server = firstInstanceFromResource("/describe_instances_running.xml"); assertEquals( parser.apply(server).toString(), new NodeMetadataBuilder() .status(Status.RUNNING).backendStatus("running") .hostname("ip-10-243-42-70") .privateAddresses(ImmutableSet.of("10.243.42.70")) .publicAddresses(ImmutableSet.of("174.129.81.68")) .imageId("us-east-1/ami-82e4b5c7") .operatingSystem( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).version("").arch("paravirtual") .description("137112412989/amzn-ami-0.9.7-beta.i386-ebs").is64Bit(false).build()) .id("us-east-1/i-0799056f").providerId("i-0799056f").location(provider).build().toString()); }
public void testParseAmznImage() { Set<org.jclouds.compute.domain.Image> result = convertImages("/amzn_images.xml"); for (org.jclouds.compute.domain.Image image : result) { assertEquals(image.getStatus(), Status.AVAILABLE); assertImageEquals(Iterables.get(result, 0), new ImageBuilder().operatingSystem( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).arch("paravirtual").version("").description( "137112412989/amzn-ami-0.9.7-beta.i386-ebs").is64Bit(false).build()).description("Amazon") Status.AVAILABLE).backendStatus("available").build()); assertImageEquals(Iterables.get(result, 3), new ImageBuilder().operatingSystem( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).arch("paravirtual").version("").description( "amzn-ami-us-west-1/amzn-ami-0.9.7-beta.x86_64.manifest.xml").is64Bit(true).build()) Status.AVAILABLE).backendStatus("available").build()); assertImageEquals(Iterables.get(result, 4), new ImageBuilder().operatingSystem( new OperatingSystem.Builder().family(OsFamily.WINDOWS).arch("hvm").version("2008").description( "amazon/NameGivesNoClue_Server-2008-R2_SP1-Language_Packs-64Bit-Base-2012.05.10")
public void testParseAmznImage() { Set<org.jclouds.compute.domain.Image> result = convertImages("/amzn_images.xml"); for (org.jclouds.compute.domain.Image image : result) { assertEquals(image.getStatus(), Status.AVAILABLE); assertImageEquals(Iterables.get(result, 0), new ImageBuilder().operatingSystem( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).arch("paravirtual").version("").description( "137112412989/amzn-ami-0.9.7-beta.i386-ebs").is64Bit(false).build()).description("Amazon") Status.AVAILABLE).backendStatus("available").build()); assertImageEquals(Iterables.get(result, 3), new ImageBuilder().operatingSystem( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).arch("paravirtual").version("").description( "amzn-ami-us-west-1/amzn-ami-0.9.7-beta.x86_64.manifest.xml").is64Bit(true).build()) Status.AVAILABLE).backendStatus("available").build()); assertImageEquals(Iterables.get(result, 4), new ImageBuilder().operatingSystem( new OperatingSystem.Builder().family(OsFamily.WINDOWS).arch("hvm").version("2008").description( "amazon/NameGivesNoClue_Server-2008-R2_SP1-Language_Packs-64Bit-Base-2012.05.10")
@Test public void testApplyWhereTagDoesntMatchAndImageAndLocationFoundAndHardwareNotFound() throws UnknownHostException { RunningInstanceToNodeMetadata parser = createNodeParser(ImmutableSet.<Hardware> of(), ImmutableSet.of(provider), EC2ImageParserTest.convertImages("/amzn_images.xml"), ImmutableMap.<String, Credentials> of()); RunningInstance server = firstInstanceFromResource("/describe_instances_running.xml"); assertEquals( parser.apply(server).toString(), new NodeMetadataBuilder() .status(Status.RUNNING).backendStatus("running") .hostname("ip-10-243-42-70") .privateAddresses(ImmutableSet.of("10.243.42.70")) .publicAddresses(ImmutableSet.of("174.129.81.68")) .imageId("us-east-1/ami-82e4b5c7") .operatingSystem( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).version("").arch("paravirtual") .description("137112412989/amzn-ami-0.9.7-beta.i386-ebs").is64Bit(false).build()) .id("us-east-1/i-0799056f").providerId("i-0799056f").location(provider).build().toString()); }
@Test public void testApplyWhereTagDoesntMatchAndImageHardwareAndLocationFound() throws UnknownHostException { RunningInstanceToNodeMetadata parser = createNodeParser(ImmutableSet.of(m1_small().build()), ImmutableSet .of(provider), EC2ImageParserTest.convertImages("/amzn_images.xml"), ImmutableMap .<String, Credentials> of()); RunningInstance server = firstInstanceFromResource("/describe_instances_running.xml"); assertEquals( parser.apply(server).toString(), new NodeMetadataBuilder() .hostname("ip-10-243-42-70") .status(Status.RUNNING).backendStatus("running") .privateAddresses(ImmutableSet.of("10.243.42.70")) .publicAddresses(ImmutableSet.of("174.129.81.68")) .imageId("us-east-1/ami-82e4b5c7") .hardware(m1_small().build()) .operatingSystem( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).version("").arch("paravirtual") .description("137112412989/amzn-ami-0.9.7-beta.i386-ebs").is64Bit(false).build()) .id("us-east-1/i-0799056f").providerId("i-0799056f").location(provider).build().toString()); }
@Test public void testApplyWhereTagDoesntMatchAndImageHardwareAndLocationFound() throws UnknownHostException { RunningInstanceToNodeMetadata parser = createNodeParser(ImmutableSet.of(m1_small().build()), ImmutableSet .of(provider), EC2ImageParserTest.convertImages("/amzn_images.xml"), ImmutableMap .<String, Credentials> of()); RunningInstance server = firstInstanceFromResource("/describe_instances_running.xml"); assertEquals( parser.apply(server).toString(), new NodeMetadataBuilder() .hostname("ip-10-243-42-70") .status(Status.RUNNING).backendStatus("running") .privateAddresses(ImmutableSet.of("10.243.42.70")) .publicAddresses(ImmutableSet.of("174.129.81.68")) .imageId("us-east-1/ami-82e4b5c7") .hardware(m1_small().build()) .operatingSystem( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).version("").arch("paravirtual") .description("137112412989/amzn-ami-0.9.7-beta.i386-ebs").is64Bit(false).build()) .id("us-east-1/i-0799056f").providerId("i-0799056f").location(provider).build().toString()); }