DatabaseSchema dbSchema = null;
static String testBridgeName = "br-test";
static UUID testBridgeUuid = null;
+
+ /**
+ * Test general OVSDB transactions (viz., insert, select, update,
+ * mutate, comment, delete, where, commit) as well as the special
+ * transactions (viz., abort and assert)
+ */
@Test
public void testTransact() throws IOException, InterruptedException, ExecutionException {
Assert.assertNotNull(dbSchema);
assertTransaction();
}
+ /**
+ * Test OVS monitor request and reply, with and without specific column filters,
+ * for the Bridge table in the OVSDB. The setup involves creating a test bridge with 5
+ * flood_vlans and 2 key-value pairs, and monitoring the DB update.
+ */
@Test
public void testMonitorRequest() throws ExecutionException, InterruptedException, IOException {
Assert.assertNotNull(dbSchema);
static String testBridgeName = "br_test";
static UUID testBridgeUuid = null;
+ /**
+ * Test creation of statically typed bridge table as defined in
+ * ovs-vswitchd.conf.db with get/set for all relevant columns. The
+ * SETDATA methods for "name", "status" and "flood_vlans" columns
+ * are verified.
+ */
@Test
public void testTypedBridgeCreate() throws IOException, InterruptedException, ExecutionException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
TestBridge rBridge = ovs.createTypedRowWrapper(TestBridge.class);
prettyTestJson = Resources.toString(prettyTestJsoUrl, Charsets.UTF_8);
}
+ /**
+ * Test decoding the Stringified Json text in test.json to
+ * individual Json node objects.
+ * @throws Exception
+ */
@Test
public void testDecode() throws Exception {
for (int i = 0; i < 10; i++) {
ch.finish();
}
+ /**
+ * Test decoding the Stringified Json text in pretty-test.json to
+ * individual Json node objects.
+ * @throws Exception
+ */
@Test
public void testDecodePrettyJson() throws Exception {
ch.writeInbound(copiedBuffer(prettyTestJson, CharsetUtil.UTF_8));
ch.finish();
}
+ /**
+ * Test decoding the Stringified Json text with large spaces to
+ * individual Json node objects.
+ * @throws Exception
+ */
@Test
public void testDecodeSkipSpaces() throws Exception {
ch.writeInbound(copiedBuffer(PREAMBLE + testJson + PREAMBLE + testJson, CharsetUtil.UTF_8));
ch.finish();
}
+ /**
+ * Test whether phased decoding is allowed with JsonRpcDecoder by
+ * writing Json string over two separate iterations, and checking if
+ * the decoder collates the record appropriately.
+ * @throws Exception
+ */
@Test
public void testDecodePartial() throws Exception {
ch.writeInbound(copiedBuffer(PARTIAL_START, CharsetUtil.UTF_8));
ch.finish();
}
+ /**
+ * Test whether decoder throws appropriate DecoderException when
+ * passing a Json string using an unsupported (i.e., UTF-16)
+ * character set.
+ * @throws Exception
+ */
@Test(expected= DecoderException.class)
public void testDecodeInvalidEncoding() throws Exception {
ch.writeInbound(copiedBuffer(testJson, CharsetUtil.UTF_16));
ch.finish();
}
+ /**
+ * Test whether decoder throws appropriate TooLongFrameException
+ * when passing a Json string longer than the decoder's maximum
+ * frame length.
+ * @throws Exception
+ */
@Test(expected=TooLongFrameException.class)
public void testDecodeFrameLengthExceed() {
decoder = new JsonRpcDecoder(testJson_BYTES -1);
ch.writeInbound(copiedBuffer(testJson, CharsetUtil.UTF_8));
ch.finish();
}
-}
\ No newline at end of file
+}
bootstrapper.stopServer();
}
+ /**
+ * Testing appropriate ChannelHandler integration for
+ * JsonRpcDecoder, so that Json strings written using an
+ * OutputStream connected to a ServerSocket of a Netty
+ * ServerBootstrap can be decoder properly.
+ */
+
@Test
public void testBasicFlow() throws Exception {
setupServer();
- Socket socket = socket = new Socket(serverurl, serverport);
-
+ Socket socket = new Socket(serverurl, serverport);
OutputStream outputStream = socket.getOutputStream();
int records = 20;
static int counter = 0;
/*
- create and a json of specified size
+ create and write a json string for specified number of times
*/
private void writeJson(OutputStream outputStream, int times) throws IOException {
outputStream.write("{".getBytes("UTF-8"));
public class VersionTest {
+ /**
+ * Test to verify if Version object can be constructed from a string
+ * and to verify if Version.toString() yields original string used
+ * during construction of the object.
+ * @throws Exception
+ */
@Test
public void testToString() throws Exception {
Version a = Version.fromString("1.2.3");
assertEquals("1.2.3", a.toString());
}
+ /**
+ * Test to verify if equals() and hashCode() methods work
+ * for the Version object.
+ * @throws Exception
+ */
@Test
public void testEquals() throws Exception {
Version a = Version.fromString("1.2.3");
assertTrue(b.hashCode() == Version.fromString("0.0.0").hashCode());
}
+ /**
+ * Test to verify compareTo() function works for the
+ * X.Y.Z semantics of the version number.
+ * @throws Exception
+ */
@Test
public void testCompareTo() throws Exception {
Version a = Version.fromString("1.2.27");
}
+ /* TODO: Incomplete compare test
+ */
@Test
public void testCompare() throws Exception {
Version a = Version.fromString("6.9.3");
public class OvsdbSchemaTest {
+ /**
+ * Test OVSDB schema construction from JSON text in
+ * test_schema.json. Following tables are used: "Port", "Manager",
+ * "Bridge", "Interface", "SSL", "Open_vSwitch", "Queue",
+ * "NetFlow", "Mirror", "QoS", "Controller", "Flow_Table", "sFlow"
+ * tables.
+ */
@Test
public void testSchema() throws IOException {
InputStream resourceAsStream = OvsdbSchemaTest.class.getResourceAsStream("test_schema.json");
+++ /dev/null
-{
- "id": 0,
- "result": {
- "tables": {
- "Port": {
- "columns": {
- "name": {
- "mutable": false,
- "type": "string"
- },
- "statistics": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "value": "integer",
- "max": "unlimited"
- }
- },
- "vlan_mode": {
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "access",
- "native-tagged",
- "native-untagged",
- "trunk"
- ]
- ]
- },
- "min": 0
- }
- },
- "qos": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "QoS"
- },
- "min": 0
- }
- },
- "status": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "trunks": {
- "type": {
- "key": {
- "maxInteger": 4095,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0,
- "max": 4096
- }
- },
- "mac": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "interfaces": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "Interface"
- },
- "max": "unlimited"
- }
- },
- "bond_downdelay": {
- "type": "integer"
- },
- "bond_mode": {
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "active-backup",
- "balance-slb",
- "balance-tcp",
- "stable"
- ]
- ]
- },
- "min": 0
- }
- },
- "bond_updelay": {
- "type": "integer"
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "other_config": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "tag": {
- "type": {
- "key": {
- "maxInteger": 4095,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0
- }
- },
- "bond_fake_iface": {
- "type": "boolean"
- },
- "fake_bridge": {
- "type": "boolean"
- },
- "lacp": {
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "active",
- "off",
- "passive"
- ]
- ]
- },
- "min": 0
- }
- }
- },
- "indexes": [
- [
- "name"
- ]
- ]
- },
- "Manager": {
- "columns": {
- "is_connected": {
- "ephemeral": true,
- "type": "boolean"
- },
- "target": {
- "type": "string"
- },
- "other_config": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "max_backoff": {
- "type": {
- "key": {
- "minInteger": 1000,
- "type": "integer"
- },
- "min": 0
- }
- },
- "connection_mode": {
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "in-band",
- "out-of-band"
- ]
- ]
- },
- "min": 0
- }
- },
- "status": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "inactivity_probe": {
- "type": {
- "key": "integer",
- "min": 0
- }
- }
- },
- "indexes": [
- [
- "target"
- ]
- ]
- },
- "Bridge": {
- "columns": {
- "name": {
- "mutable": false,
- "type": "string"
- },
- "flood_vlans": {
- "type": {
- "key": {
- "maxInteger": 4095,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0,
- "max": 4096
- }
- },
- "netflow": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "NetFlow"
- },
- "min": 0
- }
- },
- "mirrors": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "Mirror"
- },
- "min": 0,
- "max": "unlimited"
- }
- },
- "status": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "datapath_id": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "controller": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "Controller"
- },
- "min": 0,
- "max": "unlimited"
- }
- },
- "protocols": {
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "OpenFlow10",
- "OpenFlow12",
- "OpenFlow13"
- ]
- ]
- },
- "min": 0,
- "max": "unlimited"
- }
- },
- "fail_mode": {
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "secure",
- "standalone"
- ]
- ]
- },
- "min": 0
- }
- },
- "ports": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "Port"
- },
- "min": 0,
- "max": "unlimited"
- }
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "flow_tables": {
- "type": {
- "key": {
- "maxInteger": 254,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0,
- "value": {
- "type": "uuid",
- "refTable": "Flow_Table"
- },
- "max": "unlimited"
- }
- },
- "sflow": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "sFlow"
- },
- "min": 0
- }
- },
- "datapath_type": {
- "type": "string"
- },
- "other_config": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "stp_enable": {
- "type": "boolean"
- }
- },
- "indexes": [
- [
- "name"
- ]
- ]
- },
- "Interface": {
- "columns": {
- "options": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "name": {
- "mutable": false,
- "type": "string"
- },
- "statistics": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "value": "integer",
- "max": "unlimited"
- }
- },
- "link_speed": {
- "ephemeral": true,
- "type": {
- "key": "integer",
- "min": 0
- }
- },
- "mtu": {
- "ephemeral": true,
- "type": {
- "key": "integer",
- "min": 0
- }
- },
- "mac_in_use": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "type": {
- "type": "string"
- },
- "ingress_policing_rate": {
- "type": {
- "key": {
- "minInteger": 0,
- "type": "integer"
- }
- }
- },
- "cfm_remote_opstate": {
- "ephemeral": true,
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "down",
- "up"
- ]
- ]
- },
- "min": 0
- }
- },
- "status": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "mac": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "ofport": {
- "type": {
- "key": "integer",
- "min": 0
- }
- },
- "cfm_fault_status": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "max": "unlimited"
- }
- },
- "duplex": {
- "ephemeral": true,
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "full",
- "half"
- ]
- ]
- },
- "min": 0
- }
- },
- "lacp_current": {
- "ephemeral": true,
- "type": {
- "key": "boolean",
- "min": 0
- }
- },
- "cfm_fault": {
- "ephemeral": true,
- "type": {
- "key": "boolean",
- "min": 0
- }
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "other_config": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "admin_state": {
- "ephemeral": true,
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "down",
- "up"
- ]
- ]
- },
- "min": 0
- }
- },
- "link_state": {
- "ephemeral": true,
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "down",
- "up"
- ]
- ]
- },
- "min": 0
- }
- },
- "cfm_remote_mpids": {
- "ephemeral": true,
- "type": {
- "key": "integer",
- "min": 0,
- "max": "unlimited"
- }
- },
- "cfm_mpid": {
- "type": {
- "key": "integer",
- "min": 0
- }
- },
- "ofport_request": {
- "type": {
- "key": {
- "maxInteger": 65279,
- "minInteger": 1,
- "type": "integer"
- },
- "min": 0
- }
- },
- "ingress_policing_burst": {
- "type": {
- "key": {
- "minInteger": 0,
- "type": "integer"
- }
- }
- },
- "cfm_health": {
- "ephemeral": true,
- "type": {
- "key": {
- "maxInteger": 100,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0
- }
- },
- "link_resets": {
- "ephemeral": true,
- "type": {
- "key": "integer",
- "min": 0
- }
- }
- },
- "indexes": [
- [
- "name"
- ]
- ]
- },
- "SSL": {
- "columns": {
- "ca_cert": {
- "type": "string"
- },
- "private_key": {
- "type": "string"
- },
- "bootstrap_ca_cert": {
- "type": "boolean"
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "certificate": {
- "type": "string"
- }
- },
- "maxRows": 1
- },
- "Open_vSwitch": {
- "columns": {
- "ovs_version": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "system_version": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "bridges": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "Bridge"
- },
- "min": 0,
- "max": "unlimited"
- }
- },
- "statistics": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "other_config": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "next_cfg": {
- "type": "integer"
- },
- "manager_options": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "Manager"
- },
- "min": 0,
- "max": "unlimited"
- }
- },
- "system_type": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "ssl": {
- "type": {
- "key": {
- "type": "uuid",
- "refTable": "SSL"
- },
- "min": 0
- }
- },
- "db_version": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "cur_cfg": {
- "type": "integer"
- }
- },
- "maxRows": 1,
- "isRoot": true
- },
- "Queue": {
- "columns": {
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "other_config": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "dscp": {
- "type": {
- "key": {
- "maxInteger": 63,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0
- }
- }
- },
- "isRoot": true
- },
- "NetFlow": {
- "columns": {
- "engine_type": {
- "type": {
- "key": {
- "maxInteger": 255,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0
- }
- },
- "targets": {
- "type": {
- "key": "string",
- "max": "unlimited"
- }
- },
- "add_id_to_interface": {
- "type": "boolean"
- },
- "active_timeout": {
- "type": {
- "key": {
- "minInteger": -1,
- "type": "integer"
- }
- }
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "engine_id": {
- "type": {
- "key": {
- "maxInteger": 255,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0
- }
- }
- }
- },
- "Mirror": {
- "columns": {
- "name": {
- "type": "string"
- },
- "output_port": {
- "type": {
- "key": {
- "refType": "weak",
- "type": "uuid",
- "refTable": "Port"
- },
- "min": 0
- }
- },
- "output_vlan": {
- "type": {
- "key": {
- "maxInteger": 4095,
- "minInteger": 1,
- "type": "integer"
- },
- "min": 0
- }
- },
- "statistics": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "value": "integer",
- "max": "unlimited"
- }
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "select_dst_port": {
- "type": {
- "key": {
- "refType": "weak",
- "type": "uuid",
- "refTable": "Port"
- },
- "min": 0,
- "max": "unlimited"
- }
- },
- "select_all": {
- "type": "boolean"
- },
- "select_vlan": {
- "type": {
- "key": {
- "maxInteger": 4095,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0,
- "max": 4096
- }
- },
- "select_src_port": {
- "type": {
- "key": {
- "refType": "weak",
- "type": "uuid",
- "refTable": "Port"
- },
- "min": 0,
- "max": "unlimited"
- }
- }
- }
- },
- "QoS": {
- "columns": {
- "queues": {
- "type": {
- "key": {
- "maxInteger": 4294967295,
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0,
- "value": {
- "type": "uuid",
- "refTable": "Queue"
- },
- "max": "unlimited"
- }
- },
- "other_config": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "type": {
- "type": "string"
- }
- },
- "isRoot": true
- },
- "Controller": {
- "columns": {
- "is_connected": {
- "ephemeral": true,
- "type": "boolean"
- },
- "enable_async_messages": {
- "type": {
- "key": "boolean",
- "min": 0
- }
- },
- "controller_rate_limit": {
- "type": {
- "key": {
- "minInteger": 100,
- "type": "integer"
- },
- "min": 0
- }
- },
- "target": {
- "type": "string"
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "other_config": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "local_netmask": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "local_gateway": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "max_backoff": {
- "type": {
- "key": {
- "minInteger": 1000,
- "type": "integer"
- },
- "min": 0
- }
- },
- "local_ip": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "connection_mode": {
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "in-band",
- "out-of-band"
- ]
- ]
- },
- "min": 0
- }
- },
- "status": {
- "ephemeral": true,
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "role": {
- "ephemeral": true,
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "master",
- "other",
- "slave"
- ]
- ]
- },
- "min": 0
- }
- },
- "inactivity_probe": {
- "type": {
- "key": "integer",
- "min": 0
- }
- },
- "controller_burst_limit": {
- "type": {
- "key": {
- "minInteger": 25,
- "type": "integer"
- },
- "min": 0
- }
- }
- }
- },
- "Flow_Table": {
- "columns": {
- "groups": {
- "type": {
- "key": "string",
- "min": 0,
- "max": "unlimited"
- }
- },
- "name": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "overflow_policy": {
- "type": {
- "key": {
- "type": "string",
- "enum": [
- "set",
- [
- "evict",
- "refuse"
- ]
- ]
- },
- "min": 0
- }
- },
- "flow_limit": {
- "type": {
- "key": {
- "minInteger": 0,
- "type": "integer"
- },
- "min": 0
- }
- }
- }
- },
- "sFlow": {
- "columns": {
- "polling": {
- "type": {
- "key": "integer",
- "min": 0
- }
- },
- "targets": {
- "type": {
- "key": "string",
- "max": "unlimited"
- }
- },
- "header": {
- "type": {
- "key": "integer",
- "min": 0
- }
- },
- "agent": {
- "type": {
- "key": "string",
- "min": 0
- }
- },
- "external_ids": {
- "type": {
- "key": "string",
- "min": 0,
- "value": "string",
- "max": "unlimited"
- }
- },
- "sampling": {
- "type": {
- "key": "integer",
- "min": 0
- }
- }
- }
- }
- },
- "cksum": "2180939265 17455",
- "name": "Open_vSwitch",
- "version": "6.12.0"
- },
- "error": null
-}
import org.opendaylight.ovsdb.plugin.impl.ConfigurationServiceImpl;
import org.opendaylight.ovsdb.plugin.impl.ConnectionServiceImpl;
import org.opendaylight.ovsdb.plugin.impl.InventoryServiceImpl;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger logger = LoggerFactory
.getLogger(BridgeDomainConfigBridgeTestCases.class);
+ /**
+ * Add OVS bridge "JUNIT_TEST_BRIDGE" for all other test
+ * Ex. ovs-vsctl add-br br0
+ *
+ * @throws Throwable
+ */
@Test
public void addBridge() throws Throwable{
configurationService.createBridgeDomain(node, BRIDGE_NAME, null);
}
+ /**
+ * List all bridge domains on this OVS bridge
+ * Ex. ovs-vsctl show
+ *
+ * @throws Throwable
+ */
@Test
public void getBridgeDomains() throws Throwable{
List<String> ls = configurationService.getBridgeDomains(node);
}
+ /**
+ * Register self node as the bridge's OpenFlow controller
+ * e.g., ovs-vsctl set-controller br0 <node>
+ *
+ * @throws Throwable
+ */
@Test
public void setController() throws Throwable{
TestObjects testObjects = getTestConnection();
ConfigurationServiceImpl configurationService = testObjects.configurationService;
configurationService.setBridgeOFController(node, BRIDGE_NAME);
-
}
+ /**
+ * Test the assignment of "external ID" key/value pairs on bridge
+ * e.g., ovs-vsctl br−set−external−id br0 <key> <value>
+ *
+ * @throws Throwable
+ */
@Test
public void setBridgeConfig() throws Throwable{
TestObjects testObjects = getTestConnection();
import org.junit.Test;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.ovsdb.plugin.impl.ConfigurationServiceImpl;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger logger = LoggerFactory
.getLogger(BridgeDomainConfigManagerTestCases.class);
+ /**
+ * Set manager for the OVS node
+ * Ex. ovs-vsctl set-manager tcp:192.168.254.254:6634
+ *
+ * @throws Throwable
+ */
@Test
public void setManager() throws Throwable{
TestObjects testObjects = getTestConnection();
configurationService.setManager(node, manager);
}
-}
\ No newline at end of file
+}
props = loadProperties();
}
-
/**
* Create a Port and attach it to a Bridge
* Ex. ovs-vsctl add-port br0 vif0
+ *
+ * @throws Throwable
*/
-
@Test
public void addPort() throws Throwable{
TestObjects testObjects = getTestConnection();
/**
* Create a Port with a user defined VLAN, and attach it to the specified bridge.
- *
* Ex. ovs-vsctl add-port JUNIT_BRIDGE_TEST Jvlanvif0 tag=100
+ *
+ * @throws Throwable
*/
@Test
public void addPortVlan() throws Throwable{
*
* Ex. ovs-vsctl add-port br0 vxlan1 (cont)
* -- set interface vxlan1 type=vxlan options:remote_ip=192.168.1.11
+ *
+ * @throws Throwable
*/
@Test
/**
* Deletes an existing port from an existing bridge
* Ex. ovs-vsctl del-port ovsbr0 tap0
+ *
+ * @throws Throwable
*/
@Test
public void deletePort() throws Throwable{
configurationService.deletePort(node, BRIDGE_NAME, PORT_NAME);
}
-}
\ No newline at end of file
+}
.getLogger(TearDown.class);
/**
- * Final Cleanup. Delete the test Bridge.
+ * Final Cleanup. Delete the test Bridge "JUNIT_TEST_BRIDGE".
*/
@Test