Revision 52b5d286 test/ganeti.query_unittest.py
b/test/ganeti.query_unittest.py | ||
---|---|---|
289 | 289 |
objects.Node(name="node3", drained=False), |
290 | 290 |
] |
291 | 291 |
for live_data in [None, dict.fromkeys([node.name for node in nodes], {})]: |
292 |
nqd = query.NodeQueryData(nodes, live_data, None, None, None, None) |
|
292 |
nqd = query.NodeQueryData(nodes, live_data, None, None, None, None, None)
|
|
293 | 293 |
|
294 | 294 |
q = self._Create(["name", "drained"]) |
295 | 295 |
self.assertEqual(q.RequestedData(), set([query.NQ_CONFIG])) |
... | ... | |
313 | 313 |
q = self._Create(selected) |
314 | 314 |
self.assertEqual(q.RequestedData(), |
315 | 315 |
set([query.NQ_CONFIG, query.NQ_LIVE, query.NQ_INST, |
316 |
query.NQ_GROUP])) |
|
316 |
query.NQ_GROUP, query.NQ_OOB]))
|
|
317 | 317 |
|
318 | 318 |
node_names = ["node%s" % i for i in range(20)] |
319 | 319 |
master_name = node_names[3] |
... | ... | |
376 | 376 |
ng_uuid: objects.NodeGroup(name="ng1", uuid=ng_uuid), |
377 | 377 |
} |
378 | 378 |
|
379 |
oob_support = dict((name, False) for name in node_names) |
|
380 |
|
|
379 | 381 |
master_node.group = ng_uuid |
380 | 382 |
|
381 | 383 |
nqd = query.NodeQueryData(nodes, live_data, master_name, |
382 |
node_to_primary, node_to_secondary, groups) |
|
384 |
node_to_primary, node_to_secondary, groups, |
|
385 |
oob_support) |
|
383 | 386 |
result = q.Query(nqd) |
384 | 387 |
self.assert_(compat.all(len(row) == len(selected) for row in result)) |
385 | 388 |
self.assertEqual([row[field_index["name"]] for row in result], |
... | ... | |
442 | 445 |
live_data = dict.fromkeys([node.name for node in nodes], {}) |
443 | 446 |
|
444 | 447 |
# No data |
445 |
nqd = query.NodeQueryData(None, None, None, None, None, None) |
|
448 |
nqd = query.NodeQueryData(None, None, None, None, None, None, None)
|
|
446 | 449 |
self.assertEqual(query._GetLiveNodeField("hello", constants.QFT_NUMBER, |
447 | 450 |
nqd, nodes[0]), |
448 | 451 |
(constants.QRFS_NODATA, None)) |
Also available in: Unified diff