1133 |
1133 |
failovermaster.Release()
|
1134 |
1134 |
|
1135 |
1135 |
|
|
1136 |
def TestUpgrade():
|
|
1137 |
"""Test gnt-cluster upgrade.
|
|
1138 |
|
|
1139 |
This tests the 'gnt-cluster upgrade' command by flipping
|
|
1140 |
between the current and a different version of Ganeti.
|
|
1141 |
To also recover subtile points in the configuration up/down
|
|
1142 |
grades, instances are left over both upgrades.
|
|
1143 |
|
|
1144 |
"""
|
|
1145 |
this_version = qa_config.get("dir-version")
|
|
1146 |
other_version = qa_config.get("other-dir-version")
|
|
1147 |
if this_version is None or other_version is None:
|
|
1148 |
print qa_utils.FormatInfo("Test not run, as versions not specified")
|
|
1149 |
return
|
|
1150 |
|
|
1151 |
inst_creates = []
|
|
1152 |
upgrade_instances = qa_config.get("upgrade-instances", [])
|
|
1153 |
live_instances = []
|
|
1154 |
for (test_name, templ, cf, n) in qa_instance.available_instance_tests:
|
|
1155 |
if (qa_config.TestEnabled(test_name) and
|
|
1156 |
qa_config.IsTemplateSupported(templ) and
|
|
1157 |
templ in upgrade_instances):
|
|
1158 |
inst_creates.append((cf, n))
|
|
1159 |
break
|
|
1160 |
|
|
1161 |
for (cf, n) in inst_creates:
|
|
1162 |
nodes = qa_config.AcquireManyNodes(n)
|
|
1163 |
live_instances.append(cf(nodes))
|
|
1164 |
|
|
1165 |
AssertCommand(["gnt-cluster", "upgrade", "--to", other_version])
|
|
1166 |
AssertCommand(["gnt-cluster", "verify"])
|
|
1167 |
|
|
1168 |
for instance in live_instances:
|
|
1169 |
qa_instance.TestInstanceRemove(instance)
|
|
1170 |
instance.Release()
|
|
1171 |
live_instances = []
|
|
1172 |
for (cf, n) in inst_creates:
|
|
1173 |
nodes = qa_config.AcquireManyNodes(n)
|
|
1174 |
live_instances.append(cf(nodes))
|
|
1175 |
|
|
1176 |
AssertCommand(["gnt-cluster", "upgrade", "--to", this_version])
|
|
1177 |
AssertCommand(["gnt-cluster", "verify"])
|
|
1178 |
|
|
1179 |
for instance in live_instances:
|
|
1180 |
qa_instance.TestInstanceRemove(instance)
|
|
1181 |
instance.Release()
|
|
1182 |
|
1136 |
1183 |
def _NodeQueueDrainFile(node):
|
1137 |
1184 |
"""Returns path to queue drain file for a node.
|
1138 |
1185 |
|