Merge "Xena_Flow_Fix: Fixes multistream of greater than 64k values"
[vswitchperf.git] / core / vswitch_controller_clean.py
1 # Copyright 2015-2018 Intel Corporation., Tieto
2 #
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
6 #
7 #   http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14
15 """VSwitch controller for basic initialization of vswitch
16 """
17 from core.vswitch_controller import IVswitchController
18
19 class VswitchControllerClean(IVswitchController):
20     """VSwitch controller for Clean deployment scenario.
21
22     Attributes:
23         _vswitch_class: The vSwitch class to be used.
24         _vswitch: The vSwitch object controlled by this controller
25         _deployment_scenario: A string describing the scenario to set-up in the
26             constructor.
27     """
28     def setup(self):
29         """Sets up the switch for Clean.
30         """
31         self._logger.debug('Setup using %s', str(self._vswitch_class))
32
33         try:
34             self._vswitch.start()
35         except:
36             self._vswitch.stop()
37             raise
38
39     def stop(self):
40         """Tears down the switch created in setup().
41         """
42         self._logger.debug('Stop using %s', str(self._vswitch_class))
43         self._vswitch.stop()
44
45     def get_ports_info(self):
46         """See IVswitchController for description
47         """
48         pass
49
50     def dump_vswitch_connections(self):
51         """See IVswitchController for description
52         """
53         pass