# only used by teuthology-suite.
default_machine_type: awesomebox
+ # Control how many machines need to be free in the cluster. 0 means
+ # Teuthology can use the entire cluster.
+ reserve_machines: 5
+
# The host and port to use for the beanstalkd queue. This is required
# for scheduled jobs.
queue_host: localhost
_defaults = {
'archive_base': '/var/lib/teuthworker/archive',
'automated_scheduling': False,
+ 'reserve_machines': 5,
'ceph_git_base_url': 'https://github.com/ceph/',
'gitbuilder_host': 'gitbuilder.ceph.com',
'lab_domain': 'front.sepia.ceph.com',
machine_type = config[1]
how_many = config[0]
# We want to make sure there are always this many machines available
- to_reserve = 5
+ to_reserve = teuth_config.reserve_machines
+ assert isinstance(to_reserve, int), 'reserve_machines must be integer'
+ assert (to_reserve >= 0), 'reserve_machines should >= 0'
# change the status during the locking process
report.try_push_job_info(ctx.config, dict(status='waiting'))
"git://git.ceph.com/"
assert conf_obj.ceph_git_base_url == "git://git.ceph.com/"
+ def test_get_reserve_machines_default(self):
+ conf_obj = self.test_class()
+ conf_obj.yaml_path = ''
+ conf_obj.load()
+ assert conf_obj.reserve_machines == 5
+
+ def test_set_reserve_machines_via_private(self):
+ conf_obj = self.test_class()
+ conf_obj._conf['reserve_machines'] = 2
+ assert conf_obj.reserve_machines == 2
+
def test_set_nonstandard(self):
conf_obj = self.test_class()
conf_obj.something = 'something else'