Revision bfbef99b

b/qa/qa_utils.py
514 514
                          utils.ShellQuoteArgs(cmd)).splitlines()
515 515

  
516 516

  
517
def GenericQueryTest(cmd, fields, namefield="name", test_unknown=True):
517
def _AssertListNoUnknownValues(listcmd, fields):
518
  """Assert that the list command does not output unknown values.
519

  
520
  """
521
  master = qa_config.GetMasterNode()
522

  
523
  cmd = [listcmd, "list", "--output", ",".join(fields)]
524

  
525
  output = GetCommandOutput(master.primary,
526
                            utils.ShellQuoteArgs(cmd)).splitlines()
527
  for line in output:
528
    AssertNotIn('?', line)
529

  
530

  
531
def GenericQueryTest(cmd, fields, namefield="name", test_unknown=True,
532
                     test_values_unknown=True):
518 533
  """Runs a number of tests on query commands.
519 534

  
520 535
  @param cmd: Command name
......
550 565
    AssertCommand([cmd, "list", "this.name.certainly.does.not.exist"],
551 566
                  fail=True)
552 567

  
568
  if test_values_unknown:
569
    _AssertListNoUnknownValues(cmd, fields)
570

  
553 571
  # Check exit code for listing unknown field
554 572
  AssertEqual(AssertRedirectedCommand([cmd, "list",
555 573
                                       "--output=field/does/not/exist"],

Also available in: Unified diff