Do not check created_at attribute in test_service_list test

Tempest could be used not only after initial deployment but for
cloud verification during operations or after update. We don't
need to check that services are created today.

Depends-On: https://review.opendev.org/#/c/751657/
Change-Id: Ifc3cb1933a591ce1fe05fe11d5e07b78a0e61375
This commit is contained in:
Ivan Kolodyazhny 2020-09-15 14:59:19 +00:00 committed by Eyal
parent c410a047fb
commit fa2642a289

View File

@ -12,10 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from datetime import date
import socket
from dateutil import parser
from testtools import matchers
from vitrage_tempest_plugin.tests.base import BaseVitrageTempest
@ -36,21 +34,10 @@ class ServiceTest(BaseVitrageTempest):
def test_service_list(self):
services = self.vitrage_client.service.list()
# NOTE(eyalb) test will run in the same day of
# process creation, might remove this if it causes
# problems
self.check_created(services, date.today())
self.check_all_equal(services, SERVICES)
self.check_all_hosted(services, socket.gethostname())
self.check_different_process_ids_for(services)
def check_created(self, services, today):
created = {parser.parse(service['created']).date()
for service in services}
self.assert_set_equal({today}, created)
def check_all_equal(self, services, expected_svc_names):
names = {service['name'].split(' ')[0] for service in services}
self.assert_set_equal(expected_svc_names, names)