Revision 4c1a464b qa/qa_instance.py

b/qa/qa_instance.py
1 1
#
2 2
#
3 3

  
4
# Copyright (C) 2007, 2011 Google Inc.
4
# Copyright (C) 2007, 2011, 2012 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
147 147
           _ReadSsconfInstanceList())
148 148

  
149 149

  
150
def TestInstanceRename(rename_source, rename_target):
151
  """gnt-instance rename"""
152
  _CheckSsconfInstanceList(rename_source)
153
  AssertCommand(["gnt-instance", "rename", rename_source, rename_target])
154
  _CheckSsconfInstanceList(rename_target)
155
  AssertCommand(["gnt-instance", "rename", rename_target, rename_source])
150
def TestInstanceRenameAndBack(rename_source, rename_target):
151
  """gnt-instance rename
152

  
153
  This must leave the instance with the original name, not the target
154
  name.
155

  
156
  """
156 157
  _CheckSsconfInstanceList(rename_source)
158
  # first do a rename to a different actual name, expecting it to fail
157 159
  qa_utils.AddToEtcHosts(["meeeeh-not-exists", rename_target])
158 160
  try:
159 161
    AssertCommand(["gnt-instance", "rename", rename_source, rename_target],
......
161 163
    _CheckSsconfInstanceList(rename_source)
162 164
  finally:
163 165
    qa_utils.RemoveFromEtcHosts(["meeeeh-not-exists", rename_target])
166
  # and now rename instance to rename_target...
164 167
  AssertCommand(["gnt-instance", "rename", rename_source, rename_target])
165 168
  _CheckSsconfInstanceList(rename_target)
169
  # and back
170
  AssertCommand(["gnt-instance", "rename", rename_target, rename_source])
171
  _CheckSsconfInstanceList(rename_source)
166 172

  
167 173

  
168 174
def TestInstanceFailover(instance):

Also available in: Unified diff