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 blocks topology
26 from tools.pkt_gen.xena.json.xena_json import XenaJSON
29 class XenaJSONBlocks(XenaJSON):
31 Class to modify and read Xena JSON configuration files. Topology will be set
35 super(XenaJSONBlocks, self).__init__()
36 self.set_topology_blocks()
38 def set_topology_blocks(self):
40 Set the test topology to a West to East config for half duplex flow with
41 port 0 as the sender and port 1 as the receiver.
44 self.json_data['TestOptions']['TopologyConfig']['Topology'] = 'BLOCKS'
45 self.json_data['TestOptions']['TopologyConfig'][
46 'Direction'] = 'WEST_EAST'
47 self.json_data['PortHandler']['EntityList'][0][
49 self.json_data['PortHandler']['EntityList'][1][