Revision 61a980a9 test/ganeti.query_unittest.py

b/test/ganeti.query_unittest.py
743 743
                       (constants.RS_NORMAL, inst.name))
744 744

  
745 745
      if inst.primary_node in offline_nodes:
746
        exp_status = "ERROR_nodeoffline"
746
        exp_status = constants.INSTST_NODEOFFLINE
747 747
      elif inst.primary_node in bad_nodes:
748
        exp_status = "ERROR_nodedown"
748
        exp_status = constants.INSTST_NODEDOWN
749 749
      elif inst.name in live_data:
750 750
        if inst.name in wrongnode_inst:
751
          exp_status = "ERROR_wrongnode"
751
          exp_status = constants.INSTST_WRONGNODE
752 752
        elif inst.admin_up:
753
          exp_status = "running"
753
          exp_status = constants.INSTST_RUNNING
754 754
        else:
755
          exp_status = "ERROR_up"
755
          exp_status = constants.INSTST_ERRORUP
756 756
      elif inst.admin_up:
757
        exp_status = "ERROR_down"
757
        exp_status = constants.INSTST_ERRORDOWN
758 758
      else:
759
        exp_status = "ADMIN_down"
759
        exp_status = constants.INSTST_ADMINDOWN
760 760

  
761 761
      self.assertEqual(row[fieldidx["status"]],
762 762
                       (constants.RS_NORMAL, exp_status))
......
830 830
      self._CheckInstanceConsole(inst, row[fieldidx["console"]])
831 831

  
832 832
    # Ensure all possible status' have been tested
833
    self.assertEqual(tested_status,
834
                     set(["ERROR_nodeoffline", "ERROR_nodedown",
835
                          "running", "ERROR_up", "ERROR_down",
836
                          "ADMIN_down", "ERROR_wrongnode"]))
833
    self.assertEqual(tested_status, constants.INSTST_ALL)
837 834

  
838 835
  def _CheckInstanceConsole(self, instance, (status, consdata)):
839 836
    if instance.name == "inst7":

Also available in: Unified diff