Update TAPI YANG files to v2.1(v20181016)
* Replaced TAPI yang files with latest master(v2.1)
* Updated ModelRegistrator
* Updated library path for auto generated library
* Updated ODTN Phase1.0 impl
* Added TAPI XML conversion test for ODTN Phase1.0
* Added sample JSON for ODTN Phase1.0
Change-Id: I11eeab2423a1468df3ee515d40f31b82ed96aa3c
diff --git a/apps/odtn/service/src/test/java/org/onosproject/odtn/internal/DcsBasedTapiDataProducerTest.java b/apps/odtn/service/src/test/java/org/onosproject/odtn/internal/DcsBasedTapiDataProducerTest.java
index bfc45c7..64278fe 100644
--- a/apps/odtn/service/src/test/java/org/onosproject/odtn/internal/DcsBasedTapiDataProducerTest.java
+++ b/apps/odtn/service/src/test/java/org/onosproject/odtn/internal/DcsBasedTapiDataProducerTest.java
@@ -31,13 +31,15 @@
import org.onosproject.odtn.utils.tapi.TapiNodeHandler;
import org.onosproject.odtn.utils.tapi.TapiNodeRef;
import org.onosproject.odtn.utils.tapi.TapiSipHandler;
+import org.onosproject.odtn.utils.tapi.TapiTopologyContextHandler;
import org.onosproject.odtn.utils.tapi.TapiTopologyHandler;
-import org.onosproject.yang.gen.v1.tapicommon.rev20180307.tapicommon.DefaultContext;
-import org.onosproject.yang.gen.v1.tapicommon.rev20180307.tapicommon.tapicontext.DefaultServiceInterfacePoint;
-import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.context.DefaultAugmentedTapiCommonContext;
-import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.node.DefaultOwnedNodeEdgePoint;
-import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.topology.DefaultNode;
-import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.topologycontext.DefaultTopology;
+import org.onosproject.yang.gen.v1.tapicommon.rev20181016.tapicommon.DefaultContext;
+import org.onosproject.yang.gen.v1.tapicommon.rev20181016.tapicommon.tapicontext.DefaultServiceInterfacePoint;
+import org.onosproject.yang.gen.v1.tapitopology.rev20181016.tapitopology.context.DefaultAugmentedTapiCommonContext;
+import org.onosproject.yang.gen.v1.tapitopology.rev20181016.tapitopology.context.augmentedtapicommoncontext.DefaultTopologyContext;
+import org.onosproject.yang.gen.v1.tapitopology.rev20181016.tapitopology.node.DefaultOwnedNodeEdgePoint;
+import org.onosproject.yang.gen.v1.tapitopology.rev20181016.tapitopology.topology.DefaultNode;
+import org.onosproject.yang.gen.v1.tapitopology.rev20181016.tapitopology.topologycontext.DefaultTopology;
import org.onosproject.yang.model.Augmentable;
import static org.easymock.EasyMock.expectLastCall;
@@ -73,10 +75,14 @@
context = new DefaultContext();
topology = TapiTopologyHandler.create().getModelObject();
- DefaultAugmentedTapiCommonContext topologyContext = new DefaultAugmentedTapiCommonContext();
- topologyContext.addToTopology(topology);
+ DefaultTopologyContext topologyContext = TapiTopologyContextHandler.create().getModelObject();
+
+ DefaultAugmentedTapiCommonContext augmentedTopologyContext = new DefaultAugmentedTapiCommonContext();
Augmentable augmentableContext = context;
- augmentableContext.addAugmentation(topologyContext);
+ augmentableContext.addAugmentation(augmentedTopologyContext);
+
+ augmentedTopologyContext.topologyContext(topologyContext);
+ topologyContext.addToTopology(topology);
node1 = TapiNodeHandler.create()
.setTopologyUuid(topology.uuid())
@@ -236,4 +242,4 @@
verify(mockResolver);
}
-}
\ No newline at end of file
+}
diff --git a/apps/odtn/service/src/test/java/org/onosproject/odtn/internal/DefaultTapiResolverTest.java b/apps/odtn/service/src/test/java/org/onosproject/odtn/internal/DefaultTapiResolverTest.java
index 5fcad14..6e4dd3a 100644
--- a/apps/odtn/service/src/test/java/org/onosproject/odtn/internal/DefaultTapiResolverTest.java
+++ b/apps/odtn/service/src/test/java/org/onosproject/odtn/internal/DefaultTapiResolverTest.java
@@ -192,4 +192,4 @@
assertThat(tapiResolver.getNepRefs(filter), is(exp));
}
-}
\ No newline at end of file
+}
diff --git a/apps/odtn/service/src/test/resources/create-connectivity.json b/apps/odtn/service/src/test/resources/create-connectivity.json
index 283de56..35798f4 100644
--- a/apps/odtn/service/src/test/resources/create-connectivity.json
+++ b/apps/odtn/service/src/test/resources/create-connectivity.json
@@ -5,79 +5,30 @@
{
"layer-protocol-name" : "DSR",
"service-interface-point": {
- "service-interface-point-id" : "00000000-0000-4200-0001-110000000000"
+ "service-interface-point-uuid" : "00000001-0000-0000-0000-000000000001"
},
"capacity" : {
},
"direction" : "BIDIRECTIONAL",
"role" : "UNKNOWN",
- "protection-role" : "WORK",
- "local-id": "00000000-0000-4100-0001-110000000000",
- "name" : [
- {
- "value-name" : "port",
- "value" : "1"
- },
- {
- "value-name" : "transponder",
- "value" : "TRNP_A"
- },
- {
- "value-name" : "onos-index",
- "value" : "1"
- },
- {
- "value-name" : "test-driver",
- "value" : "driver"
- }
- ],
- "administrative-state" : "UNLOCKED",
- "operational-state" : "ENABLED",
- "lifecycle-state" : "INSTALLED"
+ "protection-role" : "WORK"
}
,
{
"layer-protocol-name" : "DSR",
"service-interface-point": {
- "service-interface-point-id" : "00000000-0000-4200-0001-210000000000"
+ "service-interface-point-uuid" : "00000001-0000-0000-0000-000000000002"
},
"capacity" : {
},
"direction" : "BIDIRECTIONAL",
"role" : "UNKNOWN",
- "protection-role" : "WORK",
- "local-id": "00000000-0000-4100-0001-210000000000",
- "name" : [
- {
- "value-name" : "port",
- "value" : "1"
- },
- {
- "value-name" : "transponder",
- "value" : "TRNP_B"
- },
- {
- "value-name" : "onos-index",
- "value" : "1"
- },
- {
- "value-name" : "test-driver",
- "value" : "driver"
- }
- ],
- "administrative-state" : "UNLOCKED",
- "operational-state" : "ENABLED",
- "lifecycle-state" : "INSTALLED"
+ "protection-role" : "WORK"
}
],
-
"conn-constraint" : {},
-
"topo-constraint" : {},
-
- "resilience-constraint" : [ ],
-
- "state" : "operational-state"
+ "resilience-constraint" : [ ]
}
}
diff --git a/apps/odtn/service/src/test/resources/delete-connectivity.json b/apps/odtn/service/src/test/resources/delete-connectivity.json
new file mode 100644
index 0000000..850c18f
--- /dev/null
+++ b/apps/odtn/service/src/test/resources/delete-connectivity.json
@@ -0,0 +1,6 @@
+{
+ "tapi-connectivity:input":
+ {
+ "service-id-or-name" : "00000002-0000-0000-0000-000000000001"
+ }
+}
\ No newline at end of file
diff --git a/apps/odtn/service/src/test/resources/nbi-tapi-sample.json b/apps/odtn/service/src/test/resources/nbi-tapi-sample.json
deleted file mode 100644
index 4578336..0000000
--- a/apps/odtn/service/src/test/resources/nbi-tapi-sample.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "tapi-common:context": {
- "service-interface-point": [
- {
- "uuid": "9F759964-2410-44AF-8522-4FCE2C3ED464",
- "layer-protocol-name": ["DSR"],
- "name": [
- {
- "value-name": "port",
- "value": "1"
- },
- {
- "value-name": "transponder",
- "value": "TRPN_A"
- }
- ]
- },
- {
- "uuid": "FBDDC006-8913-4509-BA71-485CFAC89567",
- "layer-protocol-name": ["DSR"],
- "name": [
- {
- "value-name": "port",
- "value": "1"
- },
- {
- "value-name": "transponder",
- "value": "TRPN_B"
- }
- ]
- }
- ],
-
- "tapi-connectivity:connectivity-service": [
- {
- "uuid" : "D0BF25C8-B20C-49C3-9030-1C5AEC993E44",
- "end-point": [
- {
- "local-id" : "TRPN_A-1",
- "layer-protocol-name": "DSR",
- "service-interface-point": {
- "service-interface-point-id" : "9F759964-2410-44AF-8522-4FCE2C3ED464"
- }
- },
- {
- "local-id" : "TRPN_B-1",
- "layer-protocol-name": "DSR",
- "service-interface-point": {
- "service-interface-point-id" : "FBDDC006-8913-4509-BA71-485CFAC89567"
- }
- }
- ]
- }
- ]
- }
-}
diff --git a/apps/odtn/service/src/test/resources/post-nbi-tapi-rpc b/apps/odtn/service/src/test/resources/post-nbi-tapi-rpc
deleted file mode 100644
index 45bdb17..0000000
--- a/apps/odtn/service/src/test/resources/post-nbi-tapi-rpc
+++ /dev/null
@@ -1 +0,0 @@
-curl -X POST http://localhost:8181/onos/restconf/operations/tapi-connectivity:create-connectivity-service -H 'cache-control: no-cache' -H 'content-type: application/json' -d @create-connectivity.json
diff --git a/apps/odtn/service/src/test/resources/post-nbi-tapi-sample b/apps/odtn/service/src/test/resources/post-nbi-tapi-sample
deleted file mode 100644
index ffdd3d9..0000000
--- a/apps/odtn/service/src/test/resources/post-nbi-tapi-sample
+++ /dev/null
@@ -1,2 +0,0 @@
-curl -X POST http://localhost:8181/onos/restconf/data -H 'cache-control: no-cache' -H 'content-type: application/json' -d @nbi-tapi-sample.json
-
diff --git a/apps/odtn/service/src/test/resources/post-tapi-rpc-create-connectivity-service b/apps/odtn/service/src/test/resources/post-tapi-rpc-create-connectivity-service
new file mode 100644
index 0000000..8f3409d
--- /dev/null
+++ b/apps/odtn/service/src/test/resources/post-tapi-rpc-create-connectivity-service
@@ -0,0 +1 @@
+curl -X POST http://localhost:8181/onos/restconf/operations/tapi-connectivity:create-connectivity-service -H 'cache-control: no-cache' -H 'content-type: application/json' -H 'Basic a2FyYWY6a2FyYWY=' -d @create-connectivity.json
diff --git a/apps/odtn/service/src/test/resources/post-tapi-rpc-delete-connectivity-service b/apps/odtn/service/src/test/resources/post-tapi-rpc-delete-connectivity-service
new file mode 100644
index 0000000..b45296e
--- /dev/null
+++ b/apps/odtn/service/src/test/resources/post-tapi-rpc-delete-connectivity-service
@@ -0,0 +1 @@
+curl -X POST http://localhost:8181/onos/restconf/operations/tapi-connectivity:delete-connectivity-service -H 'cache-control: no-cache' -H 'content-type: application/json' -H 'Basic a2FyYWY6a2FyYWY=' -d @delete-connectivity.json