summaryrefslogtreecommitdiffstats
path: root/it/jvpp-benchmark/src/test
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-05-28 17:56:18 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-05-29 09:05:50 +0200
commitbed970cdde06918fe600340a98337a0f9707f3bf (patch)
treee9dce8dae2566929ba6dd0758132be6388093756 /it/jvpp-benchmark/src/test
parentfb10579575c4cdc9c4de330c955cc470a8ca8892 (diff)
jvpp-benchmark: measure classifyAddDelTable
Synchronously creates classify tables. By default 20x2s warmup and 100x2s measurement iterations are performed. VPP is restarted after each iteration. Each invocation of classifyAddDelTable uses tables from precomputed set of size tableSetSize. Tables from the set are used in round-robin fashion. Run with: sudo java -jar ./target/jvpp-benchmark-exec.jar \ ClassifyTableCreateBenchmark To specify aclSetSize (default=100), use: sudo java -jar ./target/jvpp-benchmark-exec.jar \ ClassifyTableCreateBenchmark -p tableSetSize=1000 To see more options, use java -jar ./target/jvpp-benchmark-exec.jar -h Change-Id: I387d879bc99dce45f93d66e8a99f7206f067b443 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'it/jvpp-benchmark/src/test')
-rw-r--r--it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/acl/AclProviderImplTest.java (renamed from it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/AclProviderImplTest.java)2
-rw-r--r--it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableProviderImplTest.java39
2 files changed, 40 insertions, 1 deletions
diff --git a/it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/AclProviderImplTest.java b/it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/acl/AclProviderImplTest.java
index fd4b0d7ff..d54d178e1 100644
--- a/it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/AclProviderImplTest.java
+++ b/it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/acl/AclProviderImplTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package io.fd.hc2vpp.it.jvpp.benchmark;
+package io.fd.hc2vpp.it.jvpp.benchmark.acl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
diff --git a/it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableProviderImplTest.java b/it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableProviderImplTest.java
new file mode 100644
index 000000000..8f11077e0
--- /dev/null
+++ b/it/jvpp-benchmark/src/test/java/io/fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableProviderImplTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018 Cisco and/or its affiliates.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.fd.hc2vpp.it.jvpp.benchmark.classify;
+
+import static org.junit.Assert.*;
+
+import io.fd.vpp.jvpp.acl.dto.AclAddReplace;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
+import org.junit.Test;
+
+public class ClassifyTableProviderImplTest {
+ @Test
+ public void testTablesDiffer() throws Exception {
+ final ClassifyTableProviderImpl provider = new ClassifyTableProviderImpl(2);
+ final ClassifyAddDelTable table0 = provider.next();
+ final ClassifyAddDelTable table1 = provider.next();
+ final ClassifyAddDelTable table2 = provider.next();
+ final ClassifyAddDelTable table3 = provider.next();
+
+ // Test if ACLs are provided in round-robin fashion
+ assertEquals("Tables 0 and 2 should be equal", table0, table2);
+ assertEquals("Tables 1 and 3 should be equal", table1, table3);
+ assertNotEquals("Tables 0 and 1 should be different", table0, table1);
+ }
+} \ No newline at end of file