コード例 #1
0
 def test_get_resources_not_found(self):
     for locator in [Locator(vm=VmLocator("1234567")),
                     Locator(disk=DiskLocator("891"))]:
         request = GetResourcesRequest([locator])
         response = rpc_call(self.host_client.get_resources, request)
         assert_that(response.result, is_(GetResourcesResultCode.OK))
         assert_that(response.resources, is_([]))
コード例 #2
0
 def get_disk(self, disk_id, expect_found=True):
     request = GetResourcesRequest([Locator(disk=DiskLocator(disk_id))])
     response = rpc_call(self.host_client.get_resources, request)
     assert_that(response.result, equal_to(GetResourcesResultCode.OK))
     if expect_found:
         assert_that(len(response.resources), is_(1))
         return response.resources[0].disks[0]
     else:
         assert_that(len(response.resources), is_(0))
         return None
コード例 #3
0
 def find_disk(self, disk_id, expect=FindResultCode.OK):
     request = FindRequest(Locator(disk=DiskLocator(disk_id)))
     response = rpc_call(self.host_client.find, request)
     assert_that(response.result, equal_to(expect))
     return response.datastore