Revision 304d9f02 qa/qa_cluster.py
b/qa/qa_cluster.py | ||
---|---|---|
29 | 29 |
from ganeti import constants |
30 | 30 |
from ganeti import compat |
31 | 31 |
from ganeti import utils |
32 |
from ganeti import pathutils |
|
32 | 33 |
|
33 | 34 |
import qa_config |
34 | 35 |
import qa_utils |
... | ... | |
76 | 77 |
"""gnt-cluster init""" |
77 | 78 |
master = qa_config.GetMasterNode() |
78 | 79 |
|
79 |
rapi_dir = os.path.dirname(constants.RAPI_USERS_FILE)
|
|
80 |
rapi_dir = os.path.dirname(pathutils.RAPI_USERS_FILE)
|
|
80 | 81 |
|
81 | 82 |
# First create the RAPI credentials |
82 | 83 |
fh = tempfile.NamedTemporaryFile() |
... | ... | |
87 | 88 |
tmpru = qa_utils.UploadFile(master["primary"], fh.name) |
88 | 89 |
try: |
89 | 90 |
AssertCommand(["mkdir", "-p", rapi_dir]) |
90 |
AssertCommand(["mv", tmpru, constants.RAPI_USERS_FILE])
|
|
91 |
AssertCommand(["mv", tmpru, pathutils.RAPI_USERS_FILE])
|
|
91 | 92 |
finally: |
92 | 93 |
AssertCommand(["rm", "-f", tmpru]) |
93 | 94 |
finally: |
... | ... | |
361 | 362 |
AssertCommand(cmd, fail=True) |
362 | 363 |
|
363 | 364 |
rapi_cert_backup = qa_utils.BackupFile(master["primary"], |
364 |
constants.RAPI_CERT_FILE)
|
|
365 |
pathutils.RAPI_CERT_FILE)
|
|
365 | 366 |
try: |
366 | 367 |
# Custom RAPI certificate |
367 | 368 |
fh = tempfile.NamedTemporaryFile() |
... | ... | |
475 | 476 |
|
476 | 477 |
def TestClusterMasterFailoverWithDrainedQueue(): |
477 | 478 |
"""gnt-cluster master-failover with drained queue""" |
478 |
drain_check = ["test", "-f", constants.JOB_QUEUE_DRAIN_FILE]
|
|
479 |
drain_check = ["test", "-f", pathutils.JOB_QUEUE_DRAIN_FILE]
|
|
479 | 480 |
|
480 | 481 |
master = qa_config.GetMasterNode() |
481 | 482 |
failovermaster = qa_config.AcquireNode(exclude=master) |
... | ... | |
485 | 486 |
AssertCommand(drain_check, node=node, fail=True) |
486 | 487 |
|
487 | 488 |
# Drain queue on failover master |
488 |
AssertCommand(["touch", constants.JOB_QUEUE_DRAIN_FILE], node=failovermaster)
|
|
489 |
AssertCommand(["touch", pathutils.JOB_QUEUE_DRAIN_FILE], node=failovermaster)
|
|
489 | 490 |
|
490 | 491 |
cmd = ["gnt-cluster", "master-failover"] |
491 | 492 |
try: |
Also available in: Unified diff