Sean Dague | 7011236 | 2012-04-03 13:48:49 -0400 | [diff] [blame] | 1 | # 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 Dague | 7011236 | 2012-04-03 13:48:49 -0400 | [diff] [blame] | 15 | |
| 16 | class StressConfig(object): |
| 17 | """Provides configuration information for whitebox stress tests.""" |
| 18 | |
| 19 | def __init__(self, conf): |
| 20 | self.conf = conf |
| 21 | |
Sean Dague | 7011236 | 2012-04-03 13:48:49 -0400 | [diff] [blame] | 22 | @property |
| 23 | def host_private_key_path(self): |
| 24 | """Path to ssh key for logging into compute nodes.""" |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 25 | return self.conf.compute.path_to_private_key |
Sean Dague | 7011236 | 2012-04-03 13:48:49 -0400 | [diff] [blame] | 26 | |
| 27 | @property |
| 28 | def host_admin_user(self): |
| 29 | """Username for logging into compute nodes.""" |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 30 | return self.conf.compute.ssh_user |
Sean Dague | 7011236 | 2012-04-03 13:48:49 -0400 | [diff] [blame] | 31 | |
| 32 | @property |
| 33 | def nova_logdir(self): |
Sean Dague | f237ccb | 2013-01-04 15:19:14 -0500 | [diff] [blame] | 34 | """Directory containing log files on the compute nodes.""" |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 35 | return self.conf.stress.nova_logdir |
Sean Dague | 7011236 | 2012-04-03 13:48:49 -0400 | [diff] [blame] | 36 | |
| 37 | @property |
| 38 | def controller(self): |
Sean Dague | f237ccb | 2013-01-04 15:19:14 -0500 | [diff] [blame] | 39 | """Controller host.""" |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 40 | return self.conf.stress.controller |
Sean Dague | 7011236 | 2012-04-03 13:48:49 -0400 | [diff] [blame] | 41 | |
| 42 | @property |
| 43 | def max_instances(self): |
Sean Dague | f237ccb | 2013-01-04 15:19:14 -0500 | [diff] [blame] | 44 | """Maximum number of instances to create during test.""" |
Matthew Treinish | 615ea6a | 2013-02-25 17:26:59 -0500 | [diff] [blame] | 45 | return self.conf.stress.max_instances |