Revision 66d1f035 qa/qa_cluster.py

b/qa/qa_cluster.py
27 27
import os.path
28 28

  
29 29
from ganeti import constants
30
from ganeti import compat
30 31
from ganeti import utils
31 32

  
32 33
import qa_config
33 34
import qa_utils
34 35
import qa_error
35 36

  
36
from qa_utils import AssertEqual, AssertCommand
37
from qa_utils import AssertEqual, AssertCommand, GetCommandOutput
37 38

  
38 39

  
39 40
def _RemoveFileFromAllNodes(filename):
......
150 151
                 "oob_program="])
151 152

  
152 153

  
154
def TestClusterEpo():
155
  """gnt-cluster epo"""
156
  master = qa_config.GetMasterNode()
157

  
158
  # Assert that OOB is unavailable for all nodes
159
  result_output = GetCommandOutput(master["primary"],
160
                                   "gnt-node list --verbose --no-header -o"
161
                                   " powered")
162
  AssertEqual(compat.all(powered == "(unavail)"
163
                         for powered in result_output.splitlines()), True)
164

  
165
  # Conflicting
166
  AssertCommand(["gnt-cluster", "epo", "--groups", "--all"], fail=True)
167
  # --all doesn't expect arguments
168
  AssertCommand(["gnt-cluster", "epo", "--all", "some_arg"], fail=True)
169

  
170
  # Unless --all is given master is not allowed to be in the list
171
  AssertCommand(["gnt-cluster", "epo", "-f", master["primary"]], fail=True)
172

  
173
  # This shouldn't fail
174
  AssertCommand(["gnt-cluster", "epo", "-f", "--all"])
175

  
176
  # All instances should have been stopped now
177
  result_output = GetCommandOutput(master["primary"],
178
                                   "gnt-instance list --no-header -o status")
179
  AssertEqual(compat.all(status == "ADMIN_down"
180
                         for status in result_output.splitlines()), True)
181

  
182
  # Now start everything again
183
  AssertCommand(["gnt-cluster", "epo", "--on", "-f", "--all"])
184

  
185
  # All instances should have been started now
186
  result_output = GetCommandOutput(master["primary"],
187
                                   "gnt-instance list --no-header -o status")
188
  AssertEqual(compat.all(status == "running"
189
                         for status in result_output.splitlines()), True)
190

  
191

  
153 192
def TestClusterVerify():
154 193
  """gnt-cluster verify"""
155 194
  AssertCommand(["gnt-cluster", "verify"])

Also available in: Unified diff