Merge "Change PTL informatin in INFO"
[bottlenecks.git] / testsuites / vstf / vstf_scripts / vstf / agent / env / plugins / model.py
1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 from abc import ABCMeta
11 from abc import abstractmethod
12
13
14 class EnvBuilderPlugin:
15     __metaclass__ = ABCMeta
16
17     def __init__(self):
18         self.host_cfg = None
19         pass
20
21     @abstractmethod
22     def clean(self):
23         pass
24
25     @abstractmethod
26     def load_drivers(self):
27         pass
28
29     @abstractmethod
30     def create_brs(self):
31         pass
32
33     @abstractmethod
34     def config_br_ports(self):
35         pass
36
37     @abstractmethod
38     def create_vms(self):
39         pass
40
41     @abstractmethod
42     def wait_vms(self):
43         pass
44
45     @abstractmethod
46     def check_vm_connectivity(self):
47         pass
48
49     def build(self, cfg_intent):
50         self.host_cfg = cfg_intent
51         self.clean()
52         self.load_drivers()
53         self.create_brs()
54         self.create_vms()
55         self.wait_vms()
56         self.config_br_ports()
57         self.check_vm_connectivity()
58         return True