1 # Copyright 2017 Red Hat Inc & Xena Networks.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 # Dan Amzulescu, Xena Networks
17 # Christian Trautman, Red Hat Inc.
19 # Usage can be seen below in unit test. This implementation is designed for one
20 # module two port Xena chassis runs only.
23 Xena JSON module for mesh topology.
26 from tools.pkt_gen.xena.json.xena_json import XenaJSON
29 class XenaJSONMesh(XenaJSON):
31 Class to modify and read Xena JSON configuration files. Topology will be set
35 super(XenaJSONMesh, self).__init__()
36 self.set_topology_mesh()
38 def set_topology_mesh(self):
40 Set the test topology to Mesh for bi directional full duplex flow
43 self.json_data['TestOptions']['TopologyConfig']['Topology'] = 'MESH'
44 self.json_data['TestOptions']['TopologyConfig']['Direction'] = 'BIDIR'
45 self.json_data['PortHandler']['EntityList'][0]['PortGroup'] = "UNDEFINED"
46 self.json_data['PortHandler']['EntityList'][1]['PortGroup'] = "UNDEFINED"