Skip to content

Instantly share code, notes, and snippets.

@Mierdin
Created July 10, 2014 19:44
Show Gist options
  • Select an option

  • Save Mierdin/13f93376fc9eac80d66a to your computer and use it in GitHub Desktop.

Select an option

Save Mierdin/13f93376fc9eac80d66a to your computer and use it in GitHub Desktop.
public boolean checkSchema() throws IOException, ExecutionException, InterruptedException, TimeoutException {
if (this.ovs == null) {
this.ovs = getTestConnection();
HardwareVtepSchemaSuiteIT.setOvsdbClient(this.ovs);
//retrieve list of databases from OVSDB server
ListenableFuture<List<String>> databases = ovs.getDatabases();
List<String> dbNames = databases.get();
Assert.assertNotNull(dbNames);
//verify that HW VTEP schema is in the list of supported databases
boolean hasHardwareVTEPSchema = false;
for (String dbName : dbNames) {
if (dbName.equals(HARDWARE_VTEP_SCHEMA)) {
hasHardwareVTEPSchema = true;
break;
}
}
Assert.assertTrue(HARDWARE_VTEP_SCHEMA + " schema is not supported by the switch", hasHardwareVTEPSchema);
return hasHardwareVTEPSchema;
} else {
Assert.fail("Error retrieving schema");
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment