summaryrefslogtreecommitdiffstats
path: root/adaptors/resource-assignment/provider/src/test
diff options
context:
space:
mode:
authorStan Bonev (sb5356) <sb5356@att.com>2021-07-15 13:47:22 -0400
committerStan Bonev (sb5356) <sb5356@att.com>2021-07-15 13:48:47 -0400
commiteb36deb15c4882ec373e972eab40fcb947b5f002 (patch)
treef2561ad8cbc1bf6177f9c5112d936eb3d5ec8abe /adaptors/resource-assignment/provider/src/test
parent87bd7fe2daaa236dea20b4eba7b347175b0e5799 (diff)
RA: Add 2 fields in RA parameters from DG context
Issue-ID: CCSDK-3372 Signed-off-by: Stan Bonev (sb5356) <sb5356@att.com> Change-Id: I7e107c1b1c15dc0336c604b102b11293ee4b8920
Diffstat (limited to 'adaptors/resource-assignment/provider/src/test')
-rw-r--r--adaptors/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/adaptors/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java b/adaptors/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
index dbf0c4aac..1548791d3 100644
--- a/adaptors/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
+++ b/adaptors/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
@@ -961,4 +961,40 @@ public class TestReserve {
Assert.assertTrue(st == QueryStatus.SUCCESS);
Assert.assertTrue(dataSetup.checkRangeItem(resourceName, assetId, "SI::" + entityId + "_test::VPE-Core2::1", "1002"));
}
+
+ @Test
+ public void test015() throws Exception {
+ String t = "015";
+ log.info("============== reserve " + t + " ================================");
+ log.info("=== Test allocating >1 numbers using range-requested-count parameter");
+
+ String entityId = "reserve" + t;
+ String targetId = "port-id-1";
+ String resourceName = "vlan-id-filter";
+
+ String assetId = "Site::" + targetId;
+
+ dataSetup.cleanup();
+
+ SvcLogicContext ctx = new SvcLogicContext();
+ ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL");
+ ctx.setAttribute("ra-input.endpoint-position", "VPE-Core2");
+ ctx.setAttribute("ra-input.check-only", "false");
+
+ ctx.setAttribute("ra-input.resource-name", resourceName);
+ ctx.setAttribute("ra-input.range-requested-count", "2");
+ ctx.setAttribute("ra-input.range-sequential", "true");
+
+ ctx.setAttribute("ra-input.reservation-entity-type", "SI");
+ ctx.setAttribute("ra-input.reservation-entity-id", entityId + "_test");
+ ctx.setAttribute("ra-input.reservation-entity-version", "1");
+
+ ctx.setAttribute("ra-input.reservation-target-id", targetId);
+ ctx.setAttribute("ra-input.reservation-target-type", "Site");
+
+ QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+
+ Assert.assertTrue(st == QueryStatus.SUCCESS);
+ Assert.assertTrue(dataSetup.checkRangeItem(resourceName, assetId, "SI::" + entityId + "_test::VPE-Core2::1", "1002,1003"));
+ }
}