Added a few more assertions in the live test

This commit is contained in:
andreisavu 2011-12-11 09:56:54 +02:00
parent cea743b4f5
commit 115ed78970
1 changed files with 14 additions and 3 deletions

View File

@ -24,6 +24,7 @@ import org.testng.annotations.Test;
import java.util.Set; import java.util.Set;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
/** /**
@ -42,14 +43,24 @@ public class GlobalHostClientLiveTest extends BaseCloudStackClientLiveTest {
assert hosts.size() > 0 : hosts; assert hosts.size() > 0 : hosts;
for(Host host : hosts) { for(Host host : hosts) {
Logger.CONSOLE.info(host.toString());
checkHost(host); checkHost(host);
} }
} }
private void checkHost(Host host) { private void checkHost(Host host) {
assert host.getCpuNumber() > 0; if (host.getType().equals("Routing")) {
assert host.getAverageLoad() >= 0; assert host.getCpuNumber() > 0;
assert host.getAverageLoad() >= 0;
assert host.getHypervisor() != null;
}
assert host.getAllocationState() != null;
assert host.getEvents() != null;
if (host.getType().equals("SecondaryStorageVM")) {
assert host.getName().startsWith("s-");
}
if (host.getType().equals("ConsoleProxy")) {
assert host.getName().startsWith("v-");
}
} }
} }