import org.opendaylight.controller.switchmanager.IInventoryListener;
import org.opendaylight.controller.usermanager.IUserManager;
import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.util.PathUtils;
import org.osgi.framework.Bundle;
request.setUri(restUrl);
request.setMethod(method);
- request.setTimeout(5000); // HostTracker doesn't respond within 3 seconds
+ request.setTimeout(0); // HostTracker doesn't respond
+ // within default timeout during
+ // IT so setting an indefinite
+ // timeout till the issue is
+ // sorted out
Map<String, List<String>> headers = new HashMap<String, List<String>>();
String authString = "admin:admin";
JSONTokener jt = new JSONTokener(result);
JSONObject json = new JSONObject(jt);
JSONArray subnetConfigs = json.getJSONArray("subnetConfig");
- Assert.assertEquals(subnetConfigs.length(), 0);
+ Assert.assertEquals(subnetConfigs.length(), 1); // should only get the default subnet
// Test GET subnet1 expecting 404
result = getJsonResult(baseURL + "default/subnet/" + name1);
JSONObject node = json.getJSONObject("node");
Assert.assertEquals(node.getString("type"), "STUB");
Assert.assertEquals(node.getString("id"), "51966");
- // test adding same flow again fails due to repeat name..return 409
+ // test adding same flow again succeeds with a change in any field ..return Success
// code
+ fc = "{\"name\":\"test1\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"LOOPBACK\"]}";
result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test1", "PUT", fc);
- Assert.assertTrue(result.equals("409"));
+ Assert.assertTrue(result.equals("Success"));
fc = "{\"name\":\"test2\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test2", "PUT", fc);