Commit 1ef6e776 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Merge branch 'devel-2.3'



* devel-2.3:
  QA: Run cluster-verify as part of all instance tests
  QA: Fix typo and add “not”
  ensure-dirs: Speed up when using big queues
  Fix gnt-cluster verify with diskless instances

Conflicts:
	lib/cmdlib.py: Trivial
	qa/ganeti-qa.py: Trivial
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parents 153533f3 d27150a9
......@@ -98,14 +98,17 @@ _ensure_datadir() {
_ensure_file ${DATADIR}/queue/lock 0600 "$(_fileset_owner masterd)"
if ! [[ -z "${full_run}" ]]; then
for file in $(_gather_files ${DATADIR}/queue 0600 @GNTMASTERUSER@ \
@GNTMASTERDGROUP@); do
_ensure_file "${file}" 0600 "$(_fileset_owner masterd)"
local queue_owner="$(_fileset_owner masterd)"
local ssconf_owner="$(_fileset_owner noded)"
_gather_files ${DATADIR}/queue 0600 @GNTMASTERUSER@ @GNTMASTERDGROUP@ | \
while read path; do
_ensure_file "$path" 0600 "$queue_owner"
done
for file in $(_gather_files ${DATADIR} 0600 root \
@GNTMASTERDGROUP@ -name 'ssconf_*'); do
_ensure_file "${file}" 0444 "$(_fileset_owner noded)"
_gather_files ${DATADIR} 0600 root @GNTMASTERDGROUP@ -name 'ssconf_*' | \
while read path; do
_ensure_file "$path" 0444 "$ssconf_owner"
done
fi
}
......
......@@ -40,6 +40,7 @@ import socket
import tempfile
import shutil
import operator
import itertools
from ganeti import ssh
from ganeti import utils
......@@ -2029,12 +2030,16 @@ class LUVerifyCluster(LogicalUnit):
node_disks = {}
node_disks_devonly = {}
diskless_instances = set()
diskless = constants.DT_DISKLESS
for nname in nodelist:
node_instances = list(itertools.chain(node_image[nname].pinst,
node_image[nname].sinst))
diskless_instances.update(inst for inst in node_instances
if instanceinfo[inst].disk_template == diskless)
disks = [(inst, disk)
for instlist in [node_image[nname].pinst,
node_image[nname].sinst]
for inst in instlist
for inst in node_instances
for disk in instanceinfo[inst].disks]
if not disks:
......@@ -2081,6 +2086,11 @@ class LUVerifyCluster(LogicalUnit):
for ((inst, _), status) in zip(disks, data):
instdisk.setdefault(inst, {}).setdefault(nname, []).append(status)
# Add empty entries for diskless instances.
for inst in diskless_instances:
assert inst not in instdisk
instdisk[inst] = {}
assert compat.all(len(statuses) == len(instanceinfo[inst].disks) and
len(nnames) <= len(instanceinfo[inst].all_nodes)
for inst, nnames in instdisk.items()
......
......@@ -226,6 +226,8 @@ def RunCommonInstanceTests(instance):
RunTestIf("tags", qa_tags.TestInstanceTags, instance)
RunTestIf("cluster-verify", qa_cluster.TestClusterVerify)
RunTestIf("rapi", qa_rapi.TestInstance, instance)
# Lists instances, too
......@@ -430,7 +432,6 @@ def main():
snode = qa_config.AcquireNode(exclude=pnode)
try:
instance = RunTest(func, pnode, snode)
RunTestIf("cluster-verify", qa_cluster.TestClusterVerify)
RunCommonInstanceTests(instance)
RunGroupListTests()
if qa_config.TestEnabled('instance-convert-disk'):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment