#
#
-# Copyright (C) 2007 Google Inc.
+# Copyright (C) 2007, 2010 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Initialize cluster
cmd = ['gnt-cluster', 'init']
+ cmd.append("--primary-ip-version=%d" %
+ qa_config.get("primary_ip_version", 4))
+
if master.get('secondary', None):
cmd.append('--secondary-ip=%s' % master['secondary'])
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
+def TestClusterReservedLvs():
+ """gnt-cluster reserved lvs"""
+ master = qa_config.GetMasterNode()
+ CVERIFY = ['gnt-cluster', 'verify']
+ for rcode, cmd in [
+ (0, CVERIFY),
+ (0, ['gnt-cluster', 'modify', '--reserved-lvs', '']),
+ (0, ['lvcreate', '-L1G', '-nqa-test', 'xenvg']),
+ (1, CVERIFY),
+ (0, ['gnt-cluster', 'modify', '--reserved-lvs', 'qa-test,other-test']),
+ (0, CVERIFY),
+ (0, ['gnt-cluster', 'modify', '--reserved-lvs', 'qa-.*']),
+ (0, CVERIFY),
+ (0, ['gnt-cluster', 'modify', '--reserved-lvs', '']),
+ (1, CVERIFY),
+ (0, ['lvremove', '-f', 'xenvg/qa-test']),
+ (0, CVERIFY),
+ ]:
+ AssertEqual(StartSSH(master['primary'],
+ utils.ShellQuoteArgs(cmd)).wait(), rcode)
+
def TestClusterInfo():
"""gnt-cluster info"""
parallel = options.get('burnin-in-parallel', False)
check_inst = options.get('burnin-check-instances', False)
do_rename = options.get('burnin-rename', '')
+ do_reboot = options.get('burnin-reboot', True)
+ reboot_types = options.get("reboot-types", constants.REBOOT_TYPES)
# Get as many instances as we need
instances = []
cmd.append('--http-check')
if do_rename:
cmd.append('--rename=%s' % do_rename)
+ if not do_reboot:
+ cmd.append('--no-reboot')
+ else:
+ cmd.append('--reboot-types=%s' % ",".join(reboot_types))
cmd += [inst['name'] for inst in instances]
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestClusterMasterFailover():
- """gnt-cluster masterfailover"""
+ """gnt-cluster master-failover"""
master = qa_config.GetMasterNode()
failovermaster = qa_config.AcquireNode(exclude=master)
try:
- cmd = ['gnt-cluster', 'masterfailover']
+ cmd = ['gnt-cluster', 'master-failover']
AssertEqual(StartSSH(failovermaster['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
- cmd = ['gnt-cluster', 'masterfailover']
+ cmd = ['gnt-cluster', 'master-failover']
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
finally: