Changes to the test framework to support templating of
the json test files to enable the creation of very large
stress test suites. Still a work in progress.
Change-Id: I1a35e4143a2feb577c9ad6048a0339c7b9dc0f89
diff --git a/tests/afrouter/suites/test2.tmpl.json b/tests/afrouter/suites/test2.tmpl.json
new file mode 100644
index 0000000..fc8ef1c
--- /dev/null
+++ b/tests/afrouter/suites/test2.tmpl.json
@@ -0,0 +1,155 @@
+{
+ "environment":{
+ "cmdLine":"afrouter -config arouter_test.json -grpclog",
+ "protoFiles": [
+ {
+ "importPath":"github.com/opencord/voltha-go/protos/",
+ "service":"VolthaService",
+ "package":"voltha"
+ }
+ ],
+ "imports": [
+ "github.com/golang/protobuf/ptypes/empty",
+ "github.com/opencord/voltha-go/protos/openflow_13"
+ ],
+ "protoDesc":"voltha.pb",
+ "protoSubst": [
+ {
+ "from":"google.protobuf.Empty",
+ "to":"empty.Empty"
+ }
+ ],
+ "clients": [
+ {
+ "name":"client",
+ "port":"5000"
+ }
+ ],
+ "servers": [
+ {
+ "name":"core11",
+ "port":"5011"
+ },
+ {
+ "name":"core12",
+ "port":"5012"
+ },
+ {
+ "name":"core21",
+ "port":"5021"
+ },
+ {
+ "name":"core22",
+ "port":"5022"
+ },
+ {
+ "name":"core31",
+ "port":"5031"
+ },
+ {
+ "name":"core32",
+ "port":"5032"
+ }
+ ]
+ },
+ "tests":[
+ {{range $k,$v := .}}
+ {
+ "name":"Test CreateDevice",
+ "send": {
+ "client":"client",
+ "method":"CreateDevice",
+ "param":"{Type:\"simulated_olt\"}",
+ "expect":"{Id:\"abcd1234{{$k}}\",Type:\"simulated_olt\"}",
+ "_meta":""
+ },
+ "servers": [
+ {
+ "name":"core{{$v.Core}}1",
+ "meta": [
+ {
+ "key":"voltha_serial_number",
+ "value":"{{$k}}"
+ }
+ ]
+ },
+ {
+ "name":"core{{$v.Core}}2",
+ "meta": [
+ {
+ "key":"voltha_serial_number",
+ "value":"{{$k}}"
+ }
+ ]
+ }
+ ]
+ },
+ {{end}}
+ {
+ "name":"Test GetDevice",
+ "send": {
+ "client":"client",
+ "method":"GetDevice",
+ "param":"{Id:\"abcd12340\"}",
+ "expect":"{Id:\"abcd12340\",Type:\"simulated_olt\"}",
+ "_meta":""
+ },
+ "servers": [
+ {
+ "name":"core11",
+ "meta": [
+ {
+ "key":"voltha_serial_number",
+ "value":"10000"
+ }
+ ]
+ },
+ {
+ "name":"core12",
+ "meta": [
+ {
+ "key":"voltha_serial_number",
+ "value":"10000"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Test Subscribe",
+ "send": {
+ "client":"client",
+ "method":"Subscribe",
+ "param":"{OfagentId:\"Agent007\"}",
+ "meta": [
+ {
+ "key":"voltha_backend_name",
+ "value":""
+ }
+ ],
+ "expect":"{OfagentId:\"Agent007\",VolthaId:\"core11\"}",
+ "expectMeta": [
+ {
+ "key":"voltha_backend_name",
+ "value":"vcore1"
+ }
+ ]
+ },
+ "servers": [
+ {
+ "name":"core11",
+ "meta": [
+ {
+ "key":"voltha_serial_number",
+ "value":"10001"
+ },
+ {
+ "key":"voltha_backend_name",
+ "value":""
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}