blob: ca86ce5159f0c8d0be7e3e171e23f9770607eec5 [file] [log] [blame]
Sean Dague70112362012-04-03 13:48:49 -04001# Copyright 2011 Quanta Research Cambridge, Inc.
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
15import ConfigParser
16
17
18class StressConfig(object):
19 """Provides configuration information for whitebox stress tests."""
20
21 def __init__(self, conf):
22 self.conf = conf
23
24 def get(self, item_name, default_value=None):
25 try:
26 return self.conf.get("stress", item_name)
27 except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
28 return default_value
29
30 @property
31 def host_private_key_path(self):
32 """Path to ssh key for logging into compute nodes."""
33 return self.get("host_private_key_path", None)
34
35 @property
36 def host_admin_user(self):
37 """Username for logging into compute nodes."""
38 return self.get("host_admin_user", None)
39
40 @property
41 def nova_logdir(self):
Sean Daguef237ccb2013-01-04 15:19:14 -050042 """Directory containing log files on the compute nodes."""
Sean Dague70112362012-04-03 13:48:49 -040043 return self.get("nova_logdir", None)
44
45 @property
46 def controller(self):
Sean Daguef237ccb2013-01-04 15:19:14 -050047 """Controller host."""
Sean Dague70112362012-04-03 13:48:49 -040048 return self.get("controller", None)
49
50 @property
51 def max_instances(self):
Sean Daguef237ccb2013-01-04 15:19:14 -050052 """Maximum number of instances to create during test."""
Sean Dague70112362012-04-03 13:48:49 -040053 return self.get("max_instances", 16)