Skip to content
Snippets Groups Projects
Commit 4155df3a authored by Tulio Ribeiro's avatar Tulio Ribeiro
Browse files

Just this erros with ant tests...

 [junit] Running net.floodlightcontroller.devicemanager.internal.DeviceManagerImplTest
 [junit] Tests run: 37, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0,503 sec
 [junit] TEST net.floodlightcontroller.devicemanager.internal.DeviceManagerImplTest FAILED
parent b7d5355c
No related branches found
No related tags found
No related merge requests found
......@@ -48,13 +48,12 @@ public class ClientTest {
@Before
public void setUp() throws Exception {
keyStoreFile = new File(keyStoreFolder.getRoot(), "keystore.jceks");
CryptoUtil.writeSharedSecret(keyStoreFile.getAbsolutePath(),
keyStorePassword,
CryptoUtil.secureRandom(16));
nodes = new ArrayList<Node>();
nodes.add(new Node("localhost", 6642, (short)1, (short)1));
nodes.add(new Node("localhost", 40101, (short)1, (short)1));
nodeString = mapper.writeValueAsString(nodes);
debugCounterService = new MockDebugCounterService();
......@@ -68,7 +67,7 @@ public class ClientTest {
fmc.addService(IDebugEventService.class, new MockDebugEventService());
fmc.addConfigParam(syncManager, "nodes", nodeString);
fmc.addConfigParam(syncManager, "thisNode", ""+1);
fmc.addConfigParam(syncManager, "thisNodeId", ""+1);
fmc.addConfigParam(syncManager, "persistenceEnabled", "false");
fmc.addConfigParam(syncManager, "authScheme", "CHALLENGE_RESPONSE");
fmc.addConfigParam(syncManager, "keyStorePath",
......@@ -76,8 +75,10 @@ public class ClientTest {
fmc.addConfigParam(syncManager, "keyStorePassword", keyStorePassword);
tp.init(fmc);
syncManager.init(fmc);
tp.startUp(fmc);
syncManager.startUp(fmc);
syncManager.registerStore("global", Scope.GLOBAL);
}
......@@ -96,7 +97,7 @@ public class ClientTest {
public void testClientBasic() throws Exception {
SyncClientSettings scs = new SyncClientSettings();
scs.hostname = "localhost";
scs.port = 6642;
scs.port = 40101;
scs.storeName = "global";
scs.debug = true;
scs.authScheme = AuthScheme.CHALLENGE_RESPONSE;
......@@ -110,7 +111,7 @@ public class ClientTest {
client.connect();
client.executeCommandLine("get \"key\"");
assertEquals("", err.toString());
assertEquals("Using remote sync service at localhost:6642\n" +
assertEquals("Using remote sync service at localhost:40101\n" +
"Getting Key:\n" +
"\"key\"\n\n" +
"Not found\n",
......@@ -180,7 +181,5 @@ public class ClientTest {
client.executeCommandLine("help");
assert(!"".equals(out.toString()));
}
}
......@@ -49,10 +49,9 @@ public class BootstrapTest {
FloodlightModuleContext fmc = new FloodlightModuleContext();
ThreadPool tp = new ThreadPool();
int curPort = 6642;
int curPort = 6699;
String keyStorePath = new File(dbFolder.getRoot(),
"keystore.jceks").getAbsolutePath();
String keyStorePath = new File(dbFolder.getRoot(), "keystore.jceks").getAbsolutePath();
String keyStorePassword = "bootstrapping is fun!";
CryptoUtil.writeSharedSecret(keyStorePath,
keyStorePassword,
......@@ -94,8 +93,10 @@ public class BootstrapTest {
// config
unsyncStore.put("localNodePort", String.valueOf(curPort));
unsyncStore.put(SyncStoreCCProvider.KEY_STORE_PATH, keyStorePath);
unsyncStore.put(SyncStoreCCProvider.KEY_STORE_PASSWORD, keyStorePassword);
unsyncStore.put(SyncStoreCCProvider.AUTH_SCHEME, AuthScheme.CHALLENGE_RESPONSE.toString());
unsyncStore.put(SyncStoreCCProvider.KEY_STORE_PASSWORD,
keyStorePassword);
unsyncStore.put(SyncStoreCCProvider.AUTH_SCHEME,
AuthScheme.CHALLENGE_RESPONSE.toString());
String curSeed = "";
if (i > 0) {
......
......@@ -75,20 +75,23 @@ public class SyncManagerTest {
fmc.addService(IThreadPoolService.class, tp);
fmc.addService(IDebugCounterService.class, new MockDebugCounterService());
fmc.addService(IDebugEventService.class, new MockDebugEventService());
fmc.addConfigParam(syncManager, "configProviders", PropertyCCProvider.class.getName());
fmc.addConfigParam(syncManager, "configProviders",
PropertyCCProvider.class.getName());
fmc.addConfigParam(syncManager, "nodes", nodeString);
fmc.addConfigParam(syncManager, "thisNodeId", ""+thisNode.getNodeId());
fmc.addConfigParam(syncManager, "persistenceEnabled", "false");
fmc.addConfigParam(syncManager, "authScheme", "CHALLENGE_RESPONSE");
fmc.addConfigParam(syncManager, "keyStorePath", keyStoreFile.getAbsolutePath());
fmc.addConfigParam(syncManager, "keyStorePath",
keyStoreFile.getAbsolutePath());
fmc.addConfigParam(syncManager, "keyStorePassword", keyStorePassword);
tp.init(fmc);
syncManager.init(fmc);
tp.startUp(fmc);
syncManager.startUp(fmc);
syncManager.registerStore("global", Scope.GLOBAL);
syncManager.registerStore("local", Scope.LOCAL);
}
@Before
......@@ -105,19 +108,17 @@ public class SyncManagerTest {
moduleContexts = new FloodlightModuleContext[4];
nodes = new ArrayList<Node>();
nodes.add(new Node("localhost", 6642, (short)1, (short)1));
nodes.add(new Node("localhost", 6643, (short)2, (short)2));
nodes.add(new Node("localhost", 6644, (short)3, (short)1));
nodes.add(new Node("localhost", 6645, (short)4, (short)2));
nodes.add(new Node("localhost", 40101, (short)1, (short)1));
nodes.add(new Node("localhost", 40102, (short)2, (short)2));
nodes.add(new Node("localhost", 40103, (short)3, (short)1));
nodes.add(new Node("localhost", 40104, (short)4, (short)2));
nodeString = mapper.writeValueAsString(nodes);
logger.info("Starting: syncManagers and moduleContexts.");
for(int i = 0; i < 4; i++) {
moduleContexts[i] = new FloodlightModuleContext();
syncManagers[i] = new SyncManager();
setupSyncManager(moduleContexts[i], syncManagers[i], nodes.get(i));
}
}
@After
......@@ -164,6 +165,7 @@ public class SyncManagerTest {
result = testClient.get(k);
assertEquals(tb2, result.getValue());
}
@Test
......@@ -262,7 +264,6 @@ public class SyncManagerTest {
ArrayList<IStoreClient<String, String>> clients =
new ArrayList<IStoreClient<String, String>>(syncManagers.length);
// write one value to each node's local interface
for (int i = 0; i < syncManagers.length; i++) {
IStoreClient<String, String> client =
......@@ -275,7 +276,7 @@ public class SyncManagerTest {
// verify that we see all the values everywhere
for (int j = 0; j < clients.size(); j++) {
for (int i = 0; i < syncManagers.length; i++) {
waitForValue(clients.get(j), "key" + i, ""+i, 2000, "client:"+j);
waitForValue(clients.get(j), "key" + i, ""+i, 2000, "client"+j);
}
}
}
......@@ -382,11 +383,15 @@ public class SyncManagerTest {
@Test
public void testReconnect() throws Exception {
IStoreClient<String, String> client0 =
syncManagers[0].getStoreClient("global", String.class, String.class);
syncManagers[0].getStoreClient("global",
String.class,
String.class);
IStoreClient<String, String> client1 =
syncManagers[1].getStoreClient("global", String.class, String.class);
syncManagers[1].getStoreClient("global",
String.class, String.class);
IStoreClient<String, String> client2 =
syncManagers[2].getStoreClient("global", String.class, String.class);
syncManagers[2].getStoreClient("global",
String.class, String.class);
client0.put("key0", "value0");
waitForValue(client2, "key0", "value0", 1000, "client0");
......@@ -415,7 +420,7 @@ public class SyncManagerTest {
waitForValue(client0, "newkey2", "newvalue2", 1000, "client0");
waitForValue(client0, "key0", "newvalue0", 1000, "client0");
waitForValue(client0, "key2", "newvalue2", 1000, "client0");
for (int i = 0; i < 500; i++) {
waitForValue(client0, "largetest" + i,
"largetestvalue", 1000, "client0");
......@@ -556,7 +561,7 @@ public class SyncManagerTest {
client0.put("key", "value");
waitForValue(client1, "key", "value", 2000, "client1");
nodes.add(new Node("localhost", 6646, (short)5, (short)5));
nodes.add(new Node("localhost", 40105, (short)5, (short)5));
SyncManager[] sms = Arrays.copyOf(syncManagers,
syncManagers.length + 1);
FloodlightModuleContext[] fmcs =
......@@ -712,7 +717,7 @@ public class SyncManagerTest {
tp.init(null);
tp.startUp(null);
nodes = new ArrayList<Node>();
nodes.add(new Node("localhost", 6642, (short)1, (short)1));
nodes.add(new Node("localhost", 40101, (short)1, (short)1));
nodeString = mapper.writeValueAsString(nodes);
SyncManager sm = new SyncManager();
FloodlightModuleContext fmc = new FloodlightModuleContext();
......@@ -722,8 +727,6 @@ public class SyncManagerTest {
//fmc.addConfigParam(st, "iterations", "1");
st.init(fmc);
st.startUp(fmc);
sm.cleanup();
Thread.sleep(10000);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment