Skip to content
Snippets Groups Projects
Commit 23103544 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Implement disk templates for burnin from QA.

Reviewed-by: iustinp
parent 12c3449a
No related branches found
No related tags found
No related merge requests found
...@@ -72,6 +72,7 @@ tests: ...@@ -72,6 +72,7 @@ tests:
# Other settings # Other settings
options: options:
burnin-instances: 2 burnin-instances: 2
burnin-disk-template: remote_raid1
# Directory containing QA hooks # Directory containing QA hooks
#hooks-dir: hooks/ #hooks-dir: hooks/
...@@ -117,26 +117,30 @@ def TestClusterBurnin(): ...@@ -117,26 +117,30 @@ def TestClusterBurnin():
"""Burnin""" """Burnin"""
master = qa_config.GetMasterNode() master = qa_config.GetMasterNode()
disk_template = (qa_config.get('options', {}).
get('burnin-disk-template', 'remote_raid1'))
# Get as many instances as we need # Get as many instances as we need
instances = [] instances = []
try: try:
num = qa_config.get('options', {}).get('burnin-instances', 1) try:
for _ in xrange(0, num): num = qa_config.get('options', {}).get('burnin-instances', 1)
instances.append(qa_config.AcquireInstance()) for _ in xrange(0, num):
except qa_error.OutOfInstancesError: instances.append(qa_config.AcquireInstance())
print "Not enough instances, continuing anyway." except qa_error.OutOfInstancesError:
print "Not enough instances, continuing anyway."
if len(instances) < 1: if len(instances) < 1:
raise qa_error.Error("Burnin needs at least one instance") raise qa_error.Error("Burnin needs at least one instance")
# Run burnin
try:
script = qa_utils.UploadFile(master['primary'], '../tools/burnin') script = qa_utils.UploadFile(master['primary'], '../tools/burnin')
try: try:
# Run burnin
cmd = [script, cmd = [script,
'--os=%s' % qa_config.get('os'), '--os=%s' % qa_config.get('os'),
'--os-size=%s' % qa_config.get('os-size'), '--os-size=%s' % qa_config.get('os-size'),
'--swap-size=%s' % qa_config.get('swap-size')] '--swap-size=%s' % qa_config.get('swap-size'),
'--disk-template=%s' % disk_template]
cmd += [inst['name'] for inst in instances] cmd += [inst['name'] for inst in instances]
AssertEqual(StartSSH(master['primary'], AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0) utils.ShellQuoteArgs(cmd)).wait(), 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment