koder aka kdanilov | 22d134e | 2016-11-08 11:33:19 +0200 | [diff] [blame^] | 1 | from typing import List, Callable, Any, Dict, Optional |
| 2 | from concurrent.futures import ThreadPoolExecutor |
| 3 | |
| 4 | |
| 5 | from .timeseries import SensorDatastore |
| 6 | from . import inode |
| 7 | from .start_vms import OSCreds |
| 8 | from .storage import IStorage |
| 9 | from .config import Config |
| 10 | |
| 11 | |
koder aka kdanilov | 3b4da8b | 2016-10-17 00:17:53 +0300 | [diff] [blame] | 12 | class TestRun: |
| 13 | """Test run information""" |
koder aka kdanilov | 22d134e | 2016-11-08 11:33:19 +0200 | [diff] [blame^] | 14 | def __init__(self, config: Config, storage: IStorage): |
koder aka kdanilov | 3b4da8b | 2016-10-17 00:17:53 +0300 | [diff] [blame] | 15 | # NodesInfo list |
koder aka kdanilov | 22d134e | 2016-11-08 11:33:19 +0200 | [diff] [blame^] | 16 | self.nodes_info = [] # type: List[inode.NodeInfo] |
koder aka kdanilov | 3b4da8b | 2016-10-17 00:17:53 +0300 | [diff] [blame] | 17 | |
| 18 | # Nodes list |
koder aka kdanilov | 22d134e | 2016-11-08 11:33:19 +0200 | [diff] [blame^] | 19 | self.nodes = [] # type: List[inode.INode] |
koder aka kdanilov | 3b4da8b | 2016-10-17 00:17:53 +0300 | [diff] [blame] | 20 | |
koder aka kdanilov | 22d134e | 2016-11-08 11:33:19 +0200 | [diff] [blame^] | 21 | self.build_meta = {} # type: Dict[str,Any] |
| 22 | self.clear_calls_stack = [] # type: List[Callable[['TestRun'], None]] |
koder aka kdanilov | 3b4da8b | 2016-10-17 00:17:53 +0300 | [diff] [blame] | 23 | |
| 24 | # created openstack nodes |
koder aka kdanilov | 22d134e | 2016-11-08 11:33:19 +0200 | [diff] [blame^] | 25 | self.openstack_nodes_ids = [] # type: List[str] |
koder aka kdanilov | 3b4da8b | 2016-10-17 00:17:53 +0300 | [diff] [blame] | 26 | self.sensors_mon_q = None |
| 27 | |
| 28 | # openstack credentials |
koder aka kdanilov | 22d134e | 2016-11-08 11:33:19 +0200 | [diff] [blame^] | 29 | self.fuel_openstack_creds = None # type: Optional[OSCreds] |
koder aka kdanilov | 3b4da8b | 2016-10-17 00:17:53 +0300 | [diff] [blame] | 30 | |
koder aka kdanilov | 22d134e | 2016-11-08 11:33:19 +0200 | [diff] [blame^] | 31 | self.storage = storage |
| 32 | self.config = config |
| 33 | self.sensors_data = SensorDatastore() |
| 34 | |
| 35 | def get_pool(self): |
| 36 | return ThreadPoolExecutor(self.config.get('worker_pool_sz', 32)) |
koder aka kdanilov | 3b4da8b | 2016-10-17 00:17:53 +0300 | [diff] [blame] | 37 | |