From 0dc8ced2555d09ee1629838d4d913a3fe05ee51b Mon Sep 17 00:00:00 2001 From: Xavier Bustamante Talavera Date: Fri, 10 May 2019 18:00:38 +0200 Subject: [PATCH] Sort events by default using end_time --- .../files/asus-eee-1000h.snapshot.11.yaml | 2 +- .../files/dell-optiplexgx520.snapshot.11.yaml | 10 +- .../dummy/files/hp1.snapshot.11.yaml | 10 +- .../dummy/files/hp2.snapshot.11.yaml | 18 +- .../files/lenovo-3493BAG.snapshot.11.yaml | 10 +- .../dummy/files/nec.snapshot.11.yaml | 10 +- .../files/real-eee-1001pxd.snapshot.11.yaml | 10 +- .../files/real-hp-quad-core.snapshot.11.yaml | 2 +- .../dummy/files/real-hp.snapshot.11.yaml | 2 +- .../dummy/files/real-toshiba.snapshot.11.yaml | 2 +- .../dummy/files/smart.snapshot.11.yaml | 2 +- ereuse_devicehub/resources/device/models.py | 11 +- ereuse_devicehub/resources/event/models.py | 54 ++-- ereuse_devicehub/resources/models.py | 5 +- requirements.txt | 1 + setup.py | 3 +- tests/files/david.lshw.snapshot.yaml | 246 +++++++++--------- tests/files/erase-sectors-2-hdd.snapshot.yaml | 18 +- tests/files/real-custom.snapshot.11.yaml | 2 +- tests/files/workbench-server-3.erase.yaml | 12 +- tests/test_snapshot.py | 41 ++- tests/test_workbench.py | 10 +- .../acer-aspire-5737z.lshw.snapshot.json | 2 +- .../all-series.lshw.snapshot.json | 2 +- .../asus-all-series.lshw.snapshot.json | 2 +- .../workbench_files/box-xavier.snapshot.json | 2 +- .../workbench_files/core2.lshw.snapshot.json | 2 +- .../workbench_files/custom.lshw.snapshot.json | 2 +- .../dell-logicalname-network.snapshot.json | 2 +- .../workbench_files/ecs-2.lshw.snapshot.json | 2 +- .../ecs-computers.lshw.snapshot.json | 2 +- tests/workbench_files/eee-pc.snapshot.json | 2 +- .../erased-i5.lshw.snapshot.json | 2 +- .../hp-compaq-8100.lshw.snapshot.json | 2 +- .../hp-pavilion-dv4000.lshw.snapshot.json | 2 +- .../lenovo-7220w3t.lshw.snapshot.json | 2 +- .../lenovo-as-intel.lshw.snapshot.json | 2 +- ...lenovo-thinkcentre-edge.lshw.snapshot.json | 2 +- tests/workbench_files/lenovo.snapshot.json | 2 +- tests/workbench_files/nec.lshw.snapshot.json | 2 +- tests/workbench_files/nox.lshw.snapshot.json | 2 +- .../optiplex-745.lshw.snapshot.json | 2 +- .../optiplex-gx520.lshw.snapshot.json | 2 +- tests/workbench_files/pc-laudem.snapshot.json | 2 +- .../toshiba.lshw.snapshot.json | 2 +- .../virtualbox-client.snapshot.json | 2 +- .../virtualbox-no-hdd-yes-usb.snapshot.json | 2 +- .../virtualbox-no-hdd.snapshot.json | 2 +- .../vostro-260.lshw.snapshot.json | 2 +- tests/workbench_files/xeon.snapshot.json | 2 +- tests/workbench_files/xiaomi.snapshot.json | 2 +- 51 files changed, 277 insertions(+), 262 deletions(-) diff --git a/ereuse_devicehub/dummy/files/asus-eee-1000h.snapshot.11.yaml b/ereuse_devicehub/dummy/files/asus-eee-1000h.snapshot.11.yaml index de93be61..11df7e5f 100644 --- a/ereuse_devicehub/dummy/files/asus-eee-1000h.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/asus-eee-1000h.snapshot.11.yaml @@ -121,5 +121,5 @@ ], "version": "11.0a4", "elapsed": 6, - "endTime": "2016-11-03T17:17:17.266543" + "endTime": "2016-11-03T17:17:17.266543+00:00" } diff --git a/ereuse_devicehub/dummy/files/dell-optiplexgx520.snapshot.11.yaml b/ereuse_devicehub/dummy/files/dell-optiplexgx520.snapshot.11.yaml index 98ae89a5..432d84fa 100644 --- a/ereuse_devicehub/dummy/files/dell-optiplexgx520.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/dell-optiplexgx520.snapshot.11.yaml @@ -92,15 +92,15 @@ { "severity": "Info", "type": "StepRandom", - "startTime": "2018-07-11T11:20:01.005336", - "endTime": "2018-07-11T11:42:12.971177" + "startTime": "2018-07-11T11:20:01.005336+00:00", + "endTime": "2018-07-11T11:42:12.971177+00:00" } ], "severity": "Info", "type": "EraseBasic", - "endTime": "2018-07-11T11:42:12.975358", - "startTime": "2018-07-11T11:20:01.004892" + "endTime": "2018-07-11T11:42:12.975358+00:00", + "startTime": "2018-07-11T11:20:01.004892+00:00" }, { "writeSpeed": 26.6, @@ -151,7 +151,7 @@ "version": "11.0a3", "closed": false, "elapsed": 1512, - "endTime": "2018-07-11T11:17:00.888231", + "endTime": "2018-07-11T11:17:00.888231+00:00", "type": "Snapshot", "expectedEvents": [ "Benchmark", diff --git a/ereuse_devicehub/dummy/files/hp1.snapshot.11.yaml b/ereuse_devicehub/dummy/files/hp1.snapshot.11.yaml index 70b6fc5c..c66151ea 100644 --- a/ereuse_devicehub/dummy/files/hp1.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/hp1.snapshot.11.yaml @@ -9,7 +9,7 @@ "closed": false, "elapsed": -3058, "uuid": "106930cd-e948-4cca-a8c8-1e39d6192ad6", - "endTime": "2018-07-11T10:47:50.822380", + "endTime": "2018-07-11T10:47:50.822380+00:00", "components": [ { "type": "Processor", @@ -73,15 +73,15 @@ { "type": "EraseBasic", - "endTime": "2018-07-11T11:56:52.390306", + "endTime": "2018-07-11T11:56:52.390306+00:00", "severity": "Info", - "startTime": "2018-07-11T10:49:31.998217", + "startTime": "2018-07-11T10:49:31.998217+00:00", "steps": [ { "type": "StepRandom", - "endTime": "2018-07-11T11:56:52.386505", + "endTime": "2018-07-11T11:56:52.386505+00:00", "severity": "Info", - "startTime": "2018-07-11T10:49:31.998609" + "startTime": "2018-07-11T10:49:31.998609+00:00" } ] }, diff --git a/ereuse_devicehub/dummy/files/hp2.snapshot.11.yaml b/ereuse_devicehub/dummy/files/hp2.snapshot.11.yaml index 0db4e9d4..aeb248f8 100644 --- a/ereuse_devicehub/dummy/files/hp2.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/hp2.snapshot.11.yaml @@ -80,17 +80,17 @@ "readSpeed": 77.7 }, { - "startTime": "2018-07-11T10:32:14.445306", + "startTime": "2018-07-11T10:32:14.445306+00:00", "type": "EraseBasic", "severity": "Info", - "endTime": "2018-07-11T10:53:46.442123", + "endTime": "2018-07-11T10:53:46.442123+00:00", "steps": [ { - "startTime": "2018-07-11T10:32:14.445496", + "startTime": "2018-07-11T10:32:14.445496+00:00", "type": "StepRandom", "severity": "Info", - "endTime": "2018-07-11T10:53:46.438901" + "endTime": "2018-07-11T10:53:46.438901+00:00" } ] } @@ -112,17 +112,17 @@ "length": "Short" }, { - "startTime": "2018-07-11T10:53:46.442187", + "startTime": "2018-07-11T10:53:46.442187+00:00", "type": "EraseBasic", "severity": "Info", - "endTime": "2018-07-11T11:16:28.469899", + "endTime": "2018-07-11T11:16:28.469899+00:00", "steps": [ { - "startTime": "2018-07-11T10:53:46.442343", + "startTime": "2018-07-11T10:53:46.442343+00:00", "type": "StepRandom", "severity": "Info", - "endTime": "2018-07-11T11:16:28.463789" + "endTime": "2018-07-11T11:16:28.463789+00:00" } ] }, @@ -175,6 +175,6 @@ "EraseBasic" ], "software": "Workbench", - "endTime": "2018-07-11T10:30:22.395958", + "endTime": "2018-07-11T10:30:22.395958+00:00", "elapsed": 2766 } diff --git a/ereuse_devicehub/dummy/files/lenovo-3493BAG.snapshot.11.yaml b/ereuse_devicehub/dummy/files/lenovo-3493BAG.snapshot.11.yaml index 1a5e60ce..ad69243b 100644 --- a/ereuse_devicehub/dummy/files/lenovo-3493BAG.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/lenovo-3493BAG.snapshot.11.yaml @@ -2,7 +2,7 @@ "uuid": "9c3560a9-371c-4392-b586-37090b5f79c6", "version": "11.0a3", "closed": false, - "endTime": "2018-07-11T13:26:29.365504", + "endTime": "2018-07-11T13:26:29.365504+00:00", "type": "Snapshot", "device": { "serialNumber": "PB357N0", @@ -99,15 +99,15 @@ "status": "Unspecified Error. Self-test not started." }, { - "startTime": "2018-07-11T13:28:07.319948", + "startTime": "2018-07-11T13:28:07.319948+00:00", "type": "EraseBasic", - "endTime": "2018-07-11T14:04:04.864425", + "endTime": "2018-07-11T14:04:04.864425+00:00", "severity": "Info", "steps": [ { - "startTime": "2018-07-11T13:28:07.320244", + "startTime": "2018-07-11T13:28:07.320244+00:00", "type": "StepRandom", - "endTime": "2018-07-11T14:04:04.861590", + "endTime": "2018-07-11T14:04:04.861590+00:00", "severity": "Info" } ] diff --git a/ereuse_devicehub/dummy/files/nec.snapshot.11.yaml b/ereuse_devicehub/dummy/files/nec.snapshot.11.yaml index 68ba4065..7e5e5096 100644 --- a/ereuse_devicehub/dummy/files/nec.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/nec.snapshot.11.yaml @@ -101,14 +101,14 @@ "events": [ { "severity": "Info", - "endTime": "2018-07-11T11:33:41.531918", - "startTime": "2018-07-11T10:30:35.643855", + "endTime": "2018-07-11T11:33:41.531918+00:00", + "startTime": "2018-07-11T10:30:35.643855+00:00", "type": "EraseBasic", "steps": [ { "type": "StepRandom", - "endTime": "2018-07-11T11:33:41.529224", - "startTime": "2018-07-11T10:30:35.644043", + "endTime": "2018-07-11T11:33:41.529224+00:00", + "startTime": "2018-07-11T10:30:35.644043+00:00", "severity": "Info" } ] @@ -155,7 +155,7 @@ "StressTest", "EraseBasic" ], - "endTime": "2018-07-11T10:28:55.879745", + "endTime": "2018-07-11T10:28:55.879745+00:00", "type": "Snapshot", "elapsed": 3886, "closed": false diff --git a/ereuse_devicehub/dummy/files/real-eee-1001pxd.snapshot.11.yaml b/ereuse_devicehub/dummy/files/real-eee-1001pxd.snapshot.11.yaml index bb30132a..001780e3 100644 --- a/ereuse_devicehub/dummy/files/real-eee-1001pxd.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/real-eee-1001pxd.snapshot.11.yaml @@ -98,15 +98,15 @@ "steps": [ { "type": "StepRandom", - "startTime": "2018-07-03T09:15:22.257059", + "startTime": "2018-07-03T09:15:22.257059+00:00", "severity": "Info", - "endTime": "2018-07-03T10:32:11.843190" + "endTime": "2018-07-03T10:32:11.843190+00:00" } ], - "startTime": "2018-07-03T09:15:22.256074", + "startTime": "2018-07-03T09:15:22.256074+00:00", "severity": "Info", - "endTime": "2018-07-03T10:32:11.848455" + "endTime": "2018-07-03T10:32:11.848455+00:00" } ] }, @@ -133,7 +133,7 @@ "version": "11.0a2", "type": "Snapshot", "software": "Workbench", - "endTime": "2018-07-03T09:10:57.034598", + "endTime": "2018-07-03T09:10:57.034598+00:00", "device": { "type": "Laptop", "model": "1001PXD", diff --git a/ereuse_devicehub/dummy/files/real-hp-quad-core.snapshot.11.yaml b/ereuse_devicehub/dummy/files/real-hp-quad-core.snapshot.11.yaml index 2f69aa89..b8506632 100644 --- a/ereuse_devicehub/dummy/files/real-hp-quad-core.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/real-hp-quad-core.snapshot.11.yaml @@ -4,7 +4,7 @@ "uuid": "0c822fb7-6e51-4781-86cf-994bd306212e", "software": "Workbench", "closed": false, - "endTime": "2018-07-05T11:57:17.284891", + "endTime": "2018-07-05T11:57:17.284891+00:00", "components": [ { "type": "NetworkAdapter", diff --git a/ereuse_devicehub/dummy/files/real-hp.snapshot.11.yaml b/ereuse_devicehub/dummy/files/real-hp.snapshot.11.yaml index cd8d15a3..659a1644 100644 --- a/ereuse_devicehub/dummy/files/real-hp.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/real-hp.snapshot.11.yaml @@ -167,5 +167,5 @@ "model": "HP Compaq 8100 Elite SFF" }, "type": "Snapshot", - "endTime": "2018-06-29T12:28:54.508266" + "endTime": "2018-06-29T12:28:54.508266+00:00" } diff --git a/ereuse_devicehub/dummy/files/real-toshiba.snapshot.11.yaml b/ereuse_devicehub/dummy/files/real-toshiba.snapshot.11.yaml index add7bc12..d554a951 100644 --- a/ereuse_devicehub/dummy/files/real-toshiba.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/real-toshiba.snapshot.11.yaml @@ -4,7 +4,7 @@ "Benchmark", "StressTest" ], - "endTime": "2018-06-29T15:29:29.322424", + "endTime": "2018-06-29T15:29:29.322424+00:00", "elapsed": 391, "software": "Workbench", "components": [ diff --git a/ereuse_devicehub/dummy/files/smart.snapshot.11.yaml b/ereuse_devicehub/dummy/files/smart.snapshot.11.yaml index 3d73dec3..7ae7acd0 100644 --- a/ereuse_devicehub/dummy/files/smart.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/smart.snapshot.11.yaml @@ -158,7 +158,7 @@ "serialNumber": "CZC0408YJG" } ], - "endTime": "2018-07-11T16:11:43.467824", + "endTime": "2018-07-11T16:11:43.467824+00:00", "version": "11.0a3", "software": "Workbench", "type": "Snapshot", diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 29c0a39c..cb76e700 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -44,8 +44,6 @@ class Device(Thing): Devices can contain ``Components``, which are just a type of device (it is a recursive relationship). """ - EVENT_SORT_KEY = attrgetter('created') - id = Column(BigInteger, Sequence('device_seq'), primary_key=True) id.comment = """ The identifier of the device for this database. Used only @@ -150,7 +148,7 @@ class Device(Thing): Events are returned by descending ``created`` time. """ - return sorted(chain(self.events_multiple, self.events_one), key=self.EVENT_SORT_KEY) + return sorted(chain(self.events_multiple, self.events_one)) @property def problems(self): @@ -285,8 +283,7 @@ class Device(Thing): raise LookupError('{!r} does not contain events of types {}.'.format(self, types)) def _warning_events(self, events): - return sorted((ev for ev in events if ev.severity >= Severity.Warning), - key=self.EVENT_SORT_KEY) + return sorted(ev for ev in events if ev.severity >= Severity.Warning) def __lt__(self, other): return self.id < other.id @@ -393,7 +390,7 @@ class Computer(Device): @property def events(self) -> list: - return sorted(chain(super().events, self.events_parent), key=self.EVENT_SORT_KEY) + return sorted(chain(super().events, self.events_parent)) @property def ram_size(self) -> int: @@ -565,7 +562,7 @@ class Component(Device): @property def events(self) -> list: - return sorted(chain(super().events, self.events_components), key=self.EVENT_SORT_KEY) + return sorted(chain(super().events, self.events_components)) class JoinedComponentTableMixin: diff --git a/ereuse_devicehub/resources/event/models.py b/ereuse_devicehub/resources/event/models.py index fae4303a..80cdd386 100644 --- a/ereuse_devicehub/resources/event/models.py +++ b/ereuse_devicehub/resources/event/models.py @@ -12,7 +12,7 @@ Within the above general classes are subclasses in A order. from collections import Iterable from contextlib import suppress -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone from decimal import Decimal, ROUND_HALF_EVEN, ROUND_UP from typing import Optional, Set, Union from uuid import uuid4 @@ -22,6 +22,7 @@ import teal.db from boltons import urlutils from citext import CIText from flask import current_app as app, g +from sortedcontainers import SortedSet from sqlalchemy import BigInteger, Boolean, CheckConstraint, Column, Enum as DBEnum, \ Float, ForeignKey, Integer, Interval, JSON, Numeric, SmallInteger, Unicode, event, orm from sqlalchemy.dialects.postgresql import UUID @@ -55,6 +56,13 @@ class JoinedTableMixin: return Column(UUID(as_uuid=True), ForeignKey(Event.id), primary_key=True) +_sorted_events = { + 'order_by': lambda: Event.end_time, + 'collection_class': SortedSet +} +"""For db.backref, return the events sorted by end_time.""" + + class Event(Thing): """Event performed on a device. @@ -100,8 +108,7 @@ class Event(Thing): backref=backref('events', lazy=True, cascade=CASCADE_OWN, - order_by=lambda: Event.created, - collection_class=OrderedSet), + **_sorted_events), primaryjoin='Event.snapshot_id == Snapshot.id') author_id = Column(UUID(as_uuid=True), @@ -126,10 +133,7 @@ class Event(Thing): default=lambda: g.user.individual.id) # todo compute the org agent = relationship(Agent, - backref=backref('events_agent', - lazy=True, - collection_class=OrderedSet, - order_by=lambda: Event.created), + backref=backref('events_agent', lazy=True, **_sorted_events), primaryjoin=agent_id == Agent.id) agent_id.comment = """ The direct performer or driver of the action. e.g. John wrote a book. @@ -139,10 +143,7 @@ class Event(Thing): """ components = relationship(Component, - backref=backref('events_components', - lazy=True, - order_by=lambda: Event.created, - collection_class=OrderedSet), + backref=backref('events_components', lazy=True, **_sorted_events), secondary=lambda: EventComponent.__table__, order_by=lambda: Component.id, collection_class=OrderedSet) @@ -161,10 +162,7 @@ class Event(Thing): """ parent_id = Column(BigInteger, ForeignKey(Computer.id)) parent = relationship(Computer, - backref=backref('events_parent', - lazy=True, - order_by=lambda: Event.created, - collection_class=OrderedSet), + backref=backref('events_parent', lazy=True, **_sorted_events), primaryjoin=parent_id == Computer.id) parent_id.comment = """ For events that are performed to components, the device parent @@ -227,7 +225,18 @@ class Event(Thing): @property def date_str(self): - return '{:%c}'.format(self.end_time or self.created) + return '{:%c}'.format(self.end_time) + + def __init__(self, **kwargs) -> None: + # sortedset forces us to do this before calling our parent init + self.end_time = kwargs.get('end_time', None) + if not self.end_time: + # Set default for end_time, make it the same of created + kwargs['created'] = self.end_time = datetime.now(timezone.utc) + super().__init__(**kwargs) + + def __lt__(self, other): + return self.end_time < other.end_time def __str__(self) -> str: return '{}'.format(self.severity) @@ -254,8 +263,7 @@ class EventWithOneDevice(JoinedTableMixin, Event): backref=backref('events_one', lazy=True, cascade=CASCADE_OWN, - order_by=lambda: EventWithOneDevice.created, - collection_class=OrderedSet), + **_sorted_events), primaryjoin=Device.id == device_id) __table_args__ = ( @@ -282,10 +290,7 @@ class EventWithOneDevice(JoinedTableMixin, Event): class EventWithMultipleDevices(Event): devices = relationship(Device, - backref=backref('events_multiple', - lazy=True, - order_by=lambda: EventWithMultipleDevices.created, - collection_class=OrderedSet), + backref=backref('events_multiple', lazy=True, **_sorted_events), secondary=lambda: EventDevice.__table__, order_by=lambda: Device.id, collection_class=OrderedSet) @@ -1292,10 +1297,7 @@ class Trade(JoinedTableMixin, EventWithMultipleDevices): to_id = Column(UUID(as_uuid=True), ForeignKey(Agent.id), nullable=False) # todo compute the org to = relationship(Agent, - backref=backref('events_to', - lazy=True, - collection_class=OrderedSet, - order_by=lambda: Event.created), + backref=backref('events_to', lazy=True, **_sorted_events), primaryjoin=to_id == Agent.id) to_comment = """ The agent that gets the device due this deal. diff --git a/ereuse_devicehub/resources/models.py b/ereuse_devicehub/resources/models.py index 98f03cbc..0c0a26b4 100644 --- a/ereuse_devicehub/resources/models.py +++ b/ereuse_devicehub/resources/models.py @@ -32,6 +32,7 @@ class Thing(db.Model): """ def __init__(self, **kwargs) -> None: + # We need to set 'created' before sqlalchemy inits the class + # to be able to use sorted containers + self.created = kwargs.get('created', datetime.now(timezone.utc)) super().__init__(**kwargs) - if not self.created: - self.created = datetime.now(timezone.utc) diff --git a/requirements.txt b/requirements.txt index 64db0101..d9d4e4b5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,3 +31,4 @@ sqlalchemy-citext==1.3.post0 flask-weasyprint==0.5 weasyprint==44 psycopg2-binary==2.7.5 +sortedcontainers==2.1.0 diff --git a/setup.py b/setup.py index 7990e0c2..d49a9486 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,8 @@ setup( 'requests-toolbelt', 'sqlalchemy-citext', 'sqlalchemy-utils[password, color, phone]', - 'Flask-WeasyPrint' + 'Flask-WeasyPrint', + 'sortedcontainers' ], extras_require={ 'docs': [ diff --git a/tests/files/david.lshw.snapshot.yaml b/tests/files/david.lshw.snapshot.yaml index 50b8a0c0..0050edc2 100644 --- a/tests/files/david.lshw.snapshot.yaml +++ b/tests/files/david.lshw.snapshot.yaml @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": true, - "endTime": "2018-07-19T15:48:40.635776", + "endTime": "2018-07-19T15:48:40.635776+00:00", "device": { "manufacturer": "Dell Inc.", "model": "Latitude E6440", @@ -15,132 +15,132 @@ "chassis": "Laptop" }, "components": [ + { + "manufacturer": "Intel Corp.", + "model": "Intel Core i7-4600M CPU @ 2.90GHz", + "serialNumber": null, + "events": [ { - "manufacturer": "Intel Corp.", - "model": "Intel Core i7-4600M CPU @ 2.90GHz", - "serialNumber": null, - "events": [ - { - "elapsed": 165, - "rate": 164.8342, - "type": "BenchmarkProcessorSysbench" - }, - { - "elapsed": 0, - "rate": 6665.7, - "type": "BenchmarkProcessor" - } - ], - "type": "Processor", - "speed": 1.259899, - "address": 64, - "cores": 2, - "threads": 4 + "elapsed": 165, + "rate": 164.8342, + "type": "BenchmarkProcessorSysbench" }, { - "manufacturer": "Samsung", - "model": "M471B5173DB0-YK0", - "serialNumber": "732CD498", - "events": [], - "type": "RamModule", - "format": "SODIMM", - "size": 4096, - "interface": "DDR3", - "speed": 1600.0 - }, - { - "manufacturer": "Samsung", - "model": "M471B5173DB0-YK0", - "serialNumber": "152DD498", - "events": [], - "type": "RamModule", - "format": "SODIMM", - "size": 4096, - "interface": "DDR3", - "speed": 1600.0 - }, - { - "manufacturer": null, - "model": "Crucial_CT525MX3", - "serialNumber": "164014297BCC", - "events": [ - { - "readSpeed": 63.3, - "type": "BenchmarkDataStorage", - "elapsed": 18, - "writeSpeed": 20.1 - } - ], - "type": "HardDrive", - "size": 500786, - "interface": null - }, - { - "manufacturer": "Intel Corporation", - "model": "4th Gen Core Processor Integrated Graphics Controller", - "serialNumber": null, - "events": [], - "type": "GraphicCard", - "memory": null - }, - { - "manufacturer": "Intel Corporation", - "model": "Ethernet Connection I217-LM", - "serialNumber": "ec:f4:bb:0b:18:90", - "events": [], - "type": "NetworkAdapter", - "speed": 1000, - "wireless": false - }, - { - "manufacturer": "Intel Corporation", - "model": "Centrino Advanced-N 6235", - "serialNumber": "c4:d9:87:47:90:e1", - "events": [], - "type": "NetworkAdapter", - "wireless": true - }, - { - "manufacturer": null, - "model": null, - "serialNumber": "da:b4:3a:25:88:6c", - "events": [], - "type": "NetworkAdapter", - "wireless": false - }, - { - "manufacturer": "Intel Corporation", - "model": "Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller", - "serialNumber": null, - "events": [], - "type": "SoundCard" - }, - { - "manufacturer": "CNFCH52J48303+YF2", - "model": "Laptop_Integrated_Webcam_HD", - "serialNumber": null, - "events": [], - "type": "SoundCard" - }, - { - "manufacturer": "Intel Corporation", - "model": "8 Series/C220 Series Chipset High Definition Audio Controller", - "serialNumber": null, - "events": [], - "type": "SoundCard" - }, - { - "manufacturer": "Dell Inc.", - "model": "0159N7", - "serialNumber": "/FJBQVZ1/CN1296342I009B/", - "events": [], - "type": "Motherboard", - "usb": 3, - "firewire": 0, - "serial": 1, - "pcmcia": 0, - "slots": 1 + "elapsed": 0, + "rate": 6665.7, + "type": "BenchmarkProcessor" } + ], + "type": "Processor", + "speed": 1.259899, + "address": 64, + "cores": 2, + "threads": 4 + }, + { + "manufacturer": "Samsung", + "model": "M471B5173DB0-YK0", + "serialNumber": "732CD498", + "events": [], + "type": "RamModule", + "format": "SODIMM", + "size": 4096, + "interface": "DDR3", + "speed": 1600.0 + }, + { + "manufacturer": "Samsung", + "model": "M471B5173DB0-YK0", + "serialNumber": "152DD498", + "events": [], + "type": "RamModule", + "format": "SODIMM", + "size": 4096, + "interface": "DDR3", + "speed": 1600.0 + }, + { + "manufacturer": null, + "model": "Crucial_CT525MX3", + "serialNumber": "164014297BCC", + "events": [ + { + "readSpeed": 63.3, + "type": "BenchmarkDataStorage", + "elapsed": 18, + "writeSpeed": 20.1 + } + ], + "type": "HardDrive", + "size": 500786, + "interface": null + }, + { + "manufacturer": "Intel Corporation", + "model": "4th Gen Core Processor Integrated Graphics Controller", + "serialNumber": null, + "events": [], + "type": "GraphicCard", + "memory": null + }, + { + "manufacturer": "Intel Corporation", + "model": "Ethernet Connection I217-LM", + "serialNumber": "ec:f4:bb:0b:18:90", + "events": [], + "type": "NetworkAdapter", + "speed": 1000, + "wireless": false + }, + { + "manufacturer": "Intel Corporation", + "model": "Centrino Advanced-N 6235", + "serialNumber": "c4:d9:87:47:90:e1", + "events": [], + "type": "NetworkAdapter", + "wireless": true + }, + { + "manufacturer": null, + "model": null, + "serialNumber": "da:b4:3a:25:88:6c", + "events": [], + "type": "NetworkAdapter", + "wireless": false + }, + { + "manufacturer": "Intel Corporation", + "model": "Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller", + "serialNumber": null, + "events": [], + "type": "SoundCard" + }, + { + "manufacturer": "CNFCH52J48303+YF2", + "model": "Laptop_Integrated_Webcam_HD", + "serialNumber": null, + "events": [], + "type": "SoundCard" + }, + { + "manufacturer": "Intel Corporation", + "model": "8 Series/C220 Series Chipset High Definition Audio Controller", + "serialNumber": null, + "events": [], + "type": "SoundCard" + }, + { + "manufacturer": "Dell Inc.", + "model": "0159N7", + "serialNumber": "/FJBQVZ1/CN1296342I009B/", + "events": [], + "type": "Motherboard", + "usb": 3, + "firewire": 0, + "serial": 1, + "pcmcia": 0, + "slots": 1 + } ], "elapsed": 0 } diff --git a/tests/files/erase-sectors-2-hdd.snapshot.yaml b/tests/files/erase-sectors-2-hdd.snapshot.yaml index 4bd93979..af3bfd86 100644 --- a/tests/files/erase-sectors-2-hdd.snapshot.yaml +++ b/tests/files/erase-sectors-2-hdd.snapshot.yaml @@ -70,19 +70,19 @@ "type": "HardDrive", "events": [ { - "endTime": "2018-07-13T11:54:55.100581", + "endTime": "2018-07-13T11:54:55.100581+00:00", "steps": [ { - "endTime": "2018-07-13T11:54:55.096491", + "endTime": "2018-07-13T11:54:55.096491+00:00", "type": "StepRandom", "severity": "Info", - "startTime": "2018-07-13T10:52:45.092981" + "startTime": "2018-07-13T10:52:45.092981+00:00" } ], "type": "EraseBasic", "severity": "Info", - "startTime": "2018-07-13T10:52:45.092612" + "startTime": "2018-07-13T10:52:45.092612+00:00" }, { "lifetime": 24658, @@ -114,18 +114,18 @@ "type": "HardDrive", "events": [ { - "endTime": "2018-07-13T12:55:47.331586", + "endTime": "2018-07-13T12:55:47.331586+00:00", "steps": [ { - "endTime": "2018-07-13T12:55:47.326835", + "endTime": "2018-07-13T12:55:47.326835+00:00", "type": "StepRandom", "severity": "Info", - "startTime": "2018-07-13T11:54:55.100925" + "startTime": "2018-07-13T11:54:55.100925+00:00" } ], "type": "EraseBasic", "severity": "Info", - "startTime": "2018-07-13T11:54:55.100667" + "startTime": "2018-07-13T11:54:55.100667+00:00" }, { "lifetime": 21979, @@ -170,5 +170,5 @@ "serialNumber": "109192430003459" } ], - "endTime": "2018-07-13T10:48:36.738398" + "endTime": "2018-07-13T10:48:36.738398+00:00" } diff --git a/tests/files/real-custom.snapshot.11.yaml b/tests/files/real-custom.snapshot.11.yaml index 3d2b4946..0c207914 100644 --- a/tests/files/real-custom.snapshot.11.yaml +++ b/tests/files/real-custom.snapshot.11.yaml @@ -123,6 +123,6 @@ }, "type": "Snapshot", "software": "Workbench", - "endTime": "2018-07-19T15:48:40.635776", + "endTime": "2018-07-19T15:48:40.635776+00:00", "closed": false } diff --git a/tests/files/workbench-server-3.erase.yaml b/tests/files/workbench-server-3.erase.yaml index 94197840..6bb96e19 100644 --- a/tests/files/workbench-server-3.erase.yaml +++ b/tests/files/workbench-server-3.erase.yaml @@ -10,10 +10,10 @@ type: 'EraseSectors' severity: Info # snapshot: None fulfill! # device: None fulfill! -startTime: 2018-01-01T10:10:10 -endTime: 2018-01-01T12:10:10 +startTime: '2018-01-01T10:10:10+00:00' +endTime: '2018-01-01T12:10:10+00:00' steps: -- type: 'StepRandom' - startTime: '2018-01-01T10:10:10' - endTime: '2018-01-01T12:10:10' - severity: Info + - type: 'StepRandom' + startTime: '2018-01-01T10:10:10+00:00' + endTime: '2018-01-01T12:10:10+00:00' + severity: Info diff --git a/tests/test_snapshot.py b/tests/test_snapshot.py index e984af63..96ba7115 100644 --- a/tests/test_snapshot.py +++ b/tests/test_snapshot.py @@ -157,7 +157,8 @@ def test_snapshot_component_add_remove(user: UserClient): # p1c2s has two Snapshots, a Remove and an Add p1c2s, _ = user.get(res=m.Device, item=pc2['components'][0]['id']) assert tuple(e['type'] for e in p1c2s['events']) == ( - 'BenchmarkProcessor', 'Snapshot', 'Snapshot', 'Remove') + 'BenchmarkProcessor', 'Snapshot', 'Snapshot', 'Remove' + ) # We register the first device again, but removing motherboard # and moving processor from the second device to the first. @@ -304,31 +305,43 @@ def test_snapshot_component_containing_components(user: UserClient): user.post(s, res=Snapshot, status=ValidationError) -def test_erase_privacy_standards(user: UserClient): - """Tests a Snapshot with EraseSectors and the resulting - privacy properties. +def test_erase_privacy_standards_endtime_sort(user: UserClient): + """Tests a Snapshot with EraseSectors and the resulting privacy + properties. + + This tests ensures that only the last erasure is picked up, as + erasures have always custom endTime value set. """ s = file('erase-sectors.snapshot') - assert '2018-06-01T09:12:06+02:00' == s['components'][0]['events'][0]['endTime'] + assert s['components'][0]['events'][0]['endTime'] == '2018-06-01T09:12:06+02:00' snapshot = snapshot_and_check(user, s, event_types=( EraseSectors.t, BenchmarkDataStorage.t, BenchmarkProcessor.t - )) + ), perform_second_snapshot=False) + # Perform a new snapshot changing the erasure time, as if + # it is a new erasure performed after. erase = next(e for e in snapshot['events'] if e['type'] == EraseSectors.t) - assert '2018-06-01T07:12:06+00:00' == erase['endTime'] + assert erase['endTime'] == '2018-06-01T07:12:06+00:00' + s['uuid'] = uuid4() + s['components'][0]['events'][0]['endTime'] = '2018-06-01T07:14:00+00:00' + snapshot = snapshot_and_check(user, s, event_types=( + EraseSectors.t, + BenchmarkDataStorage.t, + BenchmarkProcessor.t + ), perform_second_snapshot=False) + + # The actual test storage = next(e for e in snapshot['components'] if e['type'] == SolidStateDrive.t) storage, _ = user.get(res=m.Device, item=storage['id']) # Let's get storage events too - # order: creation time ascending - erasure1, benchmark_data_storage1, _snapshot1, erasure2, benchmark_data_storage2, _snapshot2 = \ - storage['events'] + # order: endTime ascending + # erasure1/2 have an user defined time and others events endTime = created + erasure1, erasure2, benchmark_hdd1, _snapshot1, benchmark_hdd2, _snapshot2 = storage['events'] assert erasure1['type'] == erasure2['type'] == 'EraseSectors' - assert benchmark_data_storage1['type'] == benchmark_data_storage2[ - 'type'] == 'BenchmarkDataStorage' + assert benchmark_hdd1['type'] == benchmark_hdd2['type'] == 'BenchmarkDataStorage' assert _snapshot1['type'] == _snapshot2['type'] == 'Snapshot' get_snapshot, _ = user.get(res=Event, item=_snapshot2['id']) - assert get_snapshot['events'][0]['endTime'] == '2018-06-01T07:12:06+00:00' - # TODO events order are different between snapshots + assert get_snapshot['events'][0]['endTime'] == '2018-06-01T07:14:00+00:00' assert snapshot == get_snapshot erasure, _ = user.get(res=Event, item=erasure1['id']) assert len(erasure['steps']) == 2 diff --git a/tests/test_workbench.py b/tests/test_workbench.py index 6631a135..95fac4b6 100644 --- a/tests/test_workbench.py +++ b/tests/test_workbench.py @@ -36,7 +36,6 @@ def test_workbench_server_condensed(user: UserClient): snapshot, _ = user.post(res=em.Snapshot, data=s) events = snapshot['events'] assert {(event['type'], event['device']) for event in events} == { - ('RateComputer', 1), ('BenchmarkProcessorSysbench', 5), ('StressTest', 1), ('EraseSectors', 6), @@ -47,7 +46,8 @@ def test_workbench_server_condensed(user: UserClient): ('BenchmarkDataStorage', 6), ('BenchmarkDataStorage', 7), ('TestDataStorage', 6), - ('VisualTest', 1) + ('VisualTest', 1), + ('RateComputer', 1) } assert snapshot['closed'] assert snapshot['severity'] == 'Info' @@ -63,9 +63,9 @@ def test_workbench_server_condensed(user: UserClient): assert device['rate']['severity'] == 'Info' assert device['rate']['rating'] == 0 assert device['rate']['type'] == 'RateComputer' - assert device['events'][0]['appearanceRange'] == 'A' - assert device['events'][0]['functionalityRange'] == 'B' - + assert device['events'][2]['type'] == 'VisualTest' + assert device['events'][2]['appearanceRange'] == 'A' + assert device['events'][2]['functionalityRange'] == 'B' assert device['tags'][0]['id'] == 'tag1' diff --git a/tests/workbench_files/acer-aspire-5737z.lshw.snapshot.json b/tests/workbench_files/acer-aspire-5737z.lshw.snapshot.json index e3e39a7c..7ffad3b2 100644 --- a/tests/workbench_files/acer-aspire-5737z.lshw.snapshot.json +++ b/tests/workbench_files/acer-aspire-5737z.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Acer", "model": "Aspire 5737Z", diff --git a/tests/workbench_files/all-series.lshw.snapshot.json b/tests/workbench_files/all-series.lshw.snapshot.json index 7f8d0f5a..97ca2a93 100644 --- a/tests/workbench_files/all-series.lshw.snapshot.json +++ b/tests/workbench_files/all-series.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "ASUS", "model": "All Series", diff --git a/tests/workbench_files/asus-all-series.lshw.snapshot.json b/tests/workbench_files/asus-all-series.lshw.snapshot.json index 4995e580..12c2724b 100644 --- a/tests/workbench_files/asus-all-series.lshw.snapshot.json +++ b/tests/workbench_files/asus-all-series.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "ASUS", "model": "All Series", diff --git a/tests/workbench_files/box-xavier.snapshot.json b/tests/workbench_files/box-xavier.snapshot.json index 0c031c15..24af1ae4 100644 --- a/tests/workbench_files/box-xavier.snapshot.json +++ b/tests/workbench_files/box-xavier.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": null, "model": null, diff --git a/tests/workbench_files/core2.lshw.snapshot.json b/tests/workbench_files/core2.lshw.snapshot.json index b8083a4b..76a118a7 100644 --- a/tests/workbench_files/core2.lshw.snapshot.json +++ b/tests/workbench_files/core2.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": null, "model": null, diff --git a/tests/workbench_files/custom.lshw.snapshot.json b/tests/workbench_files/custom.lshw.snapshot.json index aac215d9..4531cd67 100644 --- a/tests/workbench_files/custom.lshw.snapshot.json +++ b/tests/workbench_files/custom.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "ASUS", "model": "All Series", diff --git a/tests/workbench_files/dell-logicalname-network.snapshot.json b/tests/workbench_files/dell-logicalname-network.snapshot.json index 72a9c413..3902da41 100644 --- a/tests/workbench_files/dell-logicalname-network.snapshot.json +++ b/tests/workbench_files/dell-logicalname-network.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Dell Inc.", "model": "Latitude E5530 non-vPro", diff --git a/tests/workbench_files/ecs-2.lshw.snapshot.json b/tests/workbench_files/ecs-2.lshw.snapshot.json index b4f8a85f..c37751d7 100644 --- a/tests/workbench_files/ecs-2.lshw.snapshot.json +++ b/tests/workbench_files/ecs-2.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": null, "model": null, diff --git a/tests/workbench_files/ecs-computers.lshw.snapshot.json b/tests/workbench_files/ecs-computers.lshw.snapshot.json index 873efa26..049ccfbe 100644 --- a/tests/workbench_files/ecs-computers.lshw.snapshot.json +++ b/tests/workbench_files/ecs-computers.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "ASUS", "model": "All Series", diff --git a/tests/workbench_files/eee-pc.snapshot.json b/tests/workbench_files/eee-pc.snapshot.json index e7ee7da3..6b453a64 100644 --- a/tests/workbench_files/eee-pc.snapshot.json +++ b/tests/workbench_files/eee-pc.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "ASUSTeK Computer INC.", "model": "1000H", diff --git a/tests/workbench_files/erased-i5.lshw.snapshot.json b/tests/workbench_files/erased-i5.lshw.snapshot.json index 1d1d0e8d..ce218065 100644 --- a/tests/workbench_files/erased-i5.lshw.snapshot.json +++ b/tests/workbench_files/erased-i5.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Hewlett-Packard", "model": "HP Compaq dc7900 Small Form Factor", diff --git a/tests/workbench_files/hp-compaq-8100.lshw.snapshot.json b/tests/workbench_files/hp-compaq-8100.lshw.snapshot.json index e478cb8b..b393d0d2 100644 --- a/tests/workbench_files/hp-compaq-8100.lshw.snapshot.json +++ b/tests/workbench_files/hp-compaq-8100.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Hewlett-Packard", "model": "HP Compaq 8100 Elite SFF", diff --git a/tests/workbench_files/hp-pavilion-dv4000.lshw.snapshot.json b/tests/workbench_files/hp-pavilion-dv4000.lshw.snapshot.json index 7d61e13b..a8dce3ac 100644 --- a/tests/workbench_files/hp-pavilion-dv4000.lshw.snapshot.json +++ b/tests/workbench_files/hp-pavilion-dv4000.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Hewlett-Packard", "model": "Pavilion dv4000", diff --git a/tests/workbench_files/lenovo-7220w3t.lshw.snapshot.json b/tests/workbench_files/lenovo-7220w3t.lshw.snapshot.json index 26e1b83d..8ac1b237 100644 --- a/tests/workbench_files/lenovo-7220w3t.lshw.snapshot.json +++ b/tests/workbench_files/lenovo-7220w3t.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "LENOVO", "model": "7220W3T", diff --git a/tests/workbench_files/lenovo-as-intel.lshw.snapshot.json b/tests/workbench_files/lenovo-as-intel.lshw.snapshot.json index b09a0a2c..6492678e 100644 --- a/tests/workbench_files/lenovo-as-intel.lshw.snapshot.json +++ b/tests/workbench_files/lenovo-as-intel.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "LENOVO", "model": "7220W3T", diff --git a/tests/workbench_files/lenovo-thinkcentre-edge.lshw.snapshot.json b/tests/workbench_files/lenovo-thinkcentre-edge.lshw.snapshot.json index 1d79a2a6..83c95eb4 100644 --- a/tests/workbench_files/lenovo-thinkcentre-edge.lshw.snapshot.json +++ b/tests/workbench_files/lenovo-thinkcentre-edge.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "LENOVO", "model": "3493BAG", diff --git a/tests/workbench_files/lenovo.snapshot.json b/tests/workbench_files/lenovo.snapshot.json index 3ef04d0b..06011a0e 100644 --- a/tests/workbench_files/lenovo.snapshot.json +++ b/tests/workbench_files/lenovo.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "LENOVO", "model": "7220W3T", diff --git a/tests/workbench_files/nec.lshw.snapshot.json b/tests/workbench_files/nec.lshw.snapshot.json index 8731631d..805635fb 100644 --- a/tests/workbench_files/nec.lshw.snapshot.json +++ b/tests/workbench_files/nec.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "NEC Computers SAS", "model": "Powermate MLxxx", diff --git a/tests/workbench_files/nox.lshw.snapshot.json b/tests/workbench_files/nox.lshw.snapshot.json index 7fde22e5..a64223a1 100644 --- a/tests/workbench_files/nox.lshw.snapshot.json +++ b/tests/workbench_files/nox.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": null, "model": null, diff --git a/tests/workbench_files/optiplex-745.lshw.snapshot.json b/tests/workbench_files/optiplex-745.lshw.snapshot.json index c315dcf1..bbb46271 100644 --- a/tests/workbench_files/optiplex-745.lshw.snapshot.json +++ b/tests/workbench_files/optiplex-745.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Dell Inc.", "model": "OptiPlex 745", diff --git a/tests/workbench_files/optiplex-gx520.lshw.snapshot.json b/tests/workbench_files/optiplex-gx520.lshw.snapshot.json index 2329cb47..3c61feb9 100644 --- a/tests/workbench_files/optiplex-gx520.lshw.snapshot.json +++ b/tests/workbench_files/optiplex-gx520.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Dell Inc.", "model": "OptiPlex GX520", diff --git a/tests/workbench_files/pc-laudem.snapshot.json b/tests/workbench_files/pc-laudem.snapshot.json index 1d1d0e8d..ce218065 100644 --- a/tests/workbench_files/pc-laudem.snapshot.json +++ b/tests/workbench_files/pc-laudem.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Hewlett-Packard", "model": "HP Compaq dc7900 Small Form Factor", diff --git a/tests/workbench_files/toshiba.lshw.snapshot.json b/tests/workbench_files/toshiba.lshw.snapshot.json index fcce4671..0f3a2aa6 100644 --- a/tests/workbench_files/toshiba.lshw.snapshot.json +++ b/tests/workbench_files/toshiba.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "TOSHIBA", "model": "PORTEGE R700", diff --git a/tests/workbench_files/virtualbox-client.snapshot.json b/tests/workbench_files/virtualbox-client.snapshot.json index 1c3762a7..1395a85d 100644 --- a/tests/workbench_files/virtualbox-client.snapshot.json +++ b/tests/workbench_files/virtualbox-client.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "innotek GmbH", "model": "VirtualBox", diff --git a/tests/workbench_files/virtualbox-no-hdd-yes-usb.snapshot.json b/tests/workbench_files/virtualbox-no-hdd-yes-usb.snapshot.json index 1db1a1bd..2883567f 100644 --- a/tests/workbench_files/virtualbox-no-hdd-yes-usb.snapshot.json +++ b/tests/workbench_files/virtualbox-no-hdd-yes-usb.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "innotek GmbH", "model": "VirtualBox", diff --git a/tests/workbench_files/virtualbox-no-hdd.snapshot.json b/tests/workbench_files/virtualbox-no-hdd.snapshot.json index 1db1a1bd..2883567f 100644 --- a/tests/workbench_files/virtualbox-no-hdd.snapshot.json +++ b/tests/workbench_files/virtualbox-no-hdd.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "innotek GmbH", "model": "VirtualBox", diff --git a/tests/workbench_files/vostro-260.lshw.snapshot.json b/tests/workbench_files/vostro-260.lshw.snapshot.json index 6190b6e7..970fe833 100644 --- a/tests/workbench_files/vostro-260.lshw.snapshot.json +++ b/tests/workbench_files/vostro-260.lshw.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Dell Inc.", "model": "Vostro 260", diff --git a/tests/workbench_files/xeon.snapshot.json b/tests/workbench_files/xeon.snapshot.json index a8f8ca05..6685591d 100644 --- a/tests/workbench_files/xeon.snapshot.json +++ b/tests/workbench_files/xeon.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "LENOVO", "model": "415522G", diff --git a/tests/workbench_files/xiaomi.snapshot.json b/tests/workbench_files/xiaomi.snapshot.json index 4f59f693..41d1d5f8 100644 --- a/tests/workbench_files/xiaomi.snapshot.json +++ b/tests/workbench_files/xiaomi.snapshot.json @@ -5,7 +5,7 @@ "version": "11.0a1", "expectedEvents": [], "closed": false, - "endTime": "2000-01-01 00:00:00", + "endTime": "2000-01-01 00:00:00+00:00", "device": { "manufacturer": "Timi", "model": "TM1613",