Fix test_volume_services testcase
When a cloud is configured with multiple cinder backends,
test_get_service_by_service_and_host_name may fail.
The problem is that self.host_name removes '@*' from the hostname,
In case we have two backend under the same host, we will get
the same hostname for cinder-volumes.
Example:
[stack@localhost ~]$ cinder service-list
+------------------+-----------------------------------------+
| Binary | Host |
+------------------+-----------------------------------------+
| cinder-backup | localhost.localdomain.localdomain |
| cinder-scheduler | localhost.localdomain.localdomain |
| cinder-volume | localhost.localdomain.localdomain@lvm_1 |
| cinder-volume | localhost.localdomain.localdomain@lvm_2 |
+------------------+-----------------------------------------+
Change-Id: I686db94de496bdba03bf731beae42f69907ea3e4
diff --git a/tempest/api/volume/admin/test_volume_services.py b/tempest/api/volume/admin/test_volume_services.py
index 755365d..165874b 100644
--- a/tempest/api/volume/admin/test_volume_services.py
+++ b/tempest/api/volume/admin/test_volume_services.py
@@ -79,7 +79,7 @@
services = (self.admin_volume_services_client.list_services(
host=self.host_name, binary=self.binary_name))['services']
- self.assertEqual(1, len(services))
+ self.assertNotEqual(0, len(services))
self.assertEqual(self.host_name, _get_host(services[0]['host']))
self.assertEqual(self.binary_name, services[0]['binary'])