From 4debac4fbe6d0fe5a43f874bb15b636cb0f0d051 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 12 Dec 2022 10:36:33 +0100 Subject: [PATCH] fix dummy --- ereuse_devicehub/dummy/dummy.py | 3 +++ ereuse_devicehub/dummy/files/asus-1001pxd.snapshot.11.yaml | 1 + .../dummy/files/asus-eee-1000h.snapshot.11.yaml | 1 + .../dummy/files/dell-optiplexgx520.snapshot.11.yaml | 1 + ereuse_devicehub/dummy/files/hp1.snapshot.11.yaml | 1 + ereuse_devicehub/dummy/files/hp2.snapshot.11.yaml | 1 + .../dummy/files/laptop-with-2-hid.snapshot.11.yaml | 1 + .../dummy/files/lenovo-3493BAG.snapshot.11.yaml | 1 + ereuse_devicehub/dummy/files/nec.snapshot.11.yaml | 1 + ereuse_devicehub/dummy/files/oreo.snapshot.yaml | 6 +++--- ereuse_devicehub/dummy/files/pc-laudem.snapshot.11.yaml | 2 +- .../dummy/files/real-eee-1001pxd.snapshot.11.yaml | 1 + .../dummy/files/real-hp-quad-core.snapshot.11.yaml | 1 + ereuse_devicehub/dummy/files/real-hp.snapshot.11.yaml | 1 + ereuse_devicehub/dummy/files/real-toshiba.snapshot.11.yaml | 1 + 15 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/dummy/dummy.py b/ereuse_devicehub/dummy/dummy.py index ee7f7c15..ec276de4 100644 --- a/ereuse_devicehub/dummy/dummy.py +++ b/ereuse_devicehub/dummy/dummy.py @@ -1,5 +1,6 @@ import itertools import json +import uuid from pathlib import Path import click @@ -113,6 +114,8 @@ class Dummy: for path in bar: with path.open() as f: snapshot = yaml.load(f) + if snapshot['device']['type'] in ['Desktop', 'Laptop']: + snapshot['device']['system_uuid'] = uuid.uuid4() s, _ = user1.post(res=m.Snapshot, data=self.json_encode(snapshot)) if s.get('uuid', None) == 'ec23c11b-80b6-42cd-ac5c-73ba7acddbc4': sample_pc = s['device']['id'] diff --git a/ereuse_devicehub/dummy/files/asus-1001pxd.snapshot.11.yaml b/ereuse_devicehub/dummy/files/asus-1001pxd.snapshot.11.yaml index f3f907fa..866fc8cc 100644 --- a/ereuse_devicehub/dummy/files/asus-1001pxd.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/asus-1001pxd.snapshot.11.yaml @@ -178,6 +178,7 @@ ], "type": "Laptop" }, + "debug": {"lshw": {"configuration": {"uuid": "79c5098f-bc44-4834-8a59-9ea61d956c31"}}}, "elapsed": 14725, "endTime": "2018-11-24T18:06:37.611704+00:00", "software": "Workbench", 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 f3c848e1..ae5a268e 100644 --- a/ereuse_devicehub/dummy/files/asus-eee-1000h.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/asus-eee-1000h.snapshot.11.yaml @@ -119,6 +119,7 @@ "manufacturer": "ASUSTeK Computer INC." } ], + "debug": {"lshw": {"configuration": {"uuid": "645f00bf-1ec0-4fdb-9608-b5ac73e285f6"}}}, "version": "11.0a4", "elapsed": 6, "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 98b23bb8..625884b3 100644 --- a/ereuse_devicehub/dummy/files/dell-optiplexgx520.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/dell-optiplexgx520.snapshot.11.yaml @@ -148,6 +148,7 @@ "model": "0UG982" } ], + "debug": {"lshw": {"configuration": {"uuid": "5dcdd380-5a54-48bc-99bf-aff6019e8491"}}}, "version": "11.0a3", "closed": false, "elapsed": 1512, diff --git a/ereuse_devicehub/dummy/files/hp1.snapshot.11.yaml b/ereuse_devicehub/dummy/files/hp1.snapshot.11.yaml index 86489428..95311cbe 100644 --- a/ereuse_devicehub/dummy/files/hp1.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/hp1.snapshot.11.yaml @@ -132,5 +132,6 @@ "model": "HP Compaq 8100 Elite SFF", "manufacturer": "Hewlett-Packard" }, + "debug": {"lshw": {"configuration": {"uuid": "f6cfe48a-93d5-4e94-ab7b-3ee371e4d048"}}}, "version": "11.0a3" } diff --git a/ereuse_devicehub/dummy/files/hp2.snapshot.11.yaml b/ereuse_devicehub/dummy/files/hp2.snapshot.11.yaml index 80591b42..1e263ce6 100644 --- a/ereuse_devicehub/dummy/files/hp2.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/hp2.snapshot.11.yaml @@ -170,5 +170,6 @@ }, "software": "Workbench", "endTime": "2018-07-11T10:30:22.395958+00:00", + "debug": {"lshw": {"configuration": {"uuid": "75dcb454-ae80-4a87-a192-185d3b0250c0"}}}, "elapsed": 2766 } diff --git a/ereuse_devicehub/dummy/files/laptop-with-2-hid.snapshot.11.yaml b/ereuse_devicehub/dummy/files/laptop-with-2-hid.snapshot.11.yaml index 8cf37d51..8ca0798a 100644 --- a/ereuse_devicehub/dummy/files/laptop-with-2-hid.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/laptop-with-2-hid.snapshot.11.yaml @@ -146,6 +146,7 @@ "pcmcia": 0 } ], + "debug": {"lshw": {"configuration": {"uuid": "fcaf784e-5e57-43a2-b03f-8c56dabd0415"}}}, "uuid": "a01eacdb-db01-43ec-b6fb-a9b8cd21492d", "type": "Snapshot", "version": "11.0a4", diff --git a/ereuse_devicehub/dummy/files/lenovo-3493BAG.snapshot.11.yaml b/ereuse_devicehub/dummy/files/lenovo-3493BAG.snapshot.11.yaml index c73871ad..e7fb82f0 100644 --- a/ereuse_devicehub/dummy/files/lenovo-3493BAG.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/lenovo-3493BAG.snapshot.11.yaml @@ -4,6 +4,7 @@ "closed": false, "endTime": "2018-07-11T13:26:29.365504+00:00", "type": "Snapshot", + "debug": {"lshw": {"configuration": {"uuid": "4f256440-e43f-429a-a2c6-1e8f3365de56"}}}, "device": { "serialNumber": "PB357N0", "actions": [ diff --git a/ereuse_devicehub/dummy/files/nec.snapshot.11.yaml b/ereuse_devicehub/dummy/files/nec.snapshot.11.yaml index d846eb7a..5ec32875 100644 --- a/ereuse_devicehub/dummy/files/nec.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/nec.snapshot.11.yaml @@ -148,6 +148,7 @@ "slots": 4 } ], + "debug": {"lshw": {"configuration": {"uuid": "077cad5d-ae1b-4156-a9a1-98bca6fa5c35"}}}, "version": "11.0a3", "endTime": "2018-07-11T10:28:55.879745+00:00", "type": "Snapshot", diff --git a/ereuse_devicehub/dummy/files/oreo.snapshot.yaml b/ereuse_devicehub/dummy/files/oreo.snapshot.yaml index 348c9420..1e3da274 100644 --- a/ereuse_devicehub/dummy/files/oreo.snapshot.yaml +++ b/ereuse_devicehub/dummy/files/oreo.snapshot.yaml @@ -136,8 +136,8 @@ ], "elapsed": 203, "device": { - "manufacturer": null, - "model": null, + "manufacturer": "Asus", + "model": "P7P55D", "chassis": "Tower", "type": "Desktop", "serialNumber": null, @@ -158,7 +158,7 @@ ] }, "version": "11.0a6", - + "debug": {"lshw": {"configuration": {"uuid": "59ca9a2a-65bd-4802-89bb-315156a9352b"}}}, "type": "Snapshot", "closed": true, "software": "Workbench" diff --git a/ereuse_devicehub/dummy/files/pc-laudem.snapshot.11.yaml b/ereuse_devicehub/dummy/files/pc-laudem.snapshot.11.yaml index a4f76e6f..86127bc1 100644 --- a/ereuse_devicehub/dummy/files/pc-laudem.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/pc-laudem.snapshot.11.yaml @@ -142,7 +142,7 @@ }, "elapsed": 238, "endTime": "2018-10-15T13:59:37.431309+00:00", - + "debug": {"lshw": {"configuration": {"uuid": "43686b8e-e1ae-4e4e-bc51-f98f51e97c2d"}}}, "software": "Workbench", "type": "Snapshot", "uuid": "ec23c11b-80b6-42cd-ac5c-73ba7acddbc4", 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 a807c7f0..5a90e00a 100644 --- a/ereuse_devicehub/dummy/files/real-eee-1001pxd.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/real-eee-1001pxd.snapshot.11.yaml @@ -158,5 +158,6 @@ } ] }, + "debug": {"lshw": {"configuration": {"uuid": "a0cef731-9a78-4087-889c-dfb6ba5c2e9b"}}}, "closed": false } 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 91aa12d6..8d921acd 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 @@ -114,6 +114,7 @@ } ], "version": "11.0a3", + "debug": {"lshw": {"configuration": {"uuid": "f2c50acd-501a-4f0b-b07c-58254b2ab8c9"}}}, "device": { "type": "Desktop", "model": "HP Compaq 8000 Elite SFF", diff --git a/ereuse_devicehub/dummy/files/real-hp.snapshot.11.yaml b/ereuse_devicehub/dummy/files/real-hp.snapshot.11.yaml index 7158225e..8f9b2333 100644 --- a/ereuse_devicehub/dummy/files/real-hp.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/real-hp.snapshot.11.yaml @@ -1,6 +1,7 @@ { "closed": false, "uuid": "f9e5e587-baee-44e1-9a94-255d216bbda9", + "debug": {"lshw": {"configuration": {"uuid": "4d21dd26-aa45-4902-a5f2-8a06e364cf25"}}}, "components": [ { "actions": [], diff --git a/ereuse_devicehub/dummy/files/real-toshiba.snapshot.11.yaml b/ereuse_devicehub/dummy/files/real-toshiba.snapshot.11.yaml index 1a274d30..db83c5b2 100644 --- a/ereuse_devicehub/dummy/files/real-toshiba.snapshot.11.yaml +++ b/ereuse_devicehub/dummy/files/real-toshiba.snapshot.11.yaml @@ -131,6 +131,7 @@ "model": "NB200" }, "uuid": "918726ae-c6bc-40aa-97cf-ad80d69268f9", + "debug": {"lshw": {"configuration": {"uuid": "33627ef0-89a9-4659-bb29-faa936727e0b"}}}, "closed": false, "type": "Snapshot" }