Fixes flavor and template tests to be more robust.

This commit is contained in:
Zack Shoylev 2015-01-30 14:36:10 -06:00
parent 99d0fcaaad
commit c64470e0b1
2 changed files with 8 additions and 7 deletions

View File

@ -71,7 +71,8 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest {
assertNotNull(flavor.getName());
assertNotNull(flavor.getLinks());
assertTrue(flavor.getRam() > 0);
assertTrue(flavor.getDisk() > 0);
// Some flavors can potentially have 0 system disk sizes.
assertTrue(flavor.getDisk() >= 0);
assertTrue(flavor.getVcpus() > 0);
}
}

View File

@ -82,7 +82,7 @@ public abstract class BaseTemplateBuilderLiveTest extends BaseComputeServiceCont
@Test
public void testDefaultTemplateBuilder() throws IOException {
Template defaultTemplate = view.getComputeService().templateBuilder().build();
assert defaultTemplate.getImage().getOperatingSystem().getVersion().matches("1[012].[10][04]") : defaultTemplate
assert defaultTemplate.getImage().getOperatingSystem().getVersion().matches("\\d\\d\\.\\d\\d") : defaultTemplate
.getImage().getOperatingSystem().getVersion();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);