blob: 25cb9101949ebbf464296fa8cafcd1c4e47f4f6e [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
Sean Dague70112362012-04-03 13:48:49 -040015
16class StressConfig(object):
17 """Provides configuration information for whitebox stress tests."""
18
19 def __init__(self, conf):
20 self.conf = conf
21
Sean Dague70112362012-04-03 13:48:49 -040022 @property
23 def host_private_key_path(self):
24 """Path to ssh key for logging into compute nodes."""
Matthew Treinish615ea6a2013-02-25 17:26:59 -050025 return self.conf.compute.path_to_private_key
Sean Dague70112362012-04-03 13:48:49 -040026
27 @property
28 def host_admin_user(self):
29 """Username for logging into compute nodes."""
Matthew Treinish615ea6a2013-02-25 17:26:59 -050030 return self.conf.compute.ssh_user
Sean Dague70112362012-04-03 13:48:49 -040031
32 @property
33 def nova_logdir(self):
Sean Daguef237ccb2013-01-04 15:19:14 -050034 """Directory containing log files on the compute nodes."""
Matthew Treinish615ea6a2013-02-25 17:26:59 -050035 return self.conf.stress.nova_logdir
Sean Dague70112362012-04-03 13:48:49 -040036
37 @property
38 def controller(self):
Sean Daguef237ccb2013-01-04 15:19:14 -050039 """Controller host."""
Matthew Treinish615ea6a2013-02-25 17:26:59 -050040 return self.conf.stress.controller
Sean Dague70112362012-04-03 13:48:49 -040041
42 @property
43 def max_instances(self):
Sean Daguef237ccb2013-01-04 15:19:14 -050044 """Maximum number of instances to create during test."""
Matthew Treinish615ea6a2013-02-25 17:26:59 -050045 return self.conf.stress.max_instances