Revision 7910e7a5

b/qa/ganeti-qa.py
207 207
  if qa_config.TestEnabled('instance-failover'):
208 208
    RunTest(qa_instance.TestInstanceFailover, instance)
209 209

  
210
  if qa_config.TestEnabled('instance-replace-disks'):
211
    othernode = qa_config.AcquireNode(exclude=pnode)
212
    try:
213
      RunTest(qa_instance.TestReplaceDisks,
214
              instance, pnode, snode, othernode)
215
    finally:
216
      qa_config.ReleaseNode(othernode)
217

  
210 218
  if qa_config.TestEnabled('node-evacuate'):
211 219
    RunTest(qa_node.TestNodeEvacuate, pnode, snode)
212 220

  
b/qa/qa-sample.yaml
69 69
  # they support the `gnt-instance console' command.
70 70
  instance-console: False
71 71

  
72
  # Disabled by default because it takes rather long
73
  instance-replace-disks: False
74

  
72 75
  # Make sure not to include the disk(s) required for Dom0 to be included in
73 76
  # the volume group used for instances. Otherwise the whole system may stop
74 77
  # working until restarted.
b/qa/qa_instance.py
194 194
                       utils.ShellQuoteArgs(cmd)).wait(), 0)
195 195

  
196 196

  
197
@qa_utils.DefineHook('instance-replace-disks')
198
def TestReplaceDisks(instance, pnode, snode, othernode):
199
  """gnt-instance replace-disks"""
200
  master = qa_config.GetMasterNode()
201

  
202
  def buildcmd(args):
203
    cmd = ['gnt-instance', 'replace-disks']
204
    cmd.extend(args)
205
    cmd.append(instance["name"])
206
    return cmd
207

  
208
  cmd = buildcmd(["-p"])
209
  AssertEqual(StartSSH(master['primary'],
210
                       utils.ShellQuoteArgs(cmd)).wait(), 0)
211

  
212
  cmd = buildcmd(["-s"])
213
  AssertEqual(StartSSH(master['primary'],
214
                       utils.ShellQuoteArgs(cmd)).wait(), 0)
215

  
216
  cmd = buildcmd(["--new-secondary=%s" % othernode["primary"]])
217
  AssertEqual(StartSSH(master['primary'],
218
                       utils.ShellQuoteArgs(cmd)).wait(), 0)
219

  
220
  # Restore
221
  cmd = buildcmd(["--new-secondary=%s" % snode["primary"]])
222
  AssertEqual(StartSSH(master['primary'],
223
                       utils.ShellQuoteArgs(cmd)).wait(), 0)
224

  
225

  
197 226
@qa_utils.DefineHook('backup-export')
198 227
def TestInstanceExport(instance, node):
199 228
  """gnt-backup export"""

Also available in: Unified diff