Revision 5ae7cd11 qa/qa_node.py

b/qa/qa_node.py
150 150
      else:
151 151
        test_allocatable = ["yes", "no"]
152 152

  
153
      if (constants.SF_ALLOCATABLE in
154
          constants.MODIFIABLE_STORAGE_FIELDS.get(storage_type, [])):
155
        assert_fn = AssertEqual
156
      else:
153
      fail = (constants.SF_ALLOCATABLE not in
154
              constants.MODIFIABLE_STORAGE_FIELDS.get(storage_type, []))
155

  
156
      if fail:
157 157
        assert_fn = AssertNotEqual
158
      else:
159
        assert_fn = AssertEqual
158 160

  
159 161
      for i in test_allocatable:
160 162
        cmd = ["gnt-node", "modify-storage", "--allocatable", i,
......
162 164
        assert_fn(StartSSH(master["primary"],
163 165
                  utils.ShellQuoteArgs(cmd)).wait(), 0)
164 166

  
167
        # Verify list output
168
        cmd = ["gnt-node", "list-storage", "--storage-type", storage_type,
169
               "--output=name,allocatable", "--separator=|",
170
               "--no-headers", node_name]
171
        listout = qa_utils.GetCommandOutput(master["primary"],
172
                                            utils.ShellQuoteArgs(cmd))
173
        for line in listout.splitlines():
174
          (vfy_name, vfy_allocatable) = line.split("|")
175
          if vfy_name == st_name and not fail:
176
            AssertEqual(vfy_allocatable, i[0].upper())
177
          else:
178
            AssertEqual(vfy_allocatable, st_allocatable)
179

  
165 180
      # Test repair functionality
166 181
      cmd = ["gnt-node", "repair-storage", node_name, storage_type, st_name]
167 182

  

Also available in: Unified diff