Change event to action complying with schema.org

This commit is contained in:
Xavier Bustamante Talavera 2019-05-11 16:27:22 +02:00
parent 0dc8ced255
commit 61f4c127d4
98 changed files with 1975 additions and 2102 deletions

View File

@ -7,7 +7,7 @@ from teal.config import Config
from teal.enums import Currency
from teal.utils import import_resource
from ereuse_devicehub.resources import agent, event, inventory, lot, tag, user
from ereuse_devicehub.resources import action, agent, inventory, lot, tag, user
from ereuse_devicehub.resources.device import definitions
from ereuse_devicehub.resources.documents import documents
from ereuse_devicehub.resources.enums import PriceSoftware
@ -15,7 +15,7 @@ from ereuse_devicehub.resources.enums import PriceSoftware
class DevicehubConfig(Config):
RESOURCE_DEFINITIONS = set(chain(import_resource(definitions),
import_resource(event),
import_resource(action),
import_resource(user),
import_resource(tag),
import_resource(agent),

View File

@ -14,7 +14,7 @@ class DhSession(SchemaSession):
to be used once in each request, at the very end before
a commit.
"""
# This was done before with an ``before_commit`` sqlalchemy event
# This was done before with an ``before_commit`` sqlalchemy action
# however it is too fragile it does not detect previously-flushed
# things
# This solution makes this more aware to the user, although

View File

@ -11,9 +11,9 @@ from ereuse_utils.test import ANY
from ereuse_devicehub.client import UserClient
from ereuse_devicehub.db import db
from ereuse_devicehub.resources.action import models as m
from ereuse_devicehub.resources.agent.models import Person
from ereuse_devicehub.resources.device.models import Device
from ereuse_devicehub.resources.event import models as m
from ereuse_devicehub.resources.lot.models import Lot
from ereuse_devicehub.resources.tag.model import Tag
from ereuse_devicehub.resources.user import User
@ -95,18 +95,18 @@ class Dummy:
# Make one hdd ErasePhysical
hdd = next(hdd for hdd in s['components'] if hdd['type'] == 'HardDrive')
user.post({'type': 'ErasePhysical', 'method': 'Shred', 'device': hdd['id']},
res=m.Event)
res=m.Action)
assert sample_pc
print('PC sample is', sample_pc)
# Link tags and eTags
for tag, pc in zip((self.TAGS[1], self.TAGS[2], self.ET[0][0], self.ET[1][1]), pcs):
user.put({}, res=Tag, item='{}/device/{}'.format(tag, pc), status=204)
# Perform generic events
# Perform generic actions
for pc, model in zip(pcs,
{m.ToRepair, m.Repair, m.ToPrepare, m.ReadyToUse, m.ToPrepare,
m.Prepare}):
user.post({'type': model.t, 'devices': [pc]}, res=m.Event)
user.post({'type': model.t, 'devices': [pc]}, res=m.Action)
# Perform a Sell to several devices
user.post(
@ -115,7 +115,7 @@ class Dummy:
'to': user.user['individuals'][0]['id'],
'devices': list(itertools.islice(pcs, len(pcs) // 2))
},
res=m.Event)
res=m.Action)
parent, _ = user.post(({'name': 'Parent'}), res=Lot)
child, _ = user.post(({'name': 'Child'}), res=Lot)
@ -139,14 +139,14 @@ class Dummy:
i, _ = user.get(res=Device, query=[('search', 'pc')])
assert 14 == len(i['items'])
# Let's create a set of events for the pc device
# Let's create a set of actions for the pc device
# Make device Ready
user.post({'type': m.ToPrepare.t, 'devices': [sample_pc]}, res=m.Event)
user.post({'type': m.Prepare.t, 'devices': [sample_pc]}, res=m.Event)
user.post({'type': m.ReadyToUse.t, 'devices': [sample_pc]}, res=m.Event)
user.post({'type': m.ToPrepare.t, 'devices': [sample_pc]}, res=m.Action)
user.post({'type': m.Prepare.t, 'devices': [sample_pc]}, res=m.Action)
user.post({'type': m.ReadyToUse.t, 'devices': [sample_pc]}, res=m.Action)
user.post({'type': m.Price.t, 'device': sample_pc, 'currency': 'EUR', 'price': 85},
res=m.Event)
res=m.Action)
# todo test reserve
user.post( # Sell device
{
@ -154,7 +154,7 @@ class Dummy:
'to': user.user['individuals'][0]['id'],
'devices': [sample_pc]
},
res=m.Event)
res=m.Action)
# todo Receive
user.get(res=Device, item=sample_pc) # Test

View File

@ -6,7 +6,7 @@
{
"address": 64,
"cores": 1,
"events": [
"actions": [
{
"elapsed": 0,
"rate": 6666.22,
@ -26,7 +26,7 @@
"type": "Processor"
},
{
"events": [],
"actions": [],
"manufacturer": "Qualcomm Atheros",
"model": "AR9285 Wireless Network Adapter",
"serialNumber": "74:2f:68:8b:fd:c8",
@ -34,7 +34,7 @@
"wireless": true
},
{
"events": [],
"actions": [],
"manufacturer": "Qualcomm Atheros",
"model": "AR8152 v2.0 Fast Ethernet",
"serialNumber": "14:da:e9:42:f6:7c",
@ -43,7 +43,7 @@
"wireless": false
},
{
"events": [],
"actions": [],
"format": "DIMM",
"interface": "DDR2",
"manufacturer": null,
@ -54,21 +54,21 @@
"type": "RamModule"
},
{
"events": [],
"actions": [],
"manufacturer": "Intel Corporation",
"model": "NM10/ICH7 Family High Definition Audio Controller",
"serialNumber": null,
"type": "SoundCard"
},
{
"events": [],
"actions": [],
"manufacturer": "Azurewave",
"model": "USB 2.0 UVC VGA WebCam",
"serialNumber": "0x0001",
"type": "SoundCard"
},
{
"events": [
"actions": [
{
"endTime": "2018-11-24T22:00:39.643726+00:00",
"severity": "Info",
@ -123,7 +123,7 @@
"type": "HardDrive"
},
{
"events": [],
"actions": [],
"manufacturer": "Intel Corporation",
"memory": 256.0,
"model": "Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller",
@ -131,7 +131,7 @@
"type": "GraphicCard"
},
{
"events": [
"actions": [
{
"type": "TestBios",
"accessRange": "A"
@ -150,7 +150,7 @@
],
"device": {
"chassis": "Netbook",
"events": [
"actions": [
{
"elapsed": 16,
"rate": 15.9165,
@ -180,13 +180,6 @@
},
"elapsed": 14725,
"endTime": "2018-11-24T18:06:37.611704+00:00",
"expectedEvents": [
"Benchmark",
"TestDataStorage",
"StressTest",
"EraseBasic",
"Install"
],
"software": "Workbench",
"type": "Snapshot",
"uuid": "f6cba71f-0ac1-4aba-8b6a-c1fd56ab483d",

View File

@ -7,7 +7,7 @@
"serialNumber": "94OAAQ021116",
"type": "Laptop",
"model": "1000H",
"events": [
"actions": [
{
"elapsed": 19,
"rate": 19.3106,
@ -29,21 +29,21 @@
"type": "NetworkAdapter",
"wireless": false,
"model": "AR8121/AR8113/AR8114 Gigabit or Fast Ethernet",
"events": [],
"actions": [],
"manufacturer": "Qualcomm Atheros"
},
{
"serialNumber": null,
"type": "SoundCard",
"model": "NM10/ICH7 Family High Definition Audio Controller",
"events": [],
"actions": [],
"manufacturer": "Intel Corporation"
},
{
"serialNumber": "SN0001",
"type": "SoundCard",
"model": "CNF7129",
"events": [],
"actions": [],
"manufacturer": "Chicony Electronics Co., Ltd."
},
{
@ -53,7 +53,7 @@
"type": "RamModule",
"interface": "SDRAM",
"model": null,
"events": [],
"actions": [],
"manufacturer": null
},
{
@ -63,7 +63,7 @@
"type": "Processor",
"address": 32,
"model": "Intel Atom CPU N270 @ 1.60GHz",
"events": [
"actions": [
{
"elapsed": 172,
"rate": 171.6818,
@ -83,7 +83,7 @@
"type": "HardDrive",
"interface": "ATA",
"model": "ST9160310AS",
"events": [
"actions": [
{
"readSpeed": 63.3,
"type": "BenchmarkDataStorage",
@ -98,7 +98,7 @@
"type": "GraphicCard",
"memory": 256.0,
"model": "Mobile 945GSE Express Integrated Graphics Controller",
"events": [],
"actions": [],
"manufacturer": "Intel Corporation"
},
{
@ -110,7 +110,7 @@
"serial": 0,
"slots": 1,
"model": "1000H",
"events": [
"actions": [
{
"accessRange": "A",
"type": "TestBios"

View File

@ -10,7 +10,7 @@ device:
resolutionWidth: 1920
resolutionHeight: 1080
size: 21.5
events:
actions:
- type: VisualTest
appearanceRange: A
functionalityRange: C

View File

@ -2,7 +2,7 @@
"device": {
"chassis": "Tower",
"serialNumber": "6G0772J",
"events": [
"actions": [
{
"rate": 2.1341,
"type": "BenchmarkRamSysbench",
@ -29,7 +29,7 @@
{
"serialNumber": null,
"address": 64,
"events": [
"actions": [
{
"rate": 11970.92,
"type": "BenchmarkProcessor",
@ -48,7 +48,7 @@
},
{
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard",
"manufacturer": "Intel Corporation",
"model": "82801G AC'97 Audio Controller"
@ -56,7 +56,7 @@
{
"size": 512,
"serialNumber": "4A7012A1",
"events": [],
"actions": [],
"speed": 533.0,
"type": "RamModule",
"format": "DIMM",
@ -67,7 +67,7 @@
{
"size": 512,
"serialNumber": null,
"events": [],
"actions": [],
"speed": 533.0,
"type": "RamModule",
"format": "DIMM",
@ -77,7 +77,7 @@
},
{
"serialNumber": "00:13:72:78:53:12",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"manufacturer": "Broadcom Limited",
"speed": 1000,
@ -86,7 +86,7 @@
},
{
"serialNumber": "5LR30DTZ",
"events": [
"actions": [
{
"steps": [
{
@ -124,7 +124,7 @@
},
{
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"manufacturer": "Intel Corporation",
"memory": 256.0,
@ -134,7 +134,7 @@
"slots": 0,
"usb": 5,
"serial": 1,
"events": [
"actions": [
{
"type": "TestBios",
"accessRange": "A"
@ -153,10 +153,5 @@
"elapsed": 1512,
"endTime": "2018-07-11T11:17:00.888231+00:00",
"type": "Snapshot",
"expectedEvents": [
"Benchmark",
"SmartTest",
"StressTest",
"EraseBasic"
]
}

View File

@ -1,11 +1,5 @@
{
"software": "Workbench",
"expectedEvents": [
"Benchmark",
"SmartTest",
"StressTest",
"EraseBasic"
],
"closed": false,
"elapsed": -3058,
"uuid": "106930cd-e948-4cca-a8c8-1e39d6192ad6",
@ -14,7 +8,7 @@
{
"type": "Processor",
"speed": 1.199,
"events": [
"actions": [
{
"type": "BenchmarkProcessor",
"rate": 23409.32,
@ -35,7 +29,7 @@
{
"memory": 256.0,
"type": "GraphicCard",
"events": [],
"actions": [],
"serialNumber": null,
"model": "Core Processor Integrated Graphics Controller",
"manufacturer": "Intel Corporation"
@ -43,7 +37,7 @@
{
"type": "NetworkAdapter",
"speed": 1000,
"events": [],
"actions": [],
"serialNumber": "6c:62:6d:81:22:65",
"model": "82578DM Gigabit Network Connection",
"manufacturer": "Intel Corporation",
@ -51,7 +45,7 @@
},
{
"type": "SoundCard",
"events": [],
"actions": [],
"serialNumber": null,
"model": "5 Series/3400 Series Chipset High Definition Audio",
"manufacturer": "Intel Corporation"
@ -60,7 +54,7 @@
"speed": 1333.0,
"type": "RamModule",
"format": "DIMM",
"events": [],
"actions": [],
"size": 2048,
"serialNumber": "E6002F30",
"interface": "DDR3",
@ -69,7 +63,7 @@
},
{
"type": "HardDrive",
"events": [
"actions": [
{
"type": "EraseBasic",
@ -110,7 +104,7 @@
"serial": 0,
"type": "Motherboard",
"slots": 0,
"events": [],
"actions": [],
"serialNumber": "CZC0408YNC",
"usb": 2,
"firewire": 0,
@ -122,7 +116,7 @@
"device": {
"type": "Desktop",
"chassis": "Tower",
"events": [
"actions": [
{
"type": "BenchmarkRamSysbench",
"rate": 0.9767,

View File

@ -10,7 +10,7 @@
"type": "Processor",
"serialNumber": null,
"address": 64,
"events": [
"actions": [
{
"elapsed": 0,
"rate": 23408.76,
@ -29,7 +29,7 @@
"type": "GraphicCard",
"serialNumber": null,
"memory": 256.0,
"events": []
"actions": []
},
{
"speed": 1000,
@ -38,14 +38,14 @@
"type": "NetworkAdapter",
"wireless": false,
"serialNumber": "6c:62:6d:81:21:7f",
"events": []
"actions": []
},
{
"model": "5 Series/3400 Series Chipset High Definition Audio",
"manufacturer": "Intel Corporation",
"type": "SoundCard",
"serialNumber": null,
"events": []
"actions": []
},
{
"interface": "DDR3",
@ -56,7 +56,7 @@
"manufacturer": "JEDEC ID:80 2C",
"type": "RamModule",
"speed": 1333.0,
"events": []
"actions": []
},
{
"interface": "ATA",
@ -65,7 +65,7 @@
"manufacturer": "Hitachi",
"type": "HardDrive",
"serialNumber": "PVB200Z30JWXRF",
"events": [
"actions": [
{
"elapsed": 1,
"type": "TestDataStorage",
@ -103,7 +103,7 @@
"manufacturer": "Seagate",
"type": "HardDrive",
"serialNumber": "9QZCVLJX",
"events": [
"actions": [
{
"elapsed": 0,
"type": "TestDataStorage",
@ -144,7 +144,7 @@
"serialNumber": "CZC0408YP6",
"slots": 0,
"usb": 2,
"events": []
"actions": []
}
],
"closed": false,
@ -155,7 +155,7 @@
"type": "Desktop",
"serialNumber": "CZC0408YP6",
"chassis": "Tower",
"events": [
"actions": [
{
"severity": "Info",
"elapsed": 60,
@ -168,12 +168,6 @@
}
]
},
"expectedEvents": [
"Benchmark",
"SmartTest",
"StressTest",
"EraseBasic"
],
"software": "Workbench",
"endTime": "2018-07-11T10:30:22.395958+00:00",
"elapsed": 2766

View File

@ -7,7 +7,7 @@ device:
serialNumber: BAR
manufacturer: BAZ
layout: ES
events:
actions:
- type: VisualTest
appearanceRange: A
functionalityRange: A

View File

@ -2,7 +2,7 @@
"software": "Workbench",
"endTime": "2018-09-22T19:05:47.005552+00:00",
"device": {
"events": [
"actions": [
{
"rate": 15.9663,
"type": "BenchmarkRamSysbench",
@ -20,21 +20,17 @@
"manufacturer": "eMachines"
},
"elapsed": 451,
"expectedEvents": [
"Benchmark",
"TestDataStorage",
"StressTest"
],
"components": [
{
"events": [],
"actions": [],
"model": "Video WebCam",
"serialNumber": "CN0314-SN30-OV035-VA-R05.00.00",
"type": "SoundCard",
"manufacturer": "SuYin"
},
{
"events": [],
"actions": [],
"model": "SBx00 Azalia",
"serialNumber": null,
"type": "SoundCard",
@ -44,7 +40,7 @@
"speed": 400.0,
"size": 2048,
"format": "DIMM",
"events": [],
"actions": [],
"model": "HYMP125S64CP8-S6",
"interface": "DDR2",
"type": "RamModule",
@ -55,7 +51,7 @@
"speed": 400.0,
"size": 2048,
"format": "DIMM",
"events": [],
"actions": [],
"model": "HYMP125S64CP8-S6",
"interface": "DDR2",
"type": "RamModule",
@ -66,7 +62,7 @@
"speed": 0.8,
"address": 64,
"serialNumber": null,
"events": [
"actions": [
{
"rate": 173.6996,
"type": "BenchmarkProcessorSysbench",
@ -85,7 +81,7 @@
"manufacturer": "Advanced Micro Devices AMD"
},
{
"events": [],
"actions": [],
"model": "AR9285 Wireless Network Adapter",
"serialNumber": "0c:60:76:5f:49:91",
"type": "NetworkAdapter",
@ -94,7 +90,7 @@
},
{
"speed": 100,
"events": [],
"actions": [],
"model": "AR8132 Fast Ethernet",
"serialNumber": "00:26:22:59:a1:56",
"type": "NetworkAdapter",
@ -104,7 +100,7 @@
{
"size": 152627,
"serialNumber": "WD-WX80A8996018",
"events": [
"actions": [
{
"writeSpeed": 17.8,
"type": "BenchmarkDataStorage",
@ -130,7 +126,7 @@
"manufacturer": "Western Digital"
},
{
"events": [],
"actions": [],
"model": "RS780M Mobility Radeon HD 3200",
"serialNumber": null,
"type": "GraphicCard",
@ -140,7 +136,7 @@
{
"slots": 4,
"firewire": 0,
"events": [],
"actions": [],
"model": "E627",
"usb": 3,
"serialNumber": "LXN650207893942DE21601",

View File

@ -6,7 +6,7 @@
"type": "Snapshot",
"device": {
"serialNumber": "PB357N0",
"events": [
"actions": [
{
"elapsed": 60,
"type": "StressTest",
@ -27,7 +27,7 @@
"software": "Workbench",
"components": [
{
"events": [],
"actions": [],
"speed": 1000,
"serialNumber": "d4:3d:7e:41:c4:c4",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
@ -37,7 +37,7 @@
},
{
"cores": 2,
"events": [
"actions": [
{
"elapsed": 0,
"type": "BenchmarkProcessor",
@ -57,7 +57,7 @@
"type": "Processor"
},
{
"events": [],
"actions": [],
"memory": 256.0,
"serialNumber": null,
"model": "2nd Generation Core Processor Family Integrated Graphics Controller",
@ -65,7 +65,7 @@
"type": "GraphicCard"
},
{
"events": [],
"actions": [],
"serialNumber": null,
"model": "6 Series/C200 Series Chipset Family High Definition Audio Controller",
"manufacturer": "Intel Corporation",
@ -73,7 +73,7 @@
},
{
"serialNumber": "292E48DA",
"events": [],
"actions": [],
"speed": 1333.0,
"size": 2048,
"format": "DIMM",
@ -84,7 +84,7 @@
},
{
"serialNumber": "Z2AYPLNP",
"events": [
"actions": [
{
"writeSpeed": 20.4,
"type": "BenchmarkDataStorage",
@ -123,7 +123,7 @@
"serial": 1,
"usb": 2,
"pcmcia": 0,
"events": [],
"actions": [],
"slots": 2,
"serialNumber": null,
"firewire": 0,
@ -132,10 +132,5 @@
"type": "Motherboard"
}
],
"expectedEvents": [
"Benchmark",
"SmartTest",
"StressTest",
"EraseBasic"
]
}

View File

@ -4,7 +4,7 @@
"device": {
"serialNumber": "SN 123456789ABC",
"manufacturer": "NEC Computers SAS",
"events": [
"actions": [
{
"severity": "Info",
"elapsed": 60,
@ -30,7 +30,7 @@
"serialNumber": "00:24:21:7a:90:02",
"manufacturer": "Intel Corporation",
"speed": 1000,
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": false,
"model": "82566DM-2 Gigabit Network Connection"
@ -40,7 +40,7 @@
"manufacturer": "Intel Corp.",
"speed": 3.0,
"cores": 2,
"events": [
"actions": [
{
"rate": 20.1309,
"elapsed": 20,
@ -60,14 +60,14 @@
"serialNumber": null,
"manufacturer": "Intel Corporation",
"memory": 256.0,
"events": [],
"actions": [],
"type": "GraphicCard",
"model": "82Q35 Express Integrated Graphics Controller"
},
{
"serialNumber": null,
"manufacturer": "Intel Corporation",
"events": [],
"actions": [],
"type": "SoundCard",
"model": "82801I HD Audio Controller"
},
@ -78,7 +78,7 @@
"interface": "DDR2",
"format": "DIMM",
"size": 1024,
"events": [],
"actions": [],
"type": "RamModule",
"model": "M3 78T2863QZS-CE6"
},
@ -89,7 +89,7 @@
"interface": "DDR2",
"format": "DIMM",
"size": 1024,
"events": [],
"actions": [],
"type": "RamModule",
"model": "M3 78T2863QZS-CE6"
},
@ -98,7 +98,7 @@
"manufacturer": "Hitachi",
"interface": "ATA",
"size": 305245,
"events": [
"actions": [
{
"severity": "Info",
"endTime": "2018-07-11T11:33:41.531918+00:00",
@ -136,7 +136,7 @@
"serial": 1,
"pcmcia": 0,
"usb": 8,
"events": [
"actions": [
{
"type": "TestBios",
"accessRange": "A"
@ -149,12 +149,6 @@
}
],
"version": "11.0a3",
"expectedEvents": [
"Benchmark",
"SmartTest",
"StressTest",
"EraseBasic"
],
"endTime": "2018-07-11T10:28:55.879745+00:00",
"type": "Snapshot",
"elapsed": 3886,

View File

@ -9,7 +9,7 @@
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "00:26:18:96:dc:af",
"type": "NetworkAdapter",
"events": []
"actions": []
},
{
"speed": 1333.0,
@ -20,7 +20,7 @@
"type": "RamModule",
"format": "DIMM",
"size": 2048,
"events": []
"actions": []
},
{
"speed": 1333.0,
@ -31,7 +31,7 @@
"type": "RamModule",
"format": "DIMM",
"size": 2048,
"events": []
"actions": []
},
{
"speed": 1333.0,
@ -42,7 +42,7 @@
"type": "RamModule",
"format": "DIMM",
"size": 2048,
"events": []
"actions": []
},
{
"speed": 1333.0,
@ -53,14 +53,14 @@
"type": "RamModule",
"format": "DIMM",
"size": 2048,
"events": []
"actions": []
},
{
"manufacturer": "Intel Corporation",
"model": "5 Series/3400 Series Chipset High Definition Audio",
"serialNumber": null,
"type": "SoundCard",
"events": []
"actions": []
},
{
"speed": 2.5330000000000004,
@ -71,7 +71,7 @@
"serialNumber": null,
"type": "Processor",
"threads": 8,
"events": [
"actions": [
{
"elapsed": 9,
"type": "BenchmarkProcessorSysbench",
@ -91,7 +91,7 @@
"serialNumber": "S246J90Z406422",
"type": "HardDrive",
"size": 953869,
"events": [
"actions": [
{
"elapsed": 120,
"lifetime": 14298,
@ -119,7 +119,7 @@
"serialNumber": null,
"type": "GraphicCard",
"memory": 256.0,
"events": []
"actions": []
},
{
"firewire": 1,
@ -131,7 +131,7 @@
"pcmcia": 0,
"slots": 4,
"serial": 1,
"events": []
"actions": []
}
],
"elapsed": 203,
@ -141,7 +141,7 @@
"chassis": "Tower",
"type": "Desktop",
"serialNumber": null,
"events": [
"actions": [
{
"elapsed": 60,
"type": "StressTest",
@ -158,11 +158,7 @@
]
},
"version": "11.0a6",
"expectedEvents": [
"Benchmark",
"TestDataStorage",
"StressTest"
],
"type": "Snapshot",
"closed": true,
"software": "Workbench"

View File

@ -2,7 +2,7 @@
"closed": true,
"components": [
{
"events": [],
"actions": [],
"manufacturer": "Intel Corporation",
"model": "82567LM-3 Gigabit Network Connection",
"serialNumber": "00:23:7d:49:5e:31",
@ -11,14 +11,14 @@
"wireless": false
},
{
"events": [],
"actions": [],
"manufacturer": "Intel Corporation",
"model": "82801JD/DO HD Audio Controller",
"serialNumber": null,
"type": "SoundCard"
},
{
"events": [],
"actions": [],
"format": "DIMM",
"interface": "DDR2",
"manufacturer": null,
@ -31,7 +31,7 @@
{
"address": 64,
"cores": 2,
"events": [
"actions": [
{
"elapsed": 0,
"rate": 11970.54,
@ -51,7 +51,7 @@
"type": "Processor"
},
{
"events": [
"actions": [
{
"elapsed": 16,
"readSpeed": 76.8,
@ -81,7 +81,7 @@
"type": "HardDrive"
},
{
"events": [],
"actions": [],
"manufacturer": "Intel Corporation",
"memory": 256.0,
"model": "4 Series Chipset Integrated Graphics Controller",
@ -89,7 +89,7 @@
"type": "GraphicCard"
},
{
"events": [
"actions": [
{
"type": "TestBios",
"accessRange": "A"
@ -108,7 +108,7 @@
],
"device": {
"chassis": "Tower",
"events": [
"actions": [
{
"elapsed": 60,
"severity": "Info",
@ -142,11 +142,7 @@
},
"elapsed": 238,
"endTime": "2018-10-15T13:59:37.431309+00:00",
"expectedEvents": [
"Benchmark",
"TestDataStorage",
"StressTest"
],
"software": "Workbench",
"type": "Snapshot",
"uuid": "ec23c11b-80b6-42cd-ac5c-73ba7acddbc4",

View File

@ -6,7 +6,7 @@
"serialNumber": "74:2f:68:8b:fd:c8",
"manufacturer": "Qualcomm Atheros",
"wireless": true,
"events": []
"actions": []
},
{
"type": "NetworkAdapter",
@ -15,7 +15,7 @@
"manufacturer": "Qualcomm Atheros",
"speed": 100,
"wireless": false,
"events": []
"actions": []
},
{
"type": "Processor",
@ -26,7 +26,7 @@
"serialNumber": null,
"manufacturer": "Intel Corp.",
"speed": 1.667,
"events": [
"actions": [
{
"type": "BenchmarkProcessorSysbench",
"rate": 164.0803,
@ -45,21 +45,21 @@
"serialNumber": null,
"memory": 256.0,
"manufacturer": "Intel Corporation",
"events": []
"actions": []
},
{
"type": "SoundCard",
"model": "NM10/ICH7 Family High Definition Audio Controller",
"serialNumber": null,
"manufacturer": "Intel Corporation",
"events": []
"actions": []
},
{
"type": "SoundCard",
"model": "USB 2.0 UVC VGA WebCam",
"serialNumber": "0x0001",
"manufacturer": "Azurewave",
"events": []
"actions": []
},
{
"type": "RamModule",
@ -70,7 +70,7 @@
"serialNumber": null,
"manufacturer": null,
"speed": 667.0,
"events": []
"actions": []
},
{
"type": "HardDrive",
@ -79,7 +79,7 @@
"interface": "ATA",
"serialNumber": "E2024242CV86HJ",
"manufacturer": "Hitachi",
"events": [
"actions": [
{
"type": "BenchmarkDataStorage",
"elapsed": 16,
@ -120,7 +120,7 @@
"serialNumber": "Eee0123456789",
"usb": 5,
"manufacturer": "ASUSTeK Computer INC.",
"events": [
"actions": [
{
"type": "TestBios",
"accessRange": "C"
@ -140,7 +140,7 @@
"serialNumber": "B8OAAS048286",
"manufacturer": "ASUSTeK Computer INC.",
"chassis": "Netbook",
"events": [
"actions": [
{
"type": "BenchmarkRamSysbench",
"rate": 15.7188,
@ -158,11 +158,5 @@
}
]
},
"expectedEvents": [
"Benchmark",
"SmartTest",
"StressTest",
"EraseBasic"
],
"closed": false
}

View File

@ -13,7 +13,7 @@
"serialNumber": "00:23:24:0d:86:28",
"manufacturer": "Intel Corporation",
"wireless": false,
"events": []
"actions": []
},
{
"type": "NetworkAdapter",
@ -22,7 +22,7 @@
"serialNumber": "00:0e:0c:b6:f2:91",
"manufacturer": "Intel Corporation",
"wireless": false,
"events": []
"actions": []
},
{
"cores": 4,
@ -31,7 +31,7 @@
"speed": 1.9980000000000002,
"serialNumber": null,
"manufacturer": "Intel Corp.",
"events": [
"actions": [
{
"elapsed": 0,
"rate": 6665.7,
@ -45,7 +45,7 @@
"model": "4 Series Chipset Integrated Graphics Controller",
"serialNumber": null,
"manufacturer": "Intel Corporation",
"events": [],
"actions": [],
"memory": 256.0
},
{
@ -53,7 +53,7 @@
"model": "82801JD/DO HD Audio Controller",
"serialNumber": null,
"manufacturer": "Intel Corporation",
"events": []
"actions": []
},
{
"size": 2048,
@ -64,7 +64,7 @@
"serialNumber": "F8482E29",
"format": "DIMM",
"manufacturer": "JEDEC ID:80 2C",
"events": []
"actions": []
},
{
"size": 2048,
@ -75,7 +75,7 @@
"serialNumber": "62072F30",
"format": "DIMM",
"manufacturer": "JEDEC ID:80 2C",
"events": []
"actions": []
},
{
"size": 238475,
@ -84,7 +84,7 @@
"model": "ST3250318AS",
"serialNumber": "9VY6HBKE",
"manufacturer": "Seagate",
"events": [
"actions": [
{
"elapsed": 0,
"type": "TestDataStorage",
@ -108,7 +108,7 @@
"serialNumber": "CZC03217S7",
"firewire": 0,
"manufacturer": "Hewlett-Packard",
"events": [],
"actions": [],
"serial": 0,
"usb": 8
}
@ -120,9 +120,6 @@
"chassis": "Tower",
"serialNumber": "CZC03217S7",
"manufacturer": "Hewlett-Packard",
"events": []
},
"expectedEvents": [
"SmartTest"
]
"actions": []
}
}

View File

@ -3,7 +3,7 @@
"uuid": "f9e5e587-baee-44e1-9a94-255d216bbda9",
"components": [
{
"events": [],
"actions": [],
"serialNumber": "6c:62:6d:81:22:9f",
"type": "NetworkAdapter",
"manufacturer": "Intel Corporation",
@ -13,7 +13,7 @@
},
{
"format": "DIMM",
"events": [
"actions": [
],
"interface": "DDR3",
"serialNumber": "B4012F30",
@ -25,7 +25,7 @@
},
{
"format": "DIMM",
"events": [],
"actions": [],
"interface": "DDR3",
"serialNumber": "8E9F2E29",
"size": 2048,
@ -36,7 +36,7 @@
},
{
"format": "DIMM",
"events": [],
"actions": [],
"interface": "DDR3",
"serialNumber": "9A012F30",
"size": 2048,
@ -47,7 +47,7 @@
},
{
"format": "DIMM",
"events": [
"actions": [
],
"interface": "DDR3",
"serialNumber": "8F9F2E29",
@ -59,7 +59,7 @@
},
{
"cores": 2,
"events": [
"actions": [
{
"rate": 23410.76,
"type": "BenchmarkProcessor",
@ -79,7 +79,7 @@
"model": "Intel Core i3 CPU 530 @ 2.93GHz"
},
{
"events": [
"actions": [
{
"writeSpeed": 24.5,
"readSpeed": 111.0,
@ -102,7 +102,7 @@
"model": "WDC WD3200AAJS-6"
},
{
"events": [],
"actions": [],
"serialNumber": null,
"type": "SoundCard",
"manufacturer": "Intel Corporation",
@ -110,14 +110,14 @@
},
{
"memory": 256.0,
"events": [],
"actions": [],
"serialNumber": null,
"type": "GraphicCard",
"manufacturer": "Intel Corporation",
"model": "Core Processor Integrated Graphics Controller"
},
{
"events": [
"actions": [
{
"type": "TestBios",
"accessRange": "A"
@ -137,13 +137,8 @@
"software": "Workbench",
"elapsed": 96,
"version": "11.0a1",
"expectedEvents": [
"StressTest",
"Benchmark",
"SmartTest"
],
"device": {
"events": [
"actions": [
{
"type": "StressTest",
"elapsed": 60,

View File

@ -1,9 +1,4 @@
{
"expectedEvents": [
"SmartTest",
"Benchmark",
"StressTest"
],
"endTime": "2018-06-29T15:29:29.322424+00:00",
"elapsed": 391,
"software": "Workbench",
@ -14,7 +9,7 @@
"size": 1024,
"manufacturer": null,
"format": "SODIMM",
"events": [
"actions": [
],
"speed": 533.0,
"type": "RamModule",
@ -23,21 +18,21 @@
{
"serialNumber": null,
"manufacturer": "Intel Corporation",
"events": [],
"actions": [],
"type": "SoundCard",
"model": "NM10/ICH7 Family High Definition Audio Controller"
},
{
"serialNumber": null,
"manufacturer": "Chicony Electronics Co., Ltd.",
"events": [],
"actions": [],
"type": "SoundCard",
"model": "USB2.0 UVC WebCam"
},
{
"serialNumber": "00:23:08:a5:07:6d",
"manufacturer": "Qualcomm Atheros",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": true,
"model": "AR9285 Wireless Network Adapter"
@ -45,7 +40,7 @@
{
"serialNumber": "00:23:5a:fe:d7:14",
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"events": [],
"actions": [],
"speed": 100,
"type": "NetworkAdapter",
"wireless": false,
@ -55,7 +50,7 @@
"serialNumber": null,
"address": 32,
"manufacturer": "Intel Corp.",
"events": [
"actions": [
{
"rate": 171.3049,
"type": "BenchmarkProcessorSysbench",
@ -75,7 +70,7 @@
"memory": 256.0,
"serialNumber": null,
"manufacturer": "Intel Corporation",
"events": [],
"actions": [],
"type": "GraphicCard",
"model": "Mobile 945GSE Express Integrated Graphics Controller"
},
@ -84,7 +79,7 @@
"interface": "ATA",
"size": 152627,
"manufacturer": "Hitachi",
"events": [
"actions": [
{
"elapsed": 71,
"readSpeed": 19.1,
@ -107,7 +102,7 @@
"serialNumber": "0123456789AB",
"manufacturer": "TOSHIBA",
"firewire": 0,
"events": [],
"actions": [],
"pcmcia": 0,
"usb": 5,
"serial": 1,
@ -119,7 +114,7 @@
"device": {
"serialNumber": "79545417K",
"manufacturer": "TOSHIBA",
"events": [
"actions": [
{
"type": "StressTest",
"severity": "Info",

View File

@ -1,12 +1,8 @@
{
"expectedEvents": [
"Benchmark",
"TestDataStorage",
"StressTest"
],
"device": {
"model": "HP Compaq 8100 Elite SFF",
"events": [
"actions": [
{
"type": "BenchmarkRamSysbench",
"elapsed": 1,
@ -27,7 +23,7 @@
{
"model": "Intel Core i3 CPU 530 @ 2.93GHz",
"address": 64,
"events": [
"actions": [
{
"type": "BenchmarkProcessor",
"elapsed": 0,
@ -48,7 +44,7 @@
},
{
"model": "Core Processor Integrated Graphics Controller",
"events": [],
"actions": [],
"serialNumber": null,
"type": "GraphicCard",
"manufacturer": "Intel Corporation",
@ -56,7 +52,7 @@
},
{
"model": "5 Series/3400 Series Chipset High Definition Audio",
"events": [],
"actions": [],
"serialNumber": null,
"type": "SoundCard",
"manufacturer": "Intel Corporation"
@ -64,7 +60,7 @@
{
"model": "16JTF25664AZ-1G4F",
"interface": "DDR3",
"events": [],
"actions": [],
"serialNumber": "B4012F30",
"type": "RamModule",
"manufacturer": "JEDEC ID:80 2C",
@ -75,7 +71,7 @@
{
"model": "16JTF25664AZ-1G4F",
"interface": "DDR3",
"events": [],
"actions": [],
"serialNumber": "8E9F2E29",
"type": "RamModule",
"manufacturer": "JEDEC ID:80 2C",
@ -86,7 +82,7 @@
{
"model": "16JTF25664AZ-1G4F",
"interface": "DDR3",
"events": [],
"actions": [],
"serialNumber": "9A012F30",
"type": "RamModule",
"manufacturer": "JEDEC ID:80 2C",
@ -97,7 +93,7 @@
{
"model": "16JTF25664AZ-1G4F",
"interface": "DDR3",
"events": [],
"actions": [],
"serialNumber": "8F9F2E29",
"type": "RamModule",
"manufacturer": "JEDEC ID:80 2C",
@ -107,7 +103,7 @@
},
{
"model": "82578DM Gigabit Network Connection",
"events": [],
"actions": [],
"serialNumber": "6c:62:6d:81:22:9f",
"type": "NetworkAdapter",
"wireless": false,
@ -117,7 +113,7 @@
{
"model": "WDC WD3200AAJS-6",
"interface": "ATA",
"events": [
"actions": [
{
"currentPendingSectorCount": 0,
"commandTimeout": 0,
@ -148,7 +144,7 @@
{
"model": "304Ah",
"pcmcia": 0,
"events": [],
"actions": [],
"usb": 2,
"firewire": 0,
"type": "Motherboard",

View File

@ -7,7 +7,7 @@ device:
model: A1586
serialNumber: ABCDEF
imei: 35686800-004141-20
events:
actions:
- type: VisualTest
appearanceRange: A
functionalityRange: B

View File

@ -9,7 +9,6 @@ type: Snapshot
uuid: cb8ce6b5-6a1b-4084-b5b9-d8fadad2a015
version: '11.0'
software: Workbench
expectedEvents: [TestDataStorage, StressTest, EraseSectors, Install]
elapsed: 500
device:
type: Desktop
@ -20,7 +19,7 @@ device:
tags:
- type: Tag
id: tag1
events:
actions:
- type: VisualTest
appearanceRange: A
functionalityRange: B
@ -45,7 +44,7 @@ components:
- type: Processor
model: p1-1ml
manufacturer: p1-1mr
events:
actions:
- type: BenchmarkProcessor
rate: 2410
elapsed: 44
@ -57,7 +56,7 @@ components:
model: ssd1-1ml
manufacturer: ssd1-1mr
size: 1100
events:
actions:
- type: BenchmarkDataStorage
readSpeed: 20
writeSpeed: 15
@ -80,7 +79,7 @@ components:
serialNumber: hdd1-1s
model: hdd1-1ml
manufacturer: hdd1-1mr
events:
actions:
- type: BenchmarkDataStorage
readSpeed: 10
writeSpeed: 5

View File

@ -2,29 +2,29 @@ from typing import Callable, Iterable, Tuple
from teal.resource import Converters, Resource
from ereuse_devicehub.resources.action import schemas
from ereuse_devicehub.resources.action.views import ActionView
from ereuse_devicehub.resources.device.sync import Sync
from ereuse_devicehub.resources.event import schemas
from ereuse_devicehub.resources.event.views import EventView
class EventDef(Resource):
SCHEMA = schemas.Event
VIEW = EventView
class ActionDef(Resource):
SCHEMA = schemas.Action
VIEW = ActionView
AUTH = True
ID_CONVERTER = Converters.uuid
class AddDef(EventDef):
class AddDef(ActionDef):
VIEW = None
SCHEMA = schemas.Add
class RemoveDef(EventDef):
class RemoveDef(ActionDef):
VIEW = None
SCHEMA = schemas.Remove
class EraseBasicDef(EventDef):
class EraseBasicDef(ActionDef):
VIEW = None
SCHEMA = schemas.EraseBasic
@ -54,7 +54,7 @@ class StepRandomDef(StepDef):
SCHEMA = schemas.StepRandom
class BenchmarkDef(EventDef):
class BenchmarkDef(ActionDef):
VIEW = None
SCHEMA = schemas.Benchmark
@ -84,7 +84,7 @@ class BenchmarkRamSysbenchDef(BenchmarkWithRateDef):
SCHEMA = schemas.BenchmarkRamSysbench
class TestDef(EventDef):
class TestDef(ActionDef):
VIEW = None
SCHEMA = schemas.Test
@ -134,7 +134,7 @@ class VisualTestDef(TestDef):
SCHEMA = schemas.VisualTest
class RateDef(EventDef):
class RateDef(ActionDef):
VIEW = None
SCHEMA = schemas.Rate
@ -144,22 +144,22 @@ class RateComputerDef(RateDef):
SCHEMA = schemas.RateComputer
class PriceDef(EventDef):
class PriceDef(ActionDef):
VIEW = None
SCHEMA = schemas.Price
class EreusePriceDef(EventDef):
class EreusePriceDef(ActionDef):
VIEW = None
SCHEMA = schemas.EreusePrice
class InstallDef(EventDef):
class InstallDef(ActionDef):
VIEW = None
SCHEMA = schemas.Install
class SnapshotDef(EventDef):
class SnapshotDef(ActionDef):
VIEW = None
SCHEMA = schemas.Snapshot
@ -167,92 +167,92 @@ class SnapshotDef(EventDef):
static_url_path=None,
template_folder=None, url_prefix=None, subdomain=None, url_defaults=None,
root_path=None, cli_commands: Iterable[Tuple[Callable, str or None]] = tuple()):
url_prefix = '/{}'.format(EventDef.resource)
url_prefix = '/{}'.format(ActionDef.resource)
super().__init__(app, import_name, static_folder, static_url_path, template_folder,
url_prefix, subdomain, url_defaults, root_path, cli_commands)
self.sync = Sync()
class ToRepairDef(EventDef):
class ToRepairDef(ActionDef):
VIEW = None
SCHEMA = schemas.ToRepair
class RepairDef(EventDef):
class RepairDef(ActionDef):
VIEW = None
SCHEMA = schemas.Repair
class ReadyToUse(EventDef):
class ReadyToUse(ActionDef):
VIEW = None
SCHEMA = schemas.ReadyToUse
class ToPrepareDef(EventDef):
class ToPrepareDef(ActionDef):
VIEW = None
SCHEMA = schemas.ToPrepare
class PrepareDef(EventDef):
class PrepareDef(ActionDef):
VIEW = None
SCHEMA = schemas.Prepare
class LiveDef(EventDef):
class LiveDef(ActionDef):
VIEW = None
SCHEMA = schemas.Live
class ReserveDef(EventDef):
class ReserveDef(ActionDef):
VIEW = None
SCHEMA = schemas.Reserve
class CancelReservationDef(EventDef):
class CancelReservationDef(ActionDef):
VIEW = None
SCHEMA = schemas.CancelReservation
class SellDef(EventDef):
class SellDef(ActionDef):
VIEW = None
SCHEMA = schemas.Sell
class DonateDef(EventDef):
class DonateDef(ActionDef):
VIEW = None
SCHEMA = schemas.Donate
class RentDef(EventDef):
class RentDef(ActionDef):
VIEW = None
SCHEMA = schemas.Rent
class CancelTradeDef(EventDef):
class CancelTradeDef(ActionDef):
VIEW = None
SCHEMA = schemas.CancelTrade
class ToDisposeProductDef(EventDef):
class ToDisposeProductDef(ActionDef):
VIEW = None
SCHEMA = schemas.ToDisposeProduct
class DisposeProductDef(EventDef):
class DisposeProductDef(ActionDef):
VIEW = None
SCHEMA = schemas.DisposeProduct
class ReceiveDef(EventDef):
class ReceiveDef(ActionDef):
VIEW = None
SCHEMA = schemas.Receive
class MigrateToDef(EventDef):
class MigrateToDef(ActionDef):
VIEW = None
SCHEMA = schemas.MigrateTo
class MigrateFromDef(EventDef):
class MigrateFromDef(ActionDef):
VIEW = None
SCHEMA = schemas.MigrateFrom

View File

@ -1,7 +1,7 @@
"""
This file contains all events can apply to a device and is sorted according to a structure based on:
This file contains all actions can apply to a device and is sorted according to a structure based on:
* Generic Events
* Generic Actions
* Benchmarks
* Tests
* Rates
@ -31,7 +31,7 @@ from sqlalchemy.ext.orderinglist import ordering_list
from sqlalchemy.orm import backref, relationship, validates
from sqlalchemy.orm.events import AttributeEvents as Events
from sqlalchemy.util import OrderedSet
from teal.db import ArrayOfEnum, CASCADE_OWN, INHERIT_COND, IP, POLYMORPHIC_ID, \
from teal.db import CASCADE_OWN, INHERIT_COND, IP, POLYMORPHIC_ID, \
POLYMORPHIC_ON, StrictVersionType, URL, check_lower, check_range
from teal.enums import Country, Currency, Subdivision
from teal.marshmallow import ValidationError
@ -43,8 +43,8 @@ from ereuse_devicehub.resources.device.models import Component, Computer, DataSt
Device, Laptop, Server
from ereuse_devicehub.resources.enums import AppearanceRange, BatteryHealth, BiosAccessRange, \
ErasureStandards, FunctionalityRange, PhysicalErasureMethod, PriceSoftware, \
R_NEGATIVE, R_POSITIVE, RatingRange, ReceiverRole, Severity, SnapshotExpectedEvents, \
SnapshotSoftware, TestDataStorageLength
R_NEGATIVE, R_POSITIVE, RatingRange, ReceiverRole, Severity, SnapshotSoftware, \
TestDataStorageLength
from ereuse_devicehub.resources.models import STR_SM_SIZE, Thing
from ereuse_devicehub.resources.user.models import User
@ -53,18 +53,18 @@ class JoinedTableMixin:
# noinspection PyMethodParameters
@declared_attr
def id(cls):
return Column(UUID(as_uuid=True), ForeignKey(Event.id), primary_key=True)
return Column(UUID(as_uuid=True), ForeignKey(Action.id), primary_key=True)
_sorted_events = {
'order_by': lambda: Event.end_time,
_sorted_actions = {
'order_by': lambda: Action.end_time,
'collection_class': SortedSet
}
"""For db.backref, return the events sorted by end_time."""
"""For db.backref, return the actions sorted by end_time."""
class Event(Thing):
"""Event performed on a device.
class Action(Thing):
"""Action performed on a device.
This class extends `Schema's Action <https://schema.org/Action>`_.
"""
@ -72,19 +72,19 @@ class Event(Thing):
type = Column(Unicode, nullable=False)
name = Column(CIText(), default='', nullable=False)
name.comment = """
A name or title for the event. Used when searching for events.
A name or title for the action. Used when searching for actions.
"""
severity = Column(teal.db.IntEnum(Severity), default=Severity.Info, nullable=False)
severity.comment = Severity.__doc__
closed = Column(Boolean, default=True, nullable=False)
closed.comment = """
Whether the author has finished the event.
Whether the author has finished the action.
After this is set to True, no modifications are allowed.
By default events are closed when performed.
By default actions are closed when performed.
"""
description = Column(Unicode, default='', nullable=False)
description.comment = """
A comment about the event.
A comment about the action.
"""
start_time = Column(db.TIMESTAMP(timezone=True))
start_time.comment = """
@ -103,13 +103,13 @@ class Event(Thing):
snapshot_id = Column(UUID(as_uuid=True), ForeignKey('snapshot.id',
use_alter=True,
name='snapshot_events'))
name='snapshot_actions'))
snapshot = relationship('Snapshot',
backref=backref('events',
backref=backref('actions',
lazy=True,
cascade=CASCADE_OWN,
**_sorted_events),
primaryjoin='Event.snapshot_id == Snapshot.id')
**_sorted_actions),
primaryjoin='Action.snapshot_id == Snapshot.id')
author_id = Column(UUID(as_uuid=True),
ForeignKey(User.id),
@ -117,7 +117,7 @@ class Event(Thing):
default=lambda: g.user.id)
# todo compute the org
author = relationship(User,
backref=backref('authored_events', lazy=True, collection_class=set),
backref=backref('authored_actions', lazy=True, collection_class=set),
primaryjoin=author_id == User.id)
author_id.comment = """
The user that recorded this action in the system.
@ -133,7 +133,7 @@ class Event(Thing):
default=lambda: g.user.individual.id)
# todo compute the org
agent = relationship(Agent,
backref=backref('events_agent', lazy=True, **_sorted_events),
backref=backref('actions_agent', lazy=True, **_sorted_actions),
primaryjoin=agent_id == Agent.id)
agent_id.comment = """
The direct performer or driver of the action. e.g. John wrote a book.
@ -143,29 +143,29 @@ class Event(Thing):
"""
components = relationship(Component,
backref=backref('events_components', lazy=True, **_sorted_events),
secondary=lambda: EventComponent.__table__,
backref=backref('actions_components', lazy=True, **_sorted_actions),
secondary=lambda: ActionComponent.__table__,
order_by=lambda: Component.id,
collection_class=OrderedSet)
components.comment = """
The components that are affected by the event.
The components that are affected by the action.
When performing events to parent devices their components are
When performing actions to parent devices their components are
affected too.
For example: an ``Allocate`` is performed to a Computer and this
relationship is filled with the components the computer had
at the time of the event.
at the time of the action.
For Add and Remove though, this has another meaning: the components
that are added or removed.
"""
parent_id = Column(BigInteger, ForeignKey(Computer.id))
parent = relationship(Computer,
backref=backref('events_parent', lazy=True, **_sorted_events),
backref=backref('actions_parent', lazy=True, **_sorted_actions),
primaryjoin=parent_id == Computer.id)
parent_id.comment = """
For events that are performed to components, the device parent
For actions that are performed to components, the device parent
at that time.
For example: for a ``EraseBasic`` performed on a data storage, this
@ -186,8 +186,8 @@ class Event(Thing):
@property
def url(self) -> urlutils.URL:
"""The URL where to GET this event."""
return urlutils.URL(url_for_resource(Event, item_id=self.id))
"""The URL where to GET this action."""
return urlutils.URL(url_for_resource(Action, item_id=self.id))
@property
def certificate(self) -> Optional[urlutils.URL]:
@ -204,23 +204,23 @@ class Event(Thing):
#sqlalchemy.ext.declarative.declared_attr>`_
"""
args = {POLYMORPHIC_ID: cls.t}
if cls.t == 'Event':
if cls.t == 'Action':
args[POLYMORPHIC_ON] = cls.type
# noinspection PyUnresolvedReferences
if JoinedTableMixin in cls.mro():
args[INHERIT_COND] = cls.id == Event.id
args[INHERIT_COND] = cls.id == Action.id
return args
@validates('end_time')
def validate_end_time(self, _, end_time: datetime):
if self.start_time and end_time <= self.start_time:
raise ValidationError('The event cannot finish before it starts.')
raise ValidationError('The action cannot finish before it starts.')
return end_time
@validates('start_time')
def validate_start_time(self, _, start_time: datetime):
if self.end_time and start_time >= self.end_time:
raise ValidationError('The event cannot start after it finished.')
raise ValidationError('The action cannot start after it finished.')
return start_time
@property
@ -245,29 +245,29 @@ class Event(Thing):
return '<{0.t} {0.id} {0.severity}>'.format(self)
class EventComponent(db.Model):
class ActionComponent(db.Model):
device_id = Column(BigInteger, ForeignKey(Component.id), primary_key=True)
event_id = Column(UUID(as_uuid=True), ForeignKey(Event.id), primary_key=True)
action_id = Column(UUID(as_uuid=True), ForeignKey(Action.id), primary_key=True)
class JoinedWithOneDeviceMixin:
# noinspection PyMethodParameters
@declared_attr
def id(cls):
return Column(UUID(as_uuid=True), ForeignKey(EventWithOneDevice.id), primary_key=True)
return Column(UUID(as_uuid=True), ForeignKey(ActionWithOneDevice.id), primary_key=True)
class EventWithOneDevice(JoinedTableMixin, Event):
class ActionWithOneDevice(JoinedTableMixin, Action):
device_id = Column(BigInteger, ForeignKey(Device.id), nullable=False)
device = relationship(Device,
backref=backref('events_one',
backref=backref('actions_one',
lazy=True,
cascade=CASCADE_OWN,
**_sorted_events),
**_sorted_actions),
primaryjoin=Device.id == device_id)
__table_args__ = (
db.Index('event_one_device_id_index', device_id, postgresql_using='hash'),
db.Index('action_one_device_id_index', device_id, postgresql_using='hash'),
)
def __repr__(self) -> str:
@ -283,15 +283,15 @@ class EventWithOneDevice(JoinedTableMixin, Event):
#sqlalchemy.ext.declarative.declared_attr>`_
"""
args = {POLYMORPHIC_ID: cls.t}
if cls.t == 'EventWithOneDevice':
if cls.t == 'ActionWithOneDevice':
args[POLYMORPHIC_ON] = cls.type
return args
class EventWithMultipleDevices(Event):
class ActionWithMultipleDevices(Action):
devices = relationship(Device,
backref=backref('events_multiple', lazy=True, **_sorted_events),
secondary=lambda: EventDevice.__table__,
backref=backref('actions_multiple', lazy=True, **_sorted_actions),
secondary=lambda: ActionDevice.__table__,
order_by=lambda: Device.id,
collection_class=OrderedSet)
@ -299,13 +299,13 @@ class EventWithMultipleDevices(Event):
return '<{0.t} {0.id} {0.severity} devices={0.devices!r}>'.format(self)
class EventDevice(db.Model):
class ActionDevice(db.Model):
device_id = Column(BigInteger, ForeignKey(Device.id), primary_key=True)
event_id = Column(UUID(as_uuid=True), ForeignKey(EventWithMultipleDevices.id),
primary_key=True)
action_id = Column(UUID(as_uuid=True), ForeignKey(ActionWithMultipleDevices.id),
primary_key=True)
class Add(EventWithOneDevice):
class Add(ActionWithOneDevice):
"""The act of adding components to a device.
It is usually used internally from a :class:`.Snapshot`, for
@ -313,7 +313,7 @@ class Add(EventWithOneDevice):
"""
class Remove(EventWithOneDevice):
class Remove(ActionWithOneDevice):
"""The act of removing components from a device.
It is usually used internally from a :class:`.Snapshot`, for
@ -321,20 +321,20 @@ class Remove(EventWithOneDevice):
"""
class Allocate(JoinedTableMixin, EventWithMultipleDevices):
class Allocate(JoinedTableMixin, ActionWithMultipleDevices):
to_id = Column(UUID, ForeignKey(User.id))
to = relationship(User, primaryjoin=User.id == to_id)
organization = Column(CIText())
class Deallocate(JoinedTableMixin, EventWithMultipleDevices):
class Deallocate(JoinedTableMixin, ActionWithMultipleDevices):
from_id = Column(UUID, ForeignKey(User.id))
from_rel = relationship(User, primaryjoin=User.id == from_id)
organization = Column(CIText())
class EraseBasic(JoinedWithOneDeviceMixin, EventWithOneDevice):
"""An erasure attempt to a ``DataStorage``. The event contains
class EraseBasic(JoinedWithOneDeviceMixin, ActionWithOneDevice):
"""An erasure attempt to a ``DataStorage``. The action contains
information about success and nature of the erasure.
EraseBasic is a software-based fast non-100%-secured way of
@ -409,10 +409,10 @@ class Step(db.Model):
num = Column(SmallInteger, primary_key=True)
severity = Column(teal.db.IntEnum(Severity), default=Severity.Info, nullable=False)
start_time = Column(db.TIMESTAMP(timezone=True), nullable=False)
start_time.comment = Event.start_time.comment
start_time.comment = Action.start_time.comment
end_time = Column(db.TIMESTAMP(timezone=True), CheckConstraint('end_time > start_time'),
nullable=False)
end_time.comment = Event.end_time.comment
end_time.comment = Action.end_time.comment
erasure = relationship(EraseBasic,
backref=backref('steps',
@ -453,7 +453,7 @@ class StepRandom(Step):
pass
class Snapshot(JoinedWithOneDeviceMixin, EventWithOneDevice):
class Snapshot(JoinedWithOneDeviceMixin, ActionWithOneDevice):
"""The Snapshot sets the physical information of the device (S/N, model...)
and updates it with erasures, benchmarks, ratings, and tests; updates the
composition of its components (adding / removing them), and links tags
@ -488,11 +488,11 @@ class Snapshot(JoinedWithOneDeviceMixin, EventWithOneDevice):
**Snapshots from Workbench**
When processing a device from the Workbench, this one performs a Snapshot
and then performs more events (like testings, benchmarking...).
and then performs more actions (like testings, benchmarking...).
There are two ways of sending this information. In an async way,
this is, submitting events as soon as Workbench performs then, or
submitting only one Snapshot event with all the other events embedded.
this is, submitting actions as soon as Workbench performs then, or
submitting only one Snapshot action with all the other actions embedded.
**Asynced**
@ -502,42 +502,42 @@ class Snapshot(JoinedWithOneDeviceMixin, EventWithOneDevice):
1. In **T1**, WorkbenchServer (as the middleware from Workbench and
Devicehub) submits:
- A ``Snapshot`` event with the required information to **synchronize**
- A ``Snapshot`` action with the required information to **synchronize**
and **rate** the device. This is:
- Identification information about the device and components
(S/N, model, physical characteristics...)
- ``Tags`` in a ``tags`` property in the ``device``.
- ``Rate`` in an ``events`` property in the ``device``.
- ``Benchmarks`` in an ``events`` property in each ``component``
- ``Rate`` in an ``actions`` property in the ``device``.
- ``Benchmarks`` in an ``actions`` property in each ``component``
or ``device``.
- ``TestDataStorage`` as in ``Benchmarks``.
- An ordered set of **expected events**, defining which are the next
events that Workbench will perform to the device in ideal
- An ordered set of **expected actions**, defining which are the next
actions that Workbench will perform to the device in ideal
conditions (device doesn't fail, no Internet drop...).
Devicehub **syncs** the device with the database and perform the
``Benchmark``, the ``TestDataStorage``, and finally the ``Rate``.
This leaves the Snapshot **open** to wait for the next events
This leaves the Snapshot **open** to wait for the next actions
to come.
2. Assuming that we expect all events, in **T2**, WorkbenchServer
2. Assuming that we expect all actions, in **T2**, WorkbenchServer
submits a ``StressTest`` with a ``snapshot`` field containing the
ID of the Snapshot in 1, and Devicehub links the event with such
ID of the Snapshot in 1, and Devicehub links the action with such
``Snapshot``.
3. In **T3**, WorkbenchServer submits the ``Erase`` with the ``Snapshot``
and ``component`` IDs from 1, linking it to them. It repeats
this for all the erased data storage devices; **T3+Tn** being
*n* the erased data storage devices.
4. WorkbenchServer does like in 3. but for the event ``Install``,
4. WorkbenchServer does like in 3. but for the action ``Install``,
finishing in **T3+Tn+Tx**, being *x* the number of data storage
devices with an OS installed into.
5. In **T3+Tn+Tx**, when all *expected events* have been performed,
5. In **T3+Tn+Tx**, when all *expected actions* have been performed,
Devicehub **closes** the ``Snapshot`` from 1.
**Synced**
Optionally, Devicehub understands receiving a ``Snapshot`` with all
the events in an ``events`` property inside each affected ``component``
the actions in an ``actions`` property inside each affected ``component``
or ``device``.
"""
uuid = Column(UUID(as_uuid=True), unique=True)
@ -548,13 +548,12 @@ class Snapshot(JoinedWithOneDeviceMixin, EventWithOneDevice):
For Snapshots made with Workbench, the total amount of time
it took to complete.
"""
expected_events = Column(ArrayOfEnum(DBEnum(SnapshotExpectedEvents)))
def __str__(self) -> str:
return '{}. {} version {}.'.format(self.severity, self.software, self.version)
class Install(JoinedWithOneDeviceMixin, EventWithOneDevice):
class Install(JoinedWithOneDeviceMixin, ActionWithOneDevice):
"""The action of installing an Operative System to a data
storage unit.
"""
@ -572,7 +571,7 @@ class SnapshotRequest(db.Model):
cascade=CASCADE_OWN))
class Benchmark(JoinedWithOneDeviceMixin, EventWithOneDevice):
class Benchmark(JoinedWithOneDeviceMixin, ActionWithOneDevice):
"""The act of gauging the performance of a device."""
elapsed = Column(Interval)
@ -644,7 +643,7 @@ class BenchmarkGraphicCard(BenchmarkWithRate):
pass
class Test(JoinedWithOneDeviceMixin, EventWithOneDevice):
class Test(JoinedWithOneDeviceMixin, ActionWithOneDevice):
"""The act of testing the physical condition of a device and its
components.
@ -860,7 +859,7 @@ class VisualTest(TestMixin, Test):
)
class Rate(JoinedWithOneDeviceMixin, EventWithOneDevice):
class Rate(JoinedWithOneDeviceMixin, ActionWithOneDevice):
"""The act of computing a rate based on different categories"""
# todo jn: explain in each comment what the rate considers.
N = 2
@ -1008,7 +1007,7 @@ class RateComputer(RateMixin, Rate):
"""
The act of compute general computer rate
"""
from ereuse_devicehub.resources.event.rate.workbench.v1_0 import rate_algorithm
from ereuse_devicehub.resources.action.rate.workbench.v1_0 import rate_algorithm
rate = rate_algorithm.compute(device)
price = None
with suppress(InvalidRangeForPrice): # We will have exception if range == VERY_LOW
@ -1016,14 +1015,14 @@ class RateComputer(RateMixin, Rate):
return rate, price
class Price(JoinedWithOneDeviceMixin, EventWithOneDevice):
class Price(JoinedWithOneDeviceMixin, ActionWithOneDevice):
"""The act of setting a trading price for the device.
This does not imply that the device is ultimately traded for that
price. Use the :class:`.Sell` for that.
Devicehub automatically computes a price from ``AggregateRating``
events. As in a **Rate**, price can have **software** and **version**,
actions. As in a **Rate**, price can have **software** and **version**,
and there is an **official** price that is used to automatically
compute the price from an ``AggregateRating``. Only the official price
is computed from an ``AggregateRating``.
@ -1174,11 +1173,11 @@ class EreusePrice(Price):
return self.Service(self.device, self.rating.rating_range, role, self.price)
class ToRepair(EventWithMultipleDevices):
class ToRepair(ActionWithMultipleDevices):
"""Select a device to be repaired."""
class Repair(EventWithMultipleDevices):
class Repair(ActionWithMultipleDevices):
"""Repair is the act of performing reparations.
If a repair without an error is performed,
@ -1186,41 +1185,41 @@ class Repair(EventWithMultipleDevices):
"""
class ReadyToUse(EventWithMultipleDevices):
class ReadyToUse(ActionWithMultipleDevices):
"""The device is ready to be used.
This involves greater preparation from the ``Prepare`` event,
and users should only use a device after this event is performed.
This involves greater preparation from the ``Prepare`` action,
and users should only use a device after this action is performed.
Users usually require devices with this event before shipping them
Users usually require devices with this action before shipping them
to costumers.
"""
class ToPrepare(EventWithMultipleDevices):
class ToPrepare(ActionWithMultipleDevices):
"""The device has been selected for preparation.
See Prepare for more info.
Usually **ToPrepare** is the next event done after registering the
Usually **ToPrepare** is the next action done after registering the
device.
"""
pass
class Prepare(EventWithMultipleDevices):
class Prepare(ActionWithMultipleDevices):
"""Work has been performed to the device to a defined point of
acceptance.
Users using this event have to agree what is this point
Users using this action have to agree what is this point
of acceptance; for some is when the device just works, for others
when some testing has been performed.
"""
class Live(JoinedWithOneDeviceMixin, EventWithOneDevice):
class Live(JoinedWithOneDeviceMixin, ActionWithOneDevice):
"""A keep-alive from a device connected to the Internet with
information about its state (in the form of a ``Snapshot`` event)
information about its state (in the form of a ``Snapshot`` action)
and usage statistics.
"""
ip = Column(IP, nullable=False,
@ -1244,7 +1243,7 @@ class Live(JoinedWithOneDeviceMixin, EventWithOneDevice):
# todo testing
class Organize(JoinedTableMixin, EventWithMultipleDevices):
class Organize(JoinedTableMixin, ActionWithMultipleDevices):
"""The act of manipulating/administering/supervising/controlling
one or more devices.
"""
@ -1253,7 +1252,7 @@ class Organize(JoinedTableMixin, EventWithMultipleDevices):
class Reserve(Organize):
"""The act of reserving devices.
After this event is performed, the user is the **reservee** of the
After this action is performed, the user is the **reservee** of the
devices. There can only be one non-cancelled reservation for
a device, and a reservation can only have one reservee.
"""
@ -1263,14 +1262,14 @@ class CancelReservation(Organize):
"""The act of cancelling a reservation."""
class Trade(JoinedTableMixin, EventWithMultipleDevices):
class Trade(JoinedTableMixin, ActionWithMultipleDevices):
"""Trade actions log the political exchange of devices between users.
Every time a trade event is performed, the old user looses its
Every time a trade action is performed, the old user looses its
political possession, for example ownership, in favor of another
user.
Performing trade events changes the *Trading* state of the
Performing trade actions changes the *Trading* state of the
device :class:`ereuse_devicehub.resources.device.states.Trading`.
This class and its inheritors
@ -1297,7 +1296,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, **_sorted_events),
backref=backref('actions_to', lazy=True, **_sorted_actions),
primaryjoin=to_id == Agent.id)
to_comment = """
The agent that gets the device due this deal.
@ -1357,7 +1356,7 @@ class DisposeProduct(Trade):
# ``RecyclingCenter``.
class Receive(JoinedTableMixin, EventWithMultipleDevices):
class Receive(JoinedTableMixin, ActionWithMultipleDevices):
"""The act of physically taking delivery of a device.
The receiver confirms that the devices have arrived, and thus,
@ -1377,7 +1376,7 @@ class Receive(JoinedTableMixin, EventWithMultipleDevices):
default=ReceiverRole.Intermediary)
class Migrate(JoinedTableMixin, EventWithMultipleDevices):
class Migrate(JoinedTableMixin, ActionWithMultipleDevices):
"""Moves the devices to a new database/inventory. Devices cannot be
modified anymore at the previous database.
"""
@ -1398,52 +1397,52 @@ class MigrateFrom(Migrate):
# Listeners
# Listeners validate values and keep relationships synced
# The following listeners avoids setting values to events that
# The following listeners avoids setting values to actions that
# do not make sense. For example, EraseBasic to a graphic card.
@event.listens_for(TestDataStorage.device, Events.set.__name__, propagate=True)
@event.listens_for(Install.device, Events.set.__name__, propagate=True)
@event.listens_for(EraseBasic.device, Events.set.__name__, propagate=True)
def validate_device_is_data_storage(target: Event, value: DataStorage, old_value, initiator):
"""Validates that the device for data-storage events is effectively a data storage."""
def validate_device_is_data_storage(target: Action, value: DataStorage, old_value, initiator):
"""Validates that the device for data-storage actions is effectively a data storage."""
if value and not isinstance(value, DataStorage):
raise TypeError('{} must be a DataStorage but you passed {}'.format(initiator.impl, value))
@event.listens_for(BenchmarkRamSysbench.device, Events.set.__name__, propagate=True)
def events_not_for_components(target: Event, value: Device, old_value, initiator):
"""Validates events that cannot be performed to components."""
def actions_not_for_components(target: Action, value: Device, old_value, initiator):
"""Validates actions that cannot be performed to components."""
if isinstance(value, Component):
raise TypeError('{!r} cannot be performed to a component ({!r}).'.format(target, value))
# The following listeners keep relationships with device <-> components synced with the event
# So, if you add or remove devices from events these listeners will
# automatically add/remove the ``components`` and ``parent`` of such events
# The following listeners keep relationships with device <-> components synced with the action
# So, if you add or remove devices from actions these listeners will
# automatically add/remove the ``components`` and ``parent`` of such actions
# See the tests for examples
@event.listens_for(EventWithOneDevice.device, Events.set.__name__, propagate=True)
def update_components_event_one(target: EventWithOneDevice, device: Device, __, ___):
@event.listens_for(ActionWithOneDevice.device, Events.set.__name__, propagate=True)
def update_components_action_one(target: ActionWithOneDevice, device: Device, __, ___):
"""
Syncs the :attr:`.Event.components` with the components in
Syncs the :attr:`.Action.components` with the components in
:attr:`ereuse_devicehub.resources.device.models.Computer.components`.
"""
# For Add and Remove, ``components`` have different meanings
# see Event.components for more info
# see Action.components for more info
if not isinstance(target, (Add, Remove)):
target.components.clear()
if isinstance(device, Computer):
target.components |= device.components
@event.listens_for(EventWithMultipleDevices.devices, Events.init_collection.__name__,
@event.listens_for(ActionWithMultipleDevices.devices, Events.init_collection.__name__,
propagate=True)
@event.listens_for(EventWithMultipleDevices.devices, Events.bulk_replace.__name__, propagate=True)
@event.listens_for(EventWithMultipleDevices.devices, Events.append.__name__, propagate=True)
def update_components_event_multiple(target: EventWithMultipleDevices,
value: Union[Set[Device], Device], _):
@event.listens_for(ActionWithMultipleDevices.devices, Events.bulk_replace.__name__, propagate=True)
@event.listens_for(ActionWithMultipleDevices.devices, Events.append.__name__, propagate=True)
def update_components_action_multiple(target: ActionWithMultipleDevices,
value: Union[Set[Device], Device], _):
"""
Syncs the :attr:`.Event.components` with the components in
Syncs the :attr:`.Action.components` with the components in
:attr:`ereuse_devicehub.resources.device.models.Computer.components`.
"""
target.components.clear()
@ -1453,10 +1452,10 @@ def update_components_event_multiple(target: EventWithMultipleDevices,
target.components |= device.components
@event.listens_for(EventWithMultipleDevices.devices, Events.remove.__name__, propagate=True)
def remove_components_event_multiple(target: EventWithMultipleDevices, device: Device, __):
@event.listens_for(ActionWithMultipleDevices.devices, Events.remove.__name__, propagate=True)
def remove_components_action_multiple(target: ActionWithMultipleDevices, device: Device, __):
"""
Syncs the :attr:`.Event.components` with the components in
Syncs the :attr:`.Action.components` with the components in
:attr:`ereuse_devicehub.resources.device.models.Computer.components`.
"""
target.components.clear()
@ -1471,7 +1470,7 @@ def remove_components_event_multiple(target: EventWithMultipleDevices, device: D
@event.listens_for(Benchmark.device, Events.set.__name__, propagate=True)
def update_parent(target: Union[EraseBasic, Test, Install], device: Device, _, __):
"""
Syncs the :attr:`Event.parent` with the parent of the device.
Syncs the :attr:`Action.parent` with the parent of the device.
"""
target.parent = None
if isinstance(device, Component):

View File

@ -16,14 +16,14 @@ from teal.enums import Country
from ereuse_devicehub.resources.agent.models import Agent
from ereuse_devicehub.resources.device.models import Component, Computer, Device
from ereuse_devicehub.resources.enums import AppearanceRange, ErasureStandards, \
FunctionalityRange, PhysicalErasureMethod, PriceSoftware, RatingRange, \
ReceiverRole, Severity, SnapshotExpectedEvents, SnapshotSoftware, TestDataStorageLength
from ereuse_devicehub.resources.enums import AppearanceRange, BatteryHealth, ErasureStandards, \
FunctionalityRange, PhysicalErasureMethod, PriceSoftware, RatingRange, ReceiverRole, Severity, \
SnapshotSoftware, TestDataStorageLength
from ereuse_devicehub.resources.models import Thing
from ereuse_devicehub.resources.user.models import User
class Event(Thing):
class Action(Thing):
id = ... # type: Column
name = ... # type: Column
type = ... # type: Column
@ -74,13 +74,13 @@ class Event(Thing):
return '{:%c}'.format(self.end_time or self.created)
class EventWithOneDevice(Event):
class ActionWithOneDevice(Action):
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self.device = ... # type: Device
class EventWithMultipleDevices(Event):
class ActionWithMultipleDevices(Action):
devices = ... # type: relationship
def __init__(self, **kwargs) -> None:
@ -88,11 +88,11 @@ class EventWithMultipleDevices(Event):
self.devices = ... # type: Set[Device]
class Add(EventWithOneDevice):
class Add(ActionWithOneDevice):
pass
class Remove(EventWithOneDevice):
class Remove(ActionWithOneDevice):
pass
@ -122,7 +122,7 @@ class StepRandom(Step):
pass
class EraseBasic(EventWithOneDevice):
class EraseBasic(ActionWithOneDevice):
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self.start_time = ... # type: datetime
@ -153,7 +153,7 @@ class ErasePhysical(EraseBasic):
self.method = ... # type: PhysicalErasureMethod
class Snapshot(EventWithOneDevice):
class Snapshot(ActionWithOneDevice):
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self.uuid = ... # type: UUID
@ -161,11 +161,10 @@ class Snapshot(EventWithOneDevice):
self.software = ... # type: SnapshotSoftware
self.elapsed = ... # type: timedelta
self.device = ... # type: Computer
self.events = ... # type: Set[Event]
self.expected_events = ... # type: List[SnapshotExpectedEvents]
self.actions = ... # type: Set[Action]
class Install(EventWithOneDevice):
class Install(ActionWithOneDevice):
name = ... # type: Column
elapsed = ... # type: Column
address = ... # type: Column
@ -184,7 +183,7 @@ class SnapshotRequest(Model):
self.snapshot = ... # type: Snapshot
class Benchmark(EventWithOneDevice):
class Benchmark(ActionWithOneDevice):
pass
@ -222,7 +221,7 @@ class BenchmarkGraphicCard(BenchmarkWithRate):
pass
class Test(EventWithOneDevice):
class Test(ActionWithOneDevice):
elapsed = ... # type: Column
def __init__(self, **kwargs) -> None:
@ -231,6 +230,20 @@ class Test(EventWithOneDevice):
self.success = ... # type: bool
class MeasureBattery(Test):
size = ... # type: Column
voltage = ... # type: Column
cycle_count = ... # type: Column
health = ... # type: Column
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self.size = ... # type: int
self.voltage = ... # type: int
self.cycle_count = ... # type: Optional[int]
self.health = ... # type: Optional[BatteryHealth]
class TestDataStorage(Test):
length = ... # type: Column
status = ... # type: Column
@ -309,12 +322,12 @@ class VisualTest(Test):
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self.appearance_range = ... # type: AppearanceRange
self.functionality_range = ... # type: FunctionalityRange
self.labelling = ... # type: Optional[bool]
self.appearance_range = ... # type: AppearanceRange
self.functionality_range = ... # type: FunctionalityRange
self.labelling = ... # type: Optional[bool]
class Rate(EventWithOneDevice):
class Rate(ActionWithOneDevice):
N = 2
_rating = ... # type: Column
_appearance = ... # type: Column
@ -367,7 +380,7 @@ class RateComputer(Rate):
pass
class Price(EventWithOneDevice):
class Price(ActionWithOneDevice):
SCALE = ...
ROUND = ...
currency = ... # type: Column
@ -413,27 +426,27 @@ class EreusePrice(Price):
self.warranty2 = ... # type: float
class ToRepair(EventWithMultipleDevices):
class ToRepair(ActionWithMultipleDevices):
pass
class Repair(EventWithMultipleDevices):
class Repair(ActionWithMultipleDevices):
pass
class ReadyToUse(EventWithMultipleDevices):
class ReadyToUse(ActionWithMultipleDevices):
pass
class ToPrepare(EventWithMultipleDevices):
class ToPrepare(ActionWithMultipleDevices):
pass
class Prepare(EventWithMultipleDevices):
class Prepare(ActionWithMultipleDevices):
pass
class Live(EventWithOneDevice):
class Live(ActionWithOneDevice):
ip = ... # type: Column
subdivision_confidence = ... # type: Column
subdivision = ... # type: Column
@ -456,7 +469,7 @@ class Live(EventWithOneDevice):
self.country = ... # type: Country
class Organize(EventWithMultipleDevices):
class Organize(ActionWithMultipleDevices):
pass
@ -464,7 +477,7 @@ class Reserve(Organize):
pass
class Trade(EventWithMultipleDevices):
class Trade(ActionWithMultipleDevices):
shipping_date = ... # type: Column
invoice_number = ... # type: Column
price = ... # type: relationship
@ -504,7 +517,7 @@ class DisposeProduct(Trade):
pass
class Receive(EventWithMultipleDevices):
class Receive(ActionWithMultipleDevices):
role = ... # type:Column
def __init__(self, **kwargs) -> None:
@ -512,7 +525,7 @@ class Receive(EventWithMultipleDevices):
self.role = ... # type: ReceiverRole
class Migrate(EventWithMultipleDevices):
class Migrate(ActionWithMultipleDevices):
other = ... # type: Column
def __init__(self, **kwargs) -> None:

View File

@ -2,18 +2,18 @@ from enum import Enum, unique
from itertools import groupby
from typing import Dict, Iterable, Tuple
from ereuse_devicehub.resources.action.models import BenchmarkDataStorage, BenchmarkProcessor, \
BenchmarkProcessorSysbench, RateComputer, VisualTest
from ereuse_devicehub.resources.action.rate.rate import BaseRate
from ereuse_devicehub.resources.device.models import Computer, DataStorage, Processor, \
RamModule
from ereuse_devicehub.resources.event.models import BenchmarkDataStorage, BenchmarkProcessor, \
BenchmarkProcessorSysbench, RateComputer, VisualTest
from ereuse_devicehub.resources.event.rate.rate import BaseRate
class RateAlgorithm(BaseRate):
"""The algorithm that generates the Rate v1.0.
Do not call directly this class, but use
:meth:`ereuse_devicehub.resources.event.models.RateComputer.compute`,
:meth:`ereuse_devicehub.resources.action.models.RateComputer.compute`,
which then calls this.
"""
@ -44,13 +44,13 @@ class RateAlgorithm(BaseRate):
def compute(self, device: Computer) -> RateComputer:
"""Generates a new
:class:`ereuse_devicehub.resources.event.models.RateComputer`
:class:`ereuse_devicehub.resources.action.models.RateComputer`
for the passed-in device.
"""
assert isinstance(device, Computer), 'Can only rate computers'
try:
visual_test = device.last_event_of(VisualTest)
visual_test = device.last_action_of(VisualTest)
except LookupError:
raise CannotRate('You need a visual test.')
@ -73,7 +73,7 @@ class RateAlgorithm(BaseRate):
rate.appearance = self.Appearance[visual_test.appearance_range.name].value
rate.functionality = self.Functionality[visual_test.functionality_range.name].value
rate.rating = rate_components + rate.functionality + rate.appearance
device.events_one.add(rate)
device.actions_one.add(rate)
assert 0 <= rate.rating <= 4.7, 'Rate ranges from 0 to 4.7'
return rate
@ -100,7 +100,7 @@ class ProcessorRate(BaseRate):
cores = processor.cores or self.DEFAULT_CORES
speed = processor.speed or self.DEFAULT_SPEED
benchmark_cpu = next(
e for e in reversed(processor.events)
e for e in reversed(processor.actions)
if isinstance(e, BenchmarkProcessor) and not isinstance(e, BenchmarkProcessorSysbench)
)
benchmark_cpu = benchmark_cpu.rate or self.DEFAULT_SCORE
@ -203,7 +203,7 @@ class DataStorageRate(BaseRate):
# STEP: Filtering, data cleaning and merging of component parts
for storage in data_storage_devices:
# We assume all hdd snapshots have BenchmarkDataStorage
benchmark = storage.last_event_of(BenchmarkDataStorage)
benchmark = storage.last_action_of(BenchmarkDataStorage)
# prevent NULL values
_size = storage.size or 0
size += _size

View File

@ -1,6 +1,6 @@
from flask import current_app as app
from marshmallow import Schema as MarshmallowSchema, ValidationError, fields as f, validates_schema
from marshmallow.fields import Boolean, DateTime, Decimal, Float, Integer, List, Nested, String, \
from marshmallow.fields import Boolean, DateTime, Decimal, Float, Integer, Nested, String, \
TimeDelta, UUID
from marshmallow.validate import Length, OneOf, Range
from sqlalchemy.util import OrderedSet
@ -10,55 +10,55 @@ from teal.resource import Schema
from ereuse_devicehub.marshmallow import NestedOn
from ereuse_devicehub.resources import enums
from ereuse_devicehub.resources.action import models as m
from ereuse_devicehub.resources.agent import schemas as s_agent
from ereuse_devicehub.resources.device import schemas as s_device
from ereuse_devicehub.resources.enums import AppearanceRange, BiosAccessRange, FunctionalityRange, \
PhysicalErasureMethod, R_POSITIVE, RatingRange, ReceiverRole, \
Severity, SnapshotExpectedEvents, SnapshotSoftware, TestDataStorageLength
from ereuse_devicehub.resources.event import models as m
Severity, SnapshotSoftware, TestDataStorageLength
from ereuse_devicehub.resources.models import STR_BIG_SIZE, STR_SIZE
from ereuse_devicehub.resources.schemas import Thing
from ereuse_devicehub.resources.user import schemas as s_user
class Event(Thing):
__doc__ = m.Event.__doc__
class Action(Thing):
__doc__ = m.Action.__doc__
id = UUID(dump_only=True)
name = SanitizedStr(default='',
validate=Length(max=STR_BIG_SIZE),
description=m.Event.name.comment)
closed = Boolean(missing=True, description=m.Event.closed.comment)
severity = EnumField(Severity, description=m.Event.severity.comment)
description = SanitizedStr(default='', description=m.Event.description.comment)
start_time = DateTime(data_key='startTime', description=m.Event.start_time.comment)
end_time = DateTime(data_key='endTime', description=m.Event.end_time.comment)
description=m.Action.name.comment)
closed = Boolean(missing=True, description=m.Action.closed.comment)
severity = EnumField(Severity, description=m.Action.severity.comment)
description = SanitizedStr(default='', description=m.Action.description.comment)
start_time = DateTime(data_key='startTime', description=m.Action.start_time.comment)
end_time = DateTime(data_key='endTime', description=m.Action.end_time.comment)
snapshot = NestedOn('Snapshot', dump_only=True)
agent = NestedOn(s_agent.Agent, description=m.Event.agent_id.comment)
agent = NestedOn(s_agent.Agent, description=m.Action.agent_id.comment)
author = NestedOn(s_user.User, dump_only=True, exclude=('token',))
components = NestedOn(s_device.Component, dump_only=True, many=True)
parent = NestedOn(s_device.Computer, dump_only=True, description=m.Event.parent_id.comment)
url = URL(dump_only=True, description=m.Event.url.__doc__)
parent = NestedOn(s_device.Computer, dump_only=True, description=m.Action.parent_id.comment)
url = URL(dump_only=True, description=m.Action.url.__doc__)
class EventWithOneDevice(Event):
__doc__ = m.EventWithOneDevice.__doc__
class ActionWithOneDevice(Action):
__doc__ = m.ActionWithOneDevice.__doc__
device = NestedOn(s_device.Device, only_query='id')
class EventWithMultipleDevices(Event):
__doc__ = m.EventWithMultipleDevices.__doc__
class ActionWithMultipleDevices(Action):
__doc__ = m.ActionWithMultipleDevices.__doc__
devices = NestedOn(s_device.Device, many=True, only_query='id', collection_class=OrderedSet)
class Add(EventWithOneDevice):
class Add(ActionWithOneDevice):
__doc__ = m.Add.__doc__
class Remove(EventWithOneDevice):
class Remove(ActionWithOneDevice):
__doc__ = m.Remove.__doc__
class Allocate(EventWithMultipleDevices):
class Allocate(ActionWithMultipleDevices):
__doc__ = m.Allocate.__doc__
to = NestedOn(s_user.User,
description='The user the devices are allocated to.')
@ -67,7 +67,7 @@ class Allocate(EventWithMultipleDevices):
'user was when this happened.')
class Deallocate(EventWithMultipleDevices):
class Deallocate(ActionWithMultipleDevices):
__doc__ = m.Deallocate.__doc__
from_rel = Nested(s_user.User,
data_key='from',
@ -77,7 +77,7 @@ class Deallocate(EventWithMultipleDevices):
'user was when this happened.')
class EraseBasic(EventWithOneDevice):
class EraseBasic(ActionWithOneDevice):
__doc__ = m.EraseBasic.__doc__
steps = NestedOn('Step', many=True)
standards = f.List(EnumField(enums.ErasureStandards), dump_only=True)
@ -98,7 +98,7 @@ class Step(Schema):
type = String(description='Only required when it is nested.')
start_time = DateTime(required=True, data_key='startTime')
end_time = DateTime(required=True, data_key='endTime')
severity = EnumField(Severity, description=m.Event.severity.comment)
severity = EnumField(Severity, description=m.Action.severity.comment)
class StepZero(Step):
@ -109,7 +109,7 @@ class StepRandom(Step):
__doc__ = m.StepRandom.__doc__
class Benchmark(EventWithOneDevice):
class Benchmark(ActionWithOneDevice):
__doc__ = m.Benchmark.__doc__
elapsed = TimeDelta(precision=TimeDelta.SECONDS, required=True)
@ -141,7 +141,7 @@ class BenchmarkGraphicCard(BenchmarkWithRate):
__doc__ = m.BenchmarkGraphicCard.__doc__
class Test(EventWithOneDevice):
class Test(ActionWithOneDevice):
__doc__ = m.Test.__doc__
@ -211,7 +211,7 @@ class VisualTest(Test):
labelling = Boolean()
class Rate(EventWithOneDevice):
class Rate(ActionWithOneDevice):
__doc__ = m.Rate.__doc__
rating = Integer(validate=Range(*R_POSITIVE),
dump_only=True,
@ -243,7 +243,7 @@ class RateComputer(Rate):
graphic_card_range = EnumField(RatingRange, dump_only=True, data_key='graphicCardRange')
class Price(EventWithOneDevice):
class Price(ActionWithOneDevice):
__doc__ = m.Price.__doc__
currency = EnumField(Currency, required=True, description=m.Price.currency.comment)
price = Decimal(places=m.Price.SCALE,
@ -271,7 +271,7 @@ class EreusePrice(Price):
platform = Nested(Service)
class Install(EventWithOneDevice):
class Install(ActionWithOneDevice):
__doc__ = m.Install.__doc__
name = SanitizedStr(validate=Length(min=4, max=STR_BIG_SIZE),
required=True,
@ -280,11 +280,11 @@ class Install(EventWithOneDevice):
address = Integer(validate=OneOf({8, 16, 32, 64, 128, 256}))
class Snapshot(EventWithOneDevice):
class Snapshot(ActionWithOneDevice):
__doc__ = m.Snapshot.__doc__
"""
The Snapshot updates the state of the device with information about
its components and events performed at them.
its components and actions performed at them.
See docs for more info.
"""
@ -293,13 +293,7 @@ class Snapshot(EventWithOneDevice):
required=True,
description='The software that generated this Snapshot.')
version = Version(required=True, description='The version of the software.')
events = NestedOn(Event, many=True, dump_only=True)
expected_events = List(EnumField(SnapshotExpectedEvents),
data_key='expectedEvents',
description='Keep open this Snapshot until the following events'
'are performed. Setting this value will activate'
'the async Snapshot.')
actions = NestedOn(Action, many=True, dump_only=True)
elapsed = TimeDelta(precision=TimeDelta.SECONDS)
components = NestedOn(s_device.Component,
many=True,
@ -345,27 +339,27 @@ class Snapshot(EventWithOneDevice):
field_names=['elapsed'])
class ToRepair(EventWithMultipleDevices):
class ToRepair(ActionWithMultipleDevices):
__doc__ = m.ToRepair.__doc__
class Repair(EventWithMultipleDevices):
class Repair(ActionWithMultipleDevices):
__doc__ = m.Repair.__doc__
class ReadyToUse(EventWithMultipleDevices):
class ReadyToUse(ActionWithMultipleDevices):
__doc__ = m.ReadyToUse.__doc__
class ToPrepare(EventWithMultipleDevices):
class ToPrepare(ActionWithMultipleDevices):
__doc__ = m.ToPrepare.__doc__
class Prepare(EventWithMultipleDevices):
class Prepare(ActionWithMultipleDevices):
__doc__ = m.Prepare.__doc__
class Live(EventWithOneDevice):
class Live(ActionWithOneDevice):
__doc__ = m.Live.__doc__
ip = IP(dump_only=True)
subdivision_confidence = Integer(dump_only=True, data_key='subdivisionConfidence')
@ -378,7 +372,7 @@ class Live(EventWithOneDevice):
organization_type = SanitizedStr(lower=True, dump_only=True, data_key='organizationType')
class Organize(EventWithMultipleDevices):
class Organize(ActionWithMultipleDevices):
__doc__ = m.Organize.__doc__
@ -390,7 +384,7 @@ class CancelReservation(Organize):
__doc__ = m.CancelReservation.__doc__
class Trade(EventWithMultipleDevices):
class Trade(ActionWithMultipleDevices):
__doc__ = m.Trade.__doc__
shipping_date = DateTime(data_key='shippingDate')
invoice_number = SanitizedStr(validate=Length(max=STR_SIZE), data_key='invoiceNumber')
@ -423,12 +417,12 @@ class DisposeProduct(Trade):
__doc__ = m.DisposeProduct.__doc__
class Receive(EventWithMultipleDevices):
class Receive(ActionWithMultipleDevices):
__doc__ = m.Receive.__doc__
role = EnumField(ReceiverRole)
class Migrate(EventWithMultipleDevices):
class Migrate(ActionWithMultipleDevices):
__doc__ = m.Migrate.__doc__
other = URL()

View File

@ -8,39 +8,39 @@ from teal.marshmallow import ValidationError
from teal.resource import View
from ereuse_devicehub.db import db
from ereuse_devicehub.resources.action.models import Action, RateComputer, Snapshot
from ereuse_devicehub.resources.action.rate.workbench.v1_0 import CannotRate
from ereuse_devicehub.resources.device.models import Component, Computer
from ereuse_devicehub.resources.enums import SnapshotSoftware
from ereuse_devicehub.resources.event.models import Event, RateComputer, Snapshot
from ereuse_devicehub.resources.event.rate.workbench.v1_0 import CannotRate
SUPPORTED_WORKBENCH = StrictVersion('11.0')
class EventView(View):
class ActionView(View):
def post(self):
"""Posts an event."""
"""Posts an action."""
json = request.get_json(validate=False)
if not json or 'type' not in json:
raise ValidationError('Resource needs a type.')
# todo there should be a way to better get subclassess resource
# defs
resource_def = app.resources[json['type']]
e = resource_def.schema.load(json)
a = resource_def.schema.load(json)
if json['type'] == Snapshot.t:
return self.snapshot(e, resource_def)
return self.snapshot(a, resource_def)
Model = db.Model._decl_class_registry.data[json['type']]()
event = Model(**e)
db.session.add(event)
action = Model(**a)
db.session.add(action)
db.session().final_flush()
ret = self.schema.jsonify(event)
ret = self.schema.jsonify(action)
ret.status_code = 201
db.session.commit()
return ret
def one(self, id: UUID):
"""Gets one event."""
event = Event.query.filter_by(id=id).one()
return self.schema.jsonify(event)
"""Gets one action."""
action = Action.query.filter_by(id=id).one()
return self.schema.jsonify(action)
def snapshot(self, snapshot_json: dict, resource_def):
"""
@ -57,30 +57,30 @@ class EventView(View):
components = snapshot_json.pop('components') # type: List[Component]
snapshot = Snapshot(**snapshot_json)
# Remove new events from devices so they don't interfere with sync
events_device = set(e for e in device.events_one)
device.events_one.clear()
# Remove new actions from devices so they don't interfere with sync
actions_device = set(e for e in device.actions_one)
device.actions_one.clear()
if components:
events_components = tuple(set(e for e in c.events_one) for c in components)
actions_components = tuple(set(e for e in c.actions_one) for c in components)
for component in components:
component.events_one.clear()
component.actions_one.clear()
assert not device.events_one
assert all(not c.events_one for c in components) if components else True
db_device, remove_events = resource_def.sync.run(device, components)
assert not device.actions_one
assert all(not c.actions_one for c in components) if components else True
db_device, remove_actions = resource_def.sync.run(device, components)
del device # Do not use device anymore
snapshot.device = db_device
snapshot.events |= remove_events | events_device # Set events to snapshot
snapshot.actions |= remove_actions | actions_device # Set actions to snapshot
# commit will change the order of the components by what
# the DB wants. Let's get a copy of the list so we preserve order
ordered_components = OrderedSet(x for x in snapshot.components)
# Add the new events to the db-existing devices and components
db_device.events_one |= events_device
# Add the new actions to the db-existing devices and components
db_device.actions_one |= actions_device
if components:
for component, events in zip(ordered_components, events_components):
component.events_one |= events
snapshot.events |= events
for component, actions in zip(ordered_components, actions_components):
component.actions_one |= actions
snapshot.actions |= actions
# Compute ratings
if snapshot.software == SnapshotSoftware.Workbench:
@ -89,9 +89,9 @@ class EventView(View):
except CannotRate:
pass
else:
snapshot.events.add(rate_computer)
snapshot.actions.add(rate_computer)
if price:
snapshot.events.add(price)
snapshot.actions.add(price)
db.session.add(snapshot)
db.session().final_flush()

View File

@ -67,9 +67,9 @@ class Agent(Thing):
return args
@property
def events(self) -> list:
def actions(self) -> list:
# todo test
return sorted(chain(self.events_agent, self.events_to), key=attrgetter('created'))
return sorted(chain(self.actions_agent, self.actions_to), key=attrgetter('created'))
@validates('name')
def does_not_contain_slash(self, _, value: str):

View File

@ -6,7 +6,7 @@ from sqlalchemy.orm import relationship
from sqlalchemy_utils import PhoneNumber
from teal import enums
from ereuse_devicehub.resources.event.models import Event, Trade
from ereuse_devicehub.resources.action.models import Action, Trade
from ereuse_devicehub.resources.models import Thing
from ereuse_devicehub.resources.tag.model import Tag
from ereuse_devicehub.resources.user import User
@ -28,11 +28,11 @@ class Agent(Thing):
self.country = ... # type: enums.Country
self.telephone = ... # type: PhoneNumber
self.email = ... # type: str
self.events_agent = ... # type: Set[Event] # Ordered
self.events_to = ... # type: Set[Trade] # Ordered
self.actions_agent = ... # type: Set[Action] # Ordered
self.actions_to = ... # type: Set[Trade] # Ordered
@property
def events(self) -> List[Event]:
def actions(self) -> List[Action]:
pass

View File

@ -138,35 +138,35 @@ class Device(Thing):
self.hid = Naming.hid(self.type, self.manufacturer, self.model, self.serial_number)
@property
def events(self) -> list:
def actions(self) -> list:
"""
All the events where the device participated, including:
All the actions where the device participated, including:
1. Events performed directly to the device.
2. Events performed to a component.
3. Events performed to a parent device.
1. Actions performed directly to the device.
2. Actions performed to a component.
3. Actions performed to a parent device.
Events are returned by descending ``created`` time.
Actions are returned by descending ``created`` time.
"""
return sorted(chain(self.events_multiple, self.events_one))
return sorted(chain(self.actions_multiple, self.actions_one))
@property
def problems(self):
"""Current events with severity.Warning or higher.
"""Current actions with severity.Warning or higher.
There can be up to 3 events: current Snapshot,
current Physical event, current Trading event.
There can be up to 3 actions: current Snapshot,
current Physical action, current Trading action.
"""
from ereuse_devicehub.resources.device import states
from ereuse_devicehub.resources.event.models import Snapshot
events = set()
from ereuse_devicehub.resources.action.models import Snapshot
actions = set()
with suppress(LookupError, ValueError):
events.add(self.last_event_of(Snapshot))
actions.add(self.last_action_of(Snapshot))
with suppress(LookupError, ValueError):
events.add(self.last_event_of(*states.Physical.events()))
actions.add(self.last_action_of(*states.Physical.actions()))
with suppress(LookupError, ValueError):
events.add(self.last_event_of(*states.Trading.events()))
return self._warning_events(events)
actions.add(self.last_action_of(*states.Trading.actions()))
return self._warning_actions(actions)
@property
def physical_properties(self) -> Dict[str, object or None]:
@ -194,33 +194,33 @@ class Device(Thing):
def rate(self):
"""The last Rate of the device."""
with suppress(LookupError, ValueError):
from ereuse_devicehub.resources.event.models import Rate
return self.last_event_of(Rate)
from ereuse_devicehub.resources.action.models import Rate
return self.last_action_of(Rate)
@property
def price(self):
"""The actual Price of the device, or None if no price has
ever been set."""
with suppress(LookupError, ValueError):
from ereuse_devicehub.resources.event.models import Price
return self.last_event_of(Price)
from ereuse_devicehub.resources.action.models import Price
return self.last_action_of(Price)
@property
def trading(self):
"""The actual trading state, or None if no Trade event has
"""The actual trading state, or None if no Trade action has
ever been performed to this device."""
from ereuse_devicehub.resources.device import states
with suppress(LookupError, ValueError):
event = self.last_event_of(*states.Trading.events())
return states.Trading(event.__class__)
action = self.last_action_of(*states.Trading.actions())
return states.Trading(action.__class__)
@property
def physical(self):
"""The actual physical state, None otherwise."""
from ereuse_devicehub.resources.device import states
with suppress(LookupError, ValueError):
event = self.last_event_of(*states.Physical.events())
return states.Physical(event.__class__)
action = self.last_action_of(*states.Physical.actions())
return states.Physical(action.__class__)
@property
def physical_possessor(self):
@ -235,13 +235,13 @@ class Device(Thing):
own it legally.
Note that there can only be one physical possessor per device,
and :class:`ereuse_devicehub.resources.event.models.Receive`
and :class:`ereuse_devicehub.resources.action.models.Receive`
changes it.
"""
from ereuse_devicehub.resources.event.models import Receive
from ereuse_devicehub.resources.action.models import Receive
with suppress(LookupError):
event = self.last_event_of(Receive)
return event.agent
action = self.last_action_of(Receive)
return action.agent
@property
def working(self):
@ -252,10 +252,10 @@ class Device(Thing):
the one with the worst ``severity`` of them, or ``None`` if no
test has been executed.
"""
from ereuse_devicehub.resources.event.models import Test
current_tests = unique_everseen((e for e in reversed(self.events) if isinstance(e, Test)),
from ereuse_devicehub.resources.action.models import Test
current_tests = unique_everseen((e for e in reversed(self.actions) if isinstance(e, Test)),
key=attrgetter('type')) # last test of each type
return self._warning_events(current_tests)
return self._warning_actions(current_tests)
@declared_attr
def __mapper_args__(cls):
@ -271,19 +271,19 @@ class Device(Thing):
args[POLYMORPHIC_ON] = cls.type
return args
def last_event_of(self, *types):
"""Gets the last event of the given types.
def last_action_of(self, *types):
"""Gets the last action of the given types.
:raise LookupError: Device has not an event of the given type.
:raise LookupError: Device has not an action of the given type.
"""
try:
# noinspection PyTypeHints
return next(e for e in reversed(self.events) if isinstance(e, types))
return next(e for e in reversed(self.actions) if isinstance(e, types))
except StopIteration:
raise LookupError('{!r} does not contain events of types {}.'.format(self, types))
raise LookupError('{!r} does not contain actions of types {}.'.format(self, types))
def _warning_events(self, events):
return sorted(ev for ev in events if ev.severity >= Severity.Warning)
def _warning_actions(self, actions):
return sorted(ev for ev in actions if ev.severity >= Severity.Warning)
def __lt__(self, other):
return self.id < other.id
@ -389,8 +389,8 @@ class Computer(Device):
super().__init__(chassis=chassis, **kwargs)
@property
def events(self) -> list:
return sorted(chain(super().events, self.events_parent))
def actions(self) -> list:
return sorted(chain(super().actions, self.actions_parent))
@property
def ram_size(self) -> int:
@ -561,8 +561,8 @@ class Component(Device):
return component
@property
def events(self) -> list:
return sorted(chain(super().events, self.events_components))
def actions(self) -> list:
return sorted(chain(super().actions, self.actions_components))
class JoinedComponentTableMixin:
@ -592,9 +592,9 @@ class DataStorage(JoinedComponentTableMixin, Component):
This is, the last erasure performed to the data storage.
"""
from ereuse_devicehub.resources.event.models import EraseBasic
from ereuse_devicehub.resources.action.models import EraseBasic
try:
ev = self.last_event_of(EraseBasic)
ev = self.last_action_of(EraseBasic)
except LookupError:
ev = None
return ev
@ -698,8 +698,8 @@ class Battery(JoinedComponentTableMixin, Component):
@property
def capacity(self) -> float:
"""The quantity of """
from ereuse_devicehub.resources.event.models import MeasureBattery
real_size = self.last_event_of(MeasureBattery).size
from ereuse_devicehub.resources.action.models import MeasureBattery
real_size = self.last_action_of(MeasureBattery).size
return real_size / self.size if real_size and self.size else None

View File

@ -11,21 +11,21 @@ from sqlalchemy.orm import relationship
from teal.db import Model
from teal.enums import Layouts
from ereuse_devicehub.resources.action import models as e
from ereuse_devicehub.resources.agent.models import Agent
from ereuse_devicehub.resources.device import states
from ereuse_devicehub.resources.enums import BatteryTechnology, ComputerChassis, \
DataStorageInterface, DisplayTech, PrinterTechnology, RamFormat, RamInterface
from ereuse_devicehub.resources.event import models as e
from ereuse_devicehub.resources.lot.models import Lot
from ereuse_devicehub.resources.models import Thing
from ereuse_devicehub.resources.tag import Tag
from ereuse_devicehub.resources.tag.model import Tags
E = TypeVar('E', bound=e.Event)
E = TypeVar('E', bound=e.Action)
class Device(Thing):
EVENT_SORT_KEY = attrgetter('created')
ACTION_SORT_KEY = attrgetter('created')
id = ... # type: Column
type = ... # type: Column
@ -58,8 +58,8 @@ class Device(Thing):
self.depth = ... # type: Optional[float]
self.color = ... # type: Optional[Color]
self.physical_properties = ... # type: Dict[str, object or None]
self.events_multiple = ... # type: Set[e.EventWithMultipleDevices]
self.events_one = ... # type: Set[e.EventWithOneDevice]
self.actions_multiple = ... # type: Set[e.ActionWithMultipleDevices]
self.actions_one = ... # type: Set[e.ActionWithOneDevice]
self.tags = ... # type: Tags[Tag]
self.lots = ... # type: Set[Lot]
self.production_date = ... # type: Optional[datetime]
@ -68,11 +68,11 @@ class Device(Thing):
self.variant = ... # type: Optional[str]
@property
def events(self) -> List[e.Event]:
def actions(self) -> List[e.Action]:
pass
@property
def problems(self) -> List[e.Event]:
def problems(self) -> List[e.Action]:
pass
@property
@ -103,10 +103,10 @@ class Device(Thing):
def working(self) -> List[e.Test]:
pass
def last_event_of(self, *types: Type[E]) -> E:
def last_action_of(self, *types: Type[E]) -> E:
pass
def _warning_events(self, events: Iterable[e.Event]) -> Generator[e.Event]:
def _warning_actions(self, actions: Iterable[e.Action]) -> Generator[e.Action]:
pass
@ -139,11 +139,11 @@ class Computer(DisplayMixin, Device):
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self.components = ... # type: Set[Component]
self.events_parent = ... # type: Set[e.Event]
self.actions_parent = ... # type: Set[e.Action]
self.chassis = ... # type: ComputerChassis
@property
def events(self) -> List:
def actions(self) -> List:
pass
@property
@ -230,7 +230,7 @@ class Component(Device):
super().__init__(**kwargs)
self.parent_id = ... # type: int
self.parent = ... # type: Computer
self.events_components = ... # type: Set[e.Event]
self.actions_components = ... # type: Set[e.Action]
def similar_one(self, parent: Computer, blacklist: Set[int]) -> 'Component':
pass

View File

@ -37,9 +37,9 @@ class Device(Thing):
width = Float(validate=Range(0.1, 5), unit=UnitCodes.m, description=m.Device.width.comment)
height = Float(validate=Range(0.1, 5), unit=UnitCodes.m, description=m.Device.height.comment)
depth = Float(validate=Range(0.1, 5), unit=UnitCodes.m, description=m.Device.depth.comment)
events = NestedOn('Event', many=True, dump_only=True, description=m.Device.events.__doc__)
events_one = NestedOn('Event', many=True, load_only=True, collection_class=OrderedSet)
problems = NestedOn('Event', many=True, dump_only=True, description=m.Device.problems.__doc__)
actions = NestedOn('Action', many=True, dump_only=True, description=m.Device.actions.__doc__)
actions_one = NestedOn('Action', many=True, load_only=True, collection_class=OrderedSet)
problems = NestedOn('Action', many=True, dump_only=True, description=m.Device.problems.__doc__)
url = URL(dump_only=True, description=m.Device.url.__doc__)
lots = NestedOn('Lot',
many=True,
@ -53,34 +53,35 @@ class Device(Thing):
production_date = DateTime('iso',
description=m.Device.updated.comment,
data_key='productionDate')
working = NestedOn('Event',
working = NestedOn('Action',
many=True,
dump_only=True,
description=m.Device.working.__doc__)
@pre_load
def from_events_to_events_one(self, data: dict):
def from_actions_to_actions_one(self, data: dict):
"""
Not an elegant way of allowing submitting events to a device
(in the context of Snapshots) without creating an ``events``
Not an elegant way of allowing submitting actions to a device
(in the context of Snapshots) without creating an ``actions``
field at the model (which is not possible).
:param data:
:return:
"""
# Note that it is secure to allow uploading events_one
# Note that it is secure to allow uploading actions_one
# as the only time an user can send a device object is
# in snapshots.
data['events_one'] = data.pop('events', [])
data['actions_one'] = data.pop('actions', [])
return data
@post_load
def validate_snapshot_events(self, data):
"""Validates that only snapshot-related events can be uploaded."""
from ereuse_devicehub.resources.event.models import EraseBasic, Test, Rate, Install, \
def validate_snapshot_actions(self, data):
"""Validates that only snapshot-related actions can be uploaded."""
from ereuse_devicehub.resources.action.models import EraseBasic, Test, Rate, Install, \
Benchmark
for event in data['events_one']:
if not isinstance(event, (Install, EraseBasic, Rate, Test, Benchmark)):
raise ValidationError('You cannot upload {}'.format(event), field_names=['events'])
for action in data['actions_one']:
if not isinstance(action, (Install, EraseBasic, Rate, Test, Benchmark)):
raise ValidationError('You cannot upload {}'.format(action),
field_names=['actions'])
class Computer(Device):
@ -109,7 +110,7 @@ class Computer(Device):
dump_only=True,
data_key='networkSpeeds',
description=m.Computer.network_speeds.__doc__)
privacy = NestedOn('Event',
privacy = NestedOn('Action',
many=True,
dump_only=True,
collection_class=set,
@ -229,7 +230,7 @@ class DataStorage(Component):
unit=UnitCodes.mbyte,
description=m.DataStorage.size.comment)
interface = EnumField(enums.DataStorageInterface)
privacy = NestedOn('Event', dump_only=True)
privacy = NestedOn('Action', dump_only=True)
class HardDrive(DataStorage):

View File

@ -7,10 +7,10 @@ from sqlalchemy.orm import aliased
from ereuse_devicehub.db import db
from ereuse_devicehub.resources import search
from ereuse_devicehub.resources.action.models import Action, ActionWithMultipleDevices, \
ActionWithOneDevice
from ereuse_devicehub.resources.agent.models import Organization
from ereuse_devicehub.resources.device.models import Component, Computer, Device
from ereuse_devicehub.resources.event.models import Event, EventWithMultipleDevices, \
EventWithOneDevice
from ereuse_devicehub.resources.tag.model import Tag
@ -42,17 +42,17 @@ class DeviceSearch(db.Model):
@classmethod
def update_modified_devices(cls, session: db.Session):
"""Updates the documents of the devices that are part of a
modified event, or tag in the passed-in session.
modified action, or tag in the passed-in session.
This method is registered as a SQLAlchemy listener in the
Devicehub class.
"""
devices_to_update = set()
for model in chain(session.new, session.dirty):
if isinstance(model, Event):
if isinstance(model, EventWithMultipleDevices):
if isinstance(model, Action):
if isinstance(model, ActionWithMultipleDevices):
devices_to_update |= model.devices
elif isinstance(model, EventWithOneDevice):
elif isinstance(model, ActionWithOneDevice):
devices_to_update.add(model.device)
if model.parent:
devices_to_update.add(model.parent)

View File

@ -2,7 +2,7 @@ from enum import Enum
import inflection
from ereuse_devicehub.resources.event import models as e
from ereuse_devicehub.resources.action import models as e
class State(Enum):
@ -11,8 +11,8 @@ class State(Enum):
"""
@classmethod
def events(cls):
"""Events participating in this state."""
def actions(cls):
"""Actions participating in this state."""
return (s.value for s in cls)
def __str__(self):

View File

@ -11,9 +11,9 @@ from teal.db import ResourceNotFound
from teal.marshmallow import ValidationError
from ereuse_devicehub.db import db
from ereuse_devicehub.resources.action.models import Remove
from ereuse_devicehub.resources.device.exceptions import NeedsId
from ereuse_devicehub.resources.device.models import Component, Computer, Device
from ereuse_devicehub.resources.event.models import Remove
from ereuse_devicehub.resources.tag.model import Tag
@ -39,7 +39,7 @@ class Sync:
:param device: The device to add / update to the database.
:param components: Components that are inside of the device.
This method performs Add and Remove events
This method performs Add and Remove actions
so the device ends up with these components.
Components are added / updated accordingly.
If this is empty, all components are removed.
@ -55,7 +55,7 @@ class Sync:
2. A list of Add / Remove (not yet added to session).
"""
db_device = self.execute_register(device)
db_components, events = OrderedSet(), OrderedSet()
db_components, actions = OrderedSet(), OrderedSet()
if components is not None: # We have component info (see above)
if not isinstance(db_device, Computer):
# Until a good reason is given, we synthetically forbid
@ -71,9 +71,9 @@ class Sync:
if not is_new:
not_new_components.add(db_component)
# We only want to perform Add/Remove to not new components
events = self.add_remove(db_device, not_new_components)
actions = self.add_remove(db_device, not_new_components)
db_device.components = db_components
return db_device, events
return db_device, actions
def execute_register_component(self,
component: Component,
@ -218,7 +218,7 @@ class Sync:
def add_remove(device: Computer,
components: Set[Component]) -> OrderedSet:
"""
Generates the Add and Remove events (but doesn't add them to
Generates the Add and Remove actions (but doesn't add them to
session).
:param device: A device which ``components`` attribute contains
@ -228,10 +228,10 @@ class Sync:
be Added. Some of them can already exist
on the device, in which case they won't
be re-added.
:return: A list of Add / Remove events.
:return: A list of Add / Remove actions.
"""
# Note that we create the Remove events before the Add ones
events = OrderedSet()
# Note that we create the Remove actions before the Add ones
actions = OrderedSet()
old_components = set(device.components)
adding = components - old_components
@ -242,8 +242,8 @@ class Sync:
for parent, _components in groupby(sorted(adding, key=g_parent), key=g_parent):
if parent.id != 0: # Is not Computer Identity
events.add(Remove(device=parent, components=OrderedSet(_components)))
return events
actions.add(Remove(device=parent, components=OrderedSet(_components)))
return actions
class MismatchBetweenTags(ValidationError):

View File

@ -194,21 +194,21 @@
<small>Latest one.</small>
</div>
<ol>
{% for event in device.events|reverse %}
{% for action in device.actions|reverse %}
<li>
<strong>
{{ event.type }}
{{ action.type }}
</strong>
{{ event }}
{{ action }}
<br>
<div class="text-muted">
<small>
{{ event._date_str }}
{{ action._date_str }}
</small>
</div>
{% if event.certificate %}
<a href="{{ event.certificate.to_text() }}">See the certificate</a>
{% if action.certificate %}
<a href="{{ action.certificate.to_text() }}">See the certificate</a>
{% endif %}
</li>
{% endfor %}

View File

@ -13,9 +13,9 @@ from ereuse_devicehub import auth
from ereuse_devicehub.db import db
from ereuse_devicehub.query import SearchQueryParser, things_response
from ereuse_devicehub.resources import search
from ereuse_devicehub.resources.action import models as actions
from ereuse_devicehub.resources.device.models import Device, Manufacturer
from ereuse_devicehub.resources.device.search import DeviceSearch
from ereuse_devicehub.resources.event import models as events
from ereuse_devicehub.resources.lot.models import LotDeviceDescendants
from ereuse_devicehub.resources.tag.model import Tag
@ -31,9 +31,9 @@ class OfType(f.Str):
class RateQ(query.Query):
rating = query.Between(events.Rate._rating, f.Float())
appearance = query.Between(events.Rate._appearance, f.Float())
functionality = query.Between(events.Rate._functionality, f.Float())
rating = query.Between(actions.Rate._rating, f.Float())
appearance = query.Between(actions.Rate._appearance, f.Float())
functionality = query.Between(actions.Rate._functionality, f.Float())
class TagQ(query.Query):
@ -52,8 +52,8 @@ class Filters(query.Query):
manufacturer = query.ILike(Device.manufacturer)
serialNumber = query.ILike(Device.serial_number)
# todo test query for rating (and possibly other filters)
rating = query.Join((Device.id == events.EventWithOneDevice.device_id)
& (events.EventWithOneDevice.id == events.Rate.id),
rating = query.Join((Device.id == actions.ActionWithOneDevice.device_id)
& (actions.ActionWithOneDevice.id == actions.Rate.id),
RateQ)
tag = query.Join(Device.id == Tag.device_id, TagQ)
# todo This part of the query is really slow

View File

@ -2,9 +2,9 @@ from collections import OrderedDict
from flask import current_app
from ereuse_devicehub.resources.device import models as d
from ereuse_devicehub.resources.event.models import BenchmarkDataStorage, RateComputer, \
from ereuse_devicehub.resources.action.models import BenchmarkDataStorage, RateComputer, \
TestDataStorage
from ereuse_devicehub.resources.device import models as d
class DeviceRow(OrderedDict):
@ -33,7 +33,7 @@ class DeviceRow(OrderedDict):
self['Serial Number'] = device.serial_number
self['Model'] = device.model
self['Manufacturer'] = device.manufacturer
# self['State'] = device.last_event_of()
# self['State'] = device.last_action_of()
self['Registered in'] = format(device.created, '%c')
self['Price'] = device.price
if isinstance(device, d.Computer):
@ -94,17 +94,17 @@ class DeviceRow(OrderedDict):
self['{} {} Size (MB)'.format(type, i)] = component.size
self['{} {} Privacy'.format(type, i)] = component.privacy
try:
self['{} {} Lifetime'.format(type, i)] = component.last_event_of(
self['{} {} Lifetime'.format(type, i)] = component.last_action_of(
TestDataStorage).lifetime
except:
self['{} {} Lifetime'.format(type, i)] = ''
try:
self['{} {} Reading speed'.format(type, i)] = component.last_event_of(
self['{} {} Reading speed'.format(type, i)] = component.last_action_of(
BenchmarkDataStorage).read_speed
except:
self['{} {} Reading speed'.format(type, i)] = ''
try:
self['{} {} Writing speed'.format(type, i)] = component.last_event_of(
self['{} {} Writing speed'.format(type, i)] = component.last_action_of(
BenchmarkDataStorage).write_speed
except:
self['{} {} Writing speed'.format(type, i)] = ''

View File

@ -15,10 +15,10 @@ from teal.cache import cache
from teal.resource import Resource
from ereuse_devicehub.db import db
from ereuse_devicehub.resources.action import models as evs
from ereuse_devicehub.resources.device import models as devs
from ereuse_devicehub.resources.device.views import DeviceView
from ereuse_devicehub.resources.documents.device_row import DeviceRow
from ereuse_devicehub.resources.event import models as evs
class Format(enum.Enum):
@ -47,7 +47,7 @@ class DocumentView(DeviceView):
flask.request,
locations=('querystring',))
if id:
# todo we assume we can pass both device id and event id
# todo we assume we can pass both device id and action id
# for certificates... how is it going to end up being?
try:
id = uuid.UUID(id)
@ -59,7 +59,7 @@ class DocumentView(DeviceView):
else:
query = devs.Device.query.filter_by(id=id)
else:
query = evs.Event.query.filter_by(id=id)
query = evs.Action.query.filter_by(id=id)
else:
flask.current_app.auth.requires_auth(lambda: None)() # todo not nice
query = self.query(args)

View File

@ -141,18 +141,6 @@ class ImageMimeTypes(Enum):
png = 'image/png'
@unique
class SnapshotExpectedEvents(Enum):
"""Events that Workbench can perform when processing a device."""
Benchmark = 'Benchmark'
TestDataStorage = 'TestDataStorage'
StressTest = 'StressTest'
EraseBasic = 'EraseBasic'
EraseSectors = 'EraseSectors'
SmartTest = 'SmartTest'
Install = 'Install'
BOX_RATE_5 = 1, 5
BOX_RATE_3 = 1, 3
@ -282,18 +270,18 @@ class BatteryTechnology(Enum):
class Severity(IntEnum):
"""A flag evaluating the event execution. Ex. failed events
"""A flag evaluating the action execution. Ex. failed actions
have the value `Severity.Error`. Devicehub uses 4 severity levels:
* Info: default neutral severity. The event succeeded.
* Notice: The event succeeded but it is raising awareness.
* Info: default neutral severity. The action succeeded.
* Notice: The action succeeded but it is raising awareness.
Notices are not usually that important but something
(good or bad) worth checking.
* Warning: The event succeeded but there is something important
to check negatively affecting the event.
* Error: the event failed.
* Warning: The action succeeded but there is something important
to check negatively affecting the action.
* Error: the action failed.
Devicehub specially raises user awareness when an event
Devicehub specially raises user awareness when an action
has a Severity of ``Warning`` or greater.
"""
@ -350,7 +338,7 @@ class ErasureStandards(Enum):
2. A second step erasing with random data, verifying the erasure
success in each hard-drive sector.
And be an :class:`ereuse_devicehub.resources.event.models.EraseSectors`.
And be an :class:`ereuse_devicehub.resources.action.models.EraseSectors`.
"""
def __str__(self):
@ -359,12 +347,12 @@ class ErasureStandards(Enum):
@classmethod
def from_data_storage(cls, erasure) -> Set['ErasureStandards']:
"""Returns a set of erasure standards."""
from ereuse_devicehub.resources.event import models as events
from ereuse_devicehub.resources.action import models as actions
standards = set()
if isinstance(erasure, events.EraseSectors):
if isinstance(erasure, actions.EraseSectors):
with suppress(ValueError):
first_step, *other_steps = erasure.steps
if isinstance(first_step, events.StepZero) \
and all(isinstance(step, events.StepRandom) for step in other_steps):
if isinstance(first_step, actions.StepZero) \
and all(isinstance(step, actions.StepRandom) for step in other_steps):
standards.add(cls.HMG_IS5)
return standards

View File

@ -58,7 +58,7 @@ class InventoryDef(Resource):
db.session.delete(inv)
db.session.flush()
# Remove users that end-up without any inventory
# todo this should be done in a trigger / event
# todo this should be done in a trigger / action
users = User.query \
.filter(User.id.notin_(db.session.query(UserInventory.user_id).distinct()))
for user in users:

View File

@ -81,7 +81,7 @@ class Lot(Thing):
@property
def url(self) -> urlutils.URL:
"""The URL where to GET this event."""
"""The URL where to GET this action."""
return urlutils.URL(url_for_resource(Lot, item_id=self.id))
@property

View File

@ -50,7 +50,7 @@ class LotView(View):
return Response(status=204)
def one(self, id: uuid.UUID):
"""Gets one event."""
"""Gets one action."""
lot = Lot.query.filter_by(id=id).one() # type: Lot
return self.schema.jsonify(lot)

View File

@ -14,7 +14,7 @@ components:
speed: 1.23
cores: 2
type: Processor
events:
actions:
- type: BenchmarkProcessor
rate: 1
elapsed: 166

View File

@ -2,21 +2,21 @@
"closed": true,
"components": [
{
"events": [],
"actions": [],
"manufacturer": "Intel Corporation",
"model": "NM10/ICH7 Family High Definition Audio Controller",
"serialNumber": null,
"type": "SoundCard"
},
{
"events": [],
"actions": [],
"manufacturer": "Azurewave",
"model": "USB 2.0 UVC VGA WebCam",
"serialNumber": "0x0001",
"type": "SoundCard"
},
{
"events": [],
"actions": [],
"format": "DIMM",
"interface": "DDR2",
"manufacturer": null,
@ -29,7 +29,7 @@
{
"address": 64,
"cores": 1,
"events": [
"actions": [
{
"elapsed": 165,
"rate": 164.8342,
@ -49,7 +49,7 @@
"type": "Processor"
},
{
"events": [
"actions": [
{
"elapsed": 16,
"readSpeed": 66.2,
@ -65,7 +65,7 @@
"type": "HardDrive"
},
{
"events": [],
"actions": [],
"manufacturer": "Qualcomm Atheros",
"model": "AR9285 Wireless Network Adapter",
"serialNumber": "74:2f:68:8b:fd:c8",
@ -73,7 +73,7 @@
"wireless": true
},
{
"events": [],
"actions": [],
"manufacturer": "Qualcomm Atheros",
"model": "AR8152 v2.0 Fast Ethernet",
"serialNumber": "14:da:e9:42:f6:7c",
@ -82,7 +82,7 @@
"wireless": false
},
{
"events": [],
"actions": [],
"manufacturer": "Intel Corporation",
"memory": 256.0,
"model": "Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller",
@ -90,7 +90,7 @@
"type": "GraphicCard"
},
{
"events": [
"actions": [
{
"type": "TestBios",
"accessRange": "A",
@ -109,7 +109,7 @@
],
"device": {
"chassis": "Netbook",
"events": [
"actions": [
{
"elapsed": 16,
"rate": 15.8978,
@ -128,9 +128,6 @@
},
"elapsed": 6,
"endTime": "2018-10-14T21:22:14.777235+00:00",
"expectedEvents": [
"Benchmark"
],
"software": "Workbench",
"type": "Snapshot",
"uuid": "7dc4d19c-914e-4652-a381-d641325fb9c2",

View File

@ -9,26 +9,26 @@ device:
serialNumber: d1s
model: d1ml
manufacturer: d1mr
events:
actions:
- type: VisualTest
appearanceRange: A
functionalityRange: B
components:
- type: GraphicCard
serialNumber: gc1s
model: gc1ml
manufacturer: gc1mr
- type: RamModule
serialNumber: rm1s
model: rm1ml
manufacturer: rm1mr
speed: 1333
- type: Processor
serialNumber: p1s
model: p1ml
manufacturer: p1mr
speed: 1.6
events:
- type: BenchmarkProcessor
rate: 2410
elapsed: 11
- type: GraphicCard
serialNumber: gc1s
model: gc1ml
manufacturer: gc1mr
- type: RamModule
serialNumber: rm1s
model: rm1ml
manufacturer: rm1mr
speed: 1333
- type: Processor
serialNumber: p1s
model: p1ml
manufacturer: p1mr
speed: 1.6
actions:
- type: BenchmarkProcessor
rate: 2410
elapsed: 11

View File

@ -3,14 +3,14 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": true,
"endTime": "2018-07-19T15:48:40.635776+00:00",
"device": {
"manufacturer": "Dell Inc.",
"model": "Latitude E6440",
"serialNumber": "FJBQVZ1",
"events": [],
"actions": [],
"type": "Laptop",
"chassis": "Laptop"
},
@ -19,7 +19,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i7-4600M CPU @ 2.90GHz",
"serialNumber": null,
"events": [
"actions": [
{
"elapsed": 165,
"rate": 164.8342,
@ -41,7 +41,7 @@
"manufacturer": "Samsung",
"model": "M471B5173DB0-YK0",
"serialNumber": "732CD498",
"events": [],
"actions": [],
"type": "RamModule",
"format": "SODIMM",
"size": 4096,
@ -52,7 +52,7 @@
"manufacturer": "Samsung",
"model": "M471B5173DB0-YK0",
"serialNumber": "152DD498",
"events": [],
"actions": [],
"type": "RamModule",
"format": "SODIMM",
"size": 4096,
@ -63,7 +63,7 @@
"manufacturer": null,
"model": "Crucial_CT525MX3",
"serialNumber": "164014297BCC",
"events": [
"actions": [
{
"readSpeed": 63.3,
"type": "BenchmarkDataStorage",
@ -79,7 +79,7 @@
"manufacturer": "Intel Corporation",
"model": "4th Gen Core Processor Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -87,7 +87,7 @@
"manufacturer": "Intel Corporation",
"model": "Ethernet Connection I217-LM",
"serialNumber": "ec:f4:bb:0b:18:90",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -96,7 +96,7 @@
"manufacturer": "Intel Corporation",
"model": "Centrino Advanced-N 6235",
"serialNumber": "c4:d9:87:47:90:e1",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": true
},
@ -104,7 +104,7 @@
"manufacturer": null,
"model": null,
"serialNumber": "da:b4:3a:25:88:6c",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": false
},
@ -112,28 +112,28 @@
"manufacturer": "Intel Corporation",
"model": "Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "CNFCH52J48303+YF2",
"model": "Laptop_Integrated_Webcam_HD",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Intel Corporation",
"model": "8 Series/C220 Series Chipset High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Dell Inc.",
"model": "0159N7",
"serialNumber": "/FJBQVZ1/CN1296342I009B/",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 3,
"firewire": 0,

View File

@ -2,14 +2,14 @@
"closed": true,
"components": [
{
"events": [],
"actions": [],
"manufacturer": "Intel Corporation",
"model": "NM10/ICH7 Family High Definition Audio Controller",
"serialNumber": null,
"type": "SoundCard"
},
{
"events": [],
"actions": [],
"manufacturer": "Broadcom Inc. and subsidiaries",
"model": "NetLink BCM5786 Gigabit Ethernet PCI Express",
"serialNumber": "00:1a:6b:5e:7f:10",
@ -18,7 +18,7 @@
"wireless": false
},
{
"events": [],
"actions": [],
"format": "DIMM",
"interface": "DDR",
"manufacturer": null,
@ -29,7 +29,7 @@
"type": "RamModule"
},
{
"events": [],
"actions": [],
"format": "DIMM",
"interface": "DDR",
"manufacturer": null,
@ -41,7 +41,7 @@
},
{
"address": 64,
"events": [
"actions": [
{
"elapsed": 33,
"rate": 32.9274,
@ -61,7 +61,7 @@
"type": "Processor"
},
{
"events": [],
"actions": [],
"manufacturer": "Intel Corporation",
"memory": 256.0,
"model": "82946GZ/GL Integrated Graphics Controller",
@ -69,7 +69,7 @@
"type": "GraphicCard"
},
{
"events": [
"actions": [
{
"type": "TestBios",
"accessRange": "E"
@ -88,7 +88,7 @@
],
"device": {
"chassis": "Microtower",
"events": [
"actions": [
{
"appearanceRange": "D",
"functionalityRange": "D",
@ -112,12 +112,6 @@
},
"elapsed": 338,
"endTime": "2019-02-13T11:57:31.378330+00:00",
"expectedEvents": [
"Benchmark",
"TestDataStorage",
"StressTest",
"Install"
],
"software": "Workbench",
"type": "Snapshot",
"uuid": "d7904bd3-7d0f-4918-86b1-e21bfab738f9",

View File

@ -5,7 +5,7 @@
"manufacturer": 'bar',
"model": 'baz',
"type": "Desktop",
"events": [],
"actions": [],
"chassis": "Tower"
},
"elapsed": 7631,
@ -13,10 +13,6 @@
"type": "Snapshot",
"closed": false,
"uuid": "5387668a-8d21-4053-a1ac-36efb97fc3ea",
"expectedEvents": [
"TestDataStorage",
"EraseBasic"
],
"components": [
{
"serialNumber": null,
@ -25,7 +21,7 @@
"address": 64,
"model": "Intel Core i3-2100 CPU @ 3.10GHz",
"type": "Processor",
"events": [
"actions": [
{
"elapsed": 0,
"rate": 6665.7,
@ -39,7 +35,7 @@
"manufacturer": "Intel Corporation",
"model": "6 Series/C200 Series Chipset Family High Definition Audio Controller",
"type": "SoundCard",
"events": [],
"actions": [],
"serialNumber": null
},
{
@ -49,7 +45,7 @@
"format": "DIMM",
"model": "9905403-038.A00LF",
"type": "RamModule",
"events": [],
"actions": [],
"interface": "DDR3",
"speed": 1333.0
},
@ -57,7 +53,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"type": "NetworkAdapter",
"events": [],
"actions": [],
"serialNumber": "f4:6d:04:12:9b:85",
"speed": 1000,
"wireless": false
@ -68,7 +64,7 @@
"manufacturer": "Western Digital",
"model": "WDC WD3200AAJS-2",
"type": "HardDrive",
"events": [
"actions": [
{
"endTime": "2018-07-13T11:54:55.100581+00:00",
"steps": [
@ -112,7 +108,7 @@
"manufacturer": "Western Digital",
"model": "WDC WD3200AAJS-0",
"type": "HardDrive",
"events": [
"actions": [
{
"endTime": "2018-07-13T12:55:47.331586+00:00",
"steps": [
@ -154,7 +150,7 @@
"manufacturer": "Intel Corporation",
"model": "2nd Generation Core Processor Family Integrated Graphics Controller",
"type": "GraphicCard",
"events": [],
"actions": [],
"memory": 256.0
},
{
@ -163,7 +159,7 @@
"manufacturer": "ASUSTeK Computer INC.",
"model": "P8H61-M LE",
"type": "Motherboard",
"events": [],
"actions": [],
"slots": 2,
"usb": 2,
"firewire": 0,

View File

@ -14,7 +14,7 @@ components:
serialNumber: c1s
model: c1ml
manufacturer: c1mr
events:
actions:
- type: EraseSectors
startTime: '2018-06-01T08:12:06+02:00'
endTime: '2018-06-01T09:12:06+02:00'
@ -35,7 +35,7 @@ components:
serialNumber: p1s
model: p1ml
manufacturer: p1mr
events:
actions:
- type: BenchmarkProcessor
elapsed: 0
rate: 6665.7

View File

@ -1,154 +1,154 @@
{
"closed": true,
"components": [
{
"actions": [],
"manufacturer": "Qualcomm Atheros",
"model": "QCA9565 / AR9565 Wireless Network Adapter",
"serialNumber": "ac:e0:10:c2:e3:ac",
"type": "NetworkAdapter",
"wireless": true
},
{
"actions": [],
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL810xE PCI Express Fast Ethernet controller",
"serialNumber": "30:8d:99:25:6c:d9",
"speed": 100,
"type": "NetworkAdapter",
"wireless": false
},
{
"actions": [],
"manufacturer": "Advanced Micro Devices, Inc. AMD/ATI",
"model": "Kabini HDMI/DP Audio",
"serialNumber": null,
"type": "SoundCard"
},
{
"actions": [],
"manufacturer": "Chicony Electronics Co.,Ltd.",
"model": "HP Webcam",
"serialNumber": "0x0001",
"type": "SoundCard"
},
{
"actions": [],
"manufacturer": "Advanced Micro Devices, Inc. AMD",
"model": "FCH Azalia Controller",
"serialNumber": null,
"type": "SoundCard"
},
{
"actions": [],
"format": "SODIMM",
"interface": "DDR3",
"manufacturer": "Hynix",
"model": "HMT451S6AFR8A-PB",
"serialNumber": "11743764",
"size": 4096,
"speed": 667.0,
"type": "RamModule"
},
{
"address": 64,
"cores": 2,
"actions": [
{
"events": [],
"manufacturer": "Qualcomm Atheros",
"model": "QCA9565 / AR9565 Wireless Network Adapter",
"serialNumber": "ac:e0:10:c2:e3:ac",
"type": "NetworkAdapter",
"wireless": true
"elapsed": 0,
"rate": 3992.32,
"type": "BenchmarkProcessor"
},
{
"events": [],
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL810xE PCI Express Fast Ethernet controller",
"serialNumber": "30:8d:99:25:6c:d9",
"speed": 100,
"type": "NetworkAdapter",
"wireless": false
},
{
"events": [],
"manufacturer": "Advanced Micro Devices, Inc. AMD/ATI",
"model": "Kabini HDMI/DP Audio",
"serialNumber": null,
"type": "SoundCard"
},
{
"events": [],
"manufacturer": "Chicony Electronics Co.,Ltd.",
"model": "HP Webcam",
"serialNumber": "0x0001",
"type": "SoundCard"
},
{
"events": [],
"manufacturer": "Advanced Micro Devices, Inc. AMD",
"model": "FCH Azalia Controller",
"serialNumber": null,
"type": "SoundCard"
},
{
"events": [],
"format": "SODIMM",
"interface": "DDR3",
"manufacturer": "Hynix",
"model": "HMT451S6AFR8A-PB",
"serialNumber": "11743764",
"size": 4096,
"speed": 667.0,
"type": "RamModule"
},
{
"address": 64,
"cores": 2,
"events": [
{
"elapsed": 0,
"rate": 3992.32,
"type": "BenchmarkProcessor"
},
{
"elapsed": 65,
"rate": 65.3007,
"type": "BenchmarkProcessorSysbench"
}
],
"manufacturer": "Advanced Micro Devices AMD",
"model": "AMD E1-2100 APU with Radeon HD Graphics",
"serialNumber": null,
"speed": 0.9,
"threads": 2,
"type": "Processor"
},
{
"events": [
{
"elapsed": 12,
"readSpeed": 90.0,
"type": "BenchmarkDataStorage",
"writeSpeed": 30.7
},
{
"assessment": true,
"commandTimeout": 1341,
"currentPendingSectorCount": 0,
"elapsed": 113,
"length": "Short",
"lifetime": 1782,
"offlineUncorrectable": 0,
"powerCycleCount": 806,
"reallocatedSectorCount": 224,
"reportedUncorrectableErrors": 9961472,
"severity": "Info",
"status": "Completed without error",
"type": "TestDataStorage"
},
{
"address": 32,
"elapsed": 690,
"name": "LinuxMint-19-x86-es-2018-12.fsa",
"severity": "Info",
"type": "Install"
}
],
"interface": "ATA",
"manufacturer": null,
"model": "HGST HTS545050A7",
"serialNumber": "TE85134N34LNSN",
"size": 476940,
"type": "HardDrive"
},
{
"events": [],
"manufacturer": "Advanced Micro Devices, Inc. AMD/ATI",
"memory": 256.0,
"model": "Kabini Radeon HD 8210",
"serialNumber": null,
"type": "GraphicCard"
},
{
"events": [],
"firewire": 0,
"manufacturer": "Hewlett-Packard",
"model": "21F7",
"pcmcia": 0,
"serial": 1,
"serialNumber": "PEHERF41U8P9TV",
"slots": 0,
"type": "Motherboard",
"usb": 5
"elapsed": 65,
"rate": 65.3007,
"type": "BenchmarkProcessorSysbench"
}
],
"manufacturer": "Advanced Micro Devices AMD",
"model": "AMD E1-2100 APU with Radeon HD Graphics",
"serialNumber": null,
"speed": 0.9,
"threads": 2,
"type": "Processor"
},
{
"actions": [
{
"elapsed": 12,
"readSpeed": 90.0,
"type": "BenchmarkDataStorage",
"writeSpeed": 30.7
},
{
"assessment": true,
"commandTimeout": 1341,
"currentPendingSectorCount": 0,
"elapsed": 113,
"length": "Short",
"lifetime": 1782,
"offlineUncorrectable": 0,
"powerCycleCount": 806,
"reallocatedSectorCount": 224,
"reportedUncorrectableErrors": 9961472,
"severity": "Info",
"status": "Completed without error",
"type": "TestDataStorage"
},
{
"address": 32,
"elapsed": 690,
"name": "LinuxMint-19-x86-es-2018-12.fsa",
"severity": "Info",
"type": "Install"
}
],
"interface": "ATA",
"manufacturer": null,
"model": "HGST HTS545050A7",
"serialNumber": "TE85134N34LNSN",
"size": 476940,
"type": "HardDrive"
},
{
"actions": [],
"manufacturer": "Advanced Micro Devices, Inc. AMD/ATI",
"memory": 256.0,
"model": "Kabini Radeon HD 8210",
"serialNumber": null,
"type": "GraphicCard"
},
{
"actions": [],
"firewire": 0,
"manufacturer": "Hewlett-Packard",
"model": "21F7",
"pcmcia": 0,
"serial": 1,
"serialNumber": "PEHERF41U8P9TV",
"slots": 0,
"type": "Motherboard",
"usb": 5
}
],
"device": {
"chassis": "Netbook",
"events": [
{
"appearanceRange": "A",
"functionalityRange": "A",
"type": "VisualTest"
},
{
"elapsed": 300,
"severity": "Info",
"type": "StressTest"
},
{
"elapsed": 6,
"rate": 5.8783,
"type": "BenchmarkRamSysbench"
}
"actions": [
{
"appearanceRange": "A",
"functionalityRange": "A",
"type": "VisualTest"
},
{
"elapsed": 300,
"severity": "Info",
"type": "StressTest"
},
{
"elapsed": 6,
"rate": 5.8783,
"type": "BenchmarkRamSysbench"
}
],
"manufacturer": "Hewlett-Packard",
"model": "HP 255 G3 Notebook",
@ -157,12 +157,6 @@
},
"elapsed": 1194,
"endTime": "2019-02-13T10:13:50.535387+00:00",
"expectedEvents": [
"Benchmark",
"TestDataStorage",
"StressTest",
"Install"
],
"software": "Workbench",
"type": "Snapshot",
"uuid": "ca564895-567e-4ac2-9a0d-2d1402528687",

View File

@ -1,14 +1,10 @@
{
"version": "11.0a3",
"expectedEvents": [
"Benchmark",
"TestDataStorage",
"StressTest"
],
"uuid": "16467238-64bb-48e0-9058-0cba687d7db0",
"components": [
{
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false,
@ -17,7 +13,7 @@
"model": "88E8056 PCI-E Gigabit Ethernet Controller"
},
{
"events": [
"actions": [
{
"rate": 4.8652,
"elapsed": 5,
@ -39,21 +35,21 @@
"address": 64
},
{
"events": [],
"actions": [],
"type": "SoundCard",
"manufacturer": "Advanced Micro Devices, Inc. AMD/ATI",
"serialNumber": null,
"model": "Barts HDMI Audio Radeon HD 6790/6850/6870 / 7720"
},
{
"events": [],
"actions": [],
"type": "SoundCard",
"manufacturer": "Intel Corporation",
"serialNumber": null,
"model": "82801JI HD Audio Controller"
},
{
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": 256.0,
"manufacturer": "Advanced Micro Devices, Inc. AMD/ATI",
@ -61,7 +57,7 @@
"model": "Barts XT Radeon HD 6870"
},
{
"events": [
"actions": [
{
"elapsed": 2,
"type": "BenchmarkDataStorage",
@ -89,7 +85,7 @@
"size": 228936
},
{
"events": [],
"actions": [],
"type": "Motherboard",
"slots": 6,
"pcmcia": 0,
@ -103,7 +99,7 @@
],
"elapsed": 7339,
"device": {
"events": [
"actions": [
{
"rate": 16.5946,
"elapsed": 17,

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@ def test_api_docs(client: Client):
'/devices/',
'/tags/',
'/users/login/',
'/events/',
'/actions/',
'/lots/',
'/manufacturers/',
'/lots/{id}/children',

View File

@ -11,17 +11,17 @@ def test_unique_violation():
'uuid': UUID('f5efd26e-8754-46bc-87bf-fbccc39d60d9'),
'version': '11.0',
'software': 'Workbench', 'elapsed': datetime.timedelta(0, 4),
'expected_events': None,
'expected_actions': None,
'id': UUID('dbdef3d8-2cac-48cb-adb8-419bc3e59687')
}
def __str__(self):
return """(psycopg2.IntegrityError) duplicate key value violates unique constraint "snapshot_uuid_key"
DETAIL: Key (uuid)=(f5efd26e-8754-46bc-87bf-fbccc39d60d9) already exists.
[SQL: 'INSERT INTO snapshot (uuid, version, software, elapsed, expected_events, id)
VALUES (%(uuid)s, %(version)s, %(software)s, %(elapsed)s, CAST(%(expected_events)s
AS snapshotexpectedevents[]), %(id)s)'] [parameters: {'uuid': UUID('f5efd26e-8754-46bc-87bf-fbccc39d60d9'),
'version': '11.0', 'software': 'Workbench', 'elapsed': datetime.timedelta(0, 4), 'expected_events': None,
[SQL: 'INSERT INTO snapshot (uuid, version, software, elapsed, expected_actions, id)
VALUES (%(uuid)s, %(version)s, %(software)s, %(elapsed)s, CAST(%(expected_actions)s
AS snapshotexpectedactions[]), %(id)s)'] [parameters: {'uuid': UUID('f5efd26e-8754-46bc-87bf-fbccc39d60d9'),
'version': '11.0', 'software': 'Workbench', 'elapsed': datetime.timedelta(0, 4), 'expected_actions': None,
'id': UUID('dbdef3d8-2cac-48cb-adb8-419bc3e59687')}] (Background on this error at: http://sqlalche.me/e/gkpj)"""
u = UniqueViolation(IntegrityErrorMock())

View File

@ -13,6 +13,8 @@ from teal.enums import Layouts
from ereuse_devicehub.client import Client, UserClient
from ereuse_devicehub.db import db
from ereuse_devicehub.devicehub import Devicehub
from ereuse_devicehub.resources.action import models as m
from ereuse_devicehub.resources.action.models import Remove, TestConnectivity
from ereuse_devicehub.resources.agent.models import Person
from ereuse_devicehub.resources.device import models as d
from ereuse_devicehub.resources.device.exceptions import NeedsId
@ -21,8 +23,6 @@ from ereuse_devicehub.resources.device.sync import MismatchBetweenTags, Mismatch
Sync
from ereuse_devicehub.resources.enums import ComputerChassis, DisplayTech, Severity, \
SnapshotSoftware
from ereuse_devicehub.resources.event import models as m
from ereuse_devicehub.resources.event.models import Remove, TestConnectivity
from ereuse_devicehub.resources.tag.model import Tag
from ereuse_devicehub.resources.user import User
from tests import conftest
@ -169,13 +169,13 @@ def test_add_remove():
# Test:
# pc has only c3
events = Sync.add_remove(device=pc, components={c3, c4})
db.session.add_all(events)
actions = Sync.add_remove(device=pc, components={c3, c4})
db.session.add_all(actions)
db.session.commit() # We enforce the appliance of order_by
assert len(events) == 1
assert isinstance(events[0], Remove)
assert events[0].device == pc2
assert events[0].components == OrderedSet([c3])
assert len(actions) == 1
assert isinstance(actions[0], Remove)
assert actions[0].device == pc2
assert actions[0].components == OrderedSet([c3])
@pytest.mark.usefixtures(conftest.app_context.__name__)
@ -396,13 +396,13 @@ def test_get_device(app: Devicehub, user: UserClient):
author=User(email='bar@bar.com')))
db.session.commit()
pc, _ = user.get(res=d.Device, item=1)
assert len(pc['events']) == 1
assert pc['events'][0]['type'] == 'TestConnectivity'
assert pc['events'][0]['device'] == 1
assert pc['events'][0]['severity'] == 'Info'
assert UUID(pc['events'][0]['author'])
assert 'events_components' not in pc, 'events_components are internal use only'
assert 'events_one' not in pc, 'they are internal use only'
assert len(pc['actions']) == 1
assert pc['actions'][0]['type'] == 'TestConnectivity'
assert pc['actions'][0]['device'] == 1
assert pc['actions'][0]['severity'] == 'Info'
assert UUID(pc['actions'][0]['author'])
assert 'actions_components' not in pc, 'actions_components are internal use only'
assert 'actions_one' not in pc, 'they are internal use only'
assert 'author' not in pc
assert tuple(c['id'] for c in pc['components']) == (2, 3)
assert pc['hid'] == 'desktop-p1ma-p1mo-p1s'

View File

@ -4,12 +4,12 @@ from teal.utils import compiled
from ereuse_devicehub.client import UserClient
from ereuse_devicehub.db import db
from ereuse_devicehub.devicehub import Devicehub
from ereuse_devicehub.resources.action.models import Snapshot
from ereuse_devicehub.resources.device.models import Desktop, Device, GraphicCard, Laptop, Server, \
SolidStateDrive
from ereuse_devicehub.resources.device.search import DeviceSearch
from ereuse_devicehub.resources.device.views import Filters, Sorting
from ereuse_devicehub.resources.enums import ComputerChassis
from ereuse_devicehub.resources.event.models import Snapshot
from ereuse_devicehub.resources.lot.models import Lot
from tests import conftest
from tests.conftest import file
@ -179,7 +179,7 @@ def test_device_query(user: UserClient):
assert i['url'] == '/devices/'
assert i['items'][0]['url'] == '/devices/1'
pc = next(d for d in i['items'] if d['type'] == 'Desktop')
assert len(pc['events']) == 4
assert len(pc['actions']) == 4
assert len(pc['components']) == 3
assert not pc['tags']

View File

@ -2,8 +2,8 @@ import teal.marshmallow
from ereuse_utils.test import ANY
from ereuse_devicehub.client import Client, UserClient
from ereuse_devicehub.resources.action import models as e
from ereuse_devicehub.resources.documents import documents as docs
from ereuse_devicehub.resources.event import models as e
from tests.conftest import file
@ -25,7 +25,7 @@ def test_erasure_certificate_public_one(user: UserClient, client: Client):
accept='application/pdf')
assert 'application/pdf' == response.content_type
erasure = next(e for e in snapshot['events'] if e['type'] == 'EraseSectors')
erasure = next(e for e in snapshot['actions'] if e['type'] == 'EraseSectors')
doc, response = client.get(res=docs.DocumentDef.t,
item='erasures/{}'.format(erasure['id']),

View File

@ -11,11 +11,11 @@ from teal.enums import Currency, Subdivision
from ereuse_devicehub.client import UserClient
from ereuse_devicehub.db import db
from ereuse_devicehub.resources import enums
from ereuse_devicehub.resources.action import models
from ereuse_devicehub.resources.device import states
from ereuse_devicehub.resources.device.models import Desktop, Device, GraphicCard, HardDrive, \
RamModule, SolidStateDrive
from ereuse_devicehub.resources.enums import ComputerChassis, Severity, TestDataStorageLength
from ereuse_devicehub.resources.event import models
from tests import conftest
from tests.conftest import create_user, file
@ -29,7 +29,7 @@ def test_author():
"""
user = create_user()
g.user = user
e = models.EventWithOneDevice(device=Device())
e = models.ActionWithOneDevice(device=Device())
db.session.add(e)
assert e.author is None
assert e.author_id is None
@ -51,13 +51,13 @@ def test_erase_basic():
db.session.commit()
db_erasure = models.EraseBasic.query.one()
assert erasure == db_erasure
assert next(iter(db_erasure.device.events)) == erasure
assert next(iter(db_erasure.device.actions)) == erasure
assert not erasure.standards, 'EraseBasic themselves do not have standards'
@pytest.mark.usefixtures(conftest.auth_app_context.__name__)
def test_validate_device_data_storage():
"""Checks the validation for data-storage-only events works."""
"""Checks the validation for data-storage-only actions works."""
# We can't set a GraphicCard
with pytest.raises(TypeError,
message='EraseBasic.device must be a DataStorage '
@ -133,7 +133,7 @@ def test_install():
@pytest.mark.usefixtures(conftest.auth_app_context.__name__)
def test_update_components_event_one():
def test_update_components_action_one():
computer = Desktop(serial_number='sn1',
model='ml1',
manufacturer='mr1',
@ -141,27 +141,27 @@ def test_update_components_event_one():
hdd = HardDrive(serial_number='foo', manufacturer='bar', model='foo-bar')
computer.components.add(hdd)
# Add event
# Add action
test = models.StressTest(elapsed=timedelta(minutes=1))
computer.events_one.add(test)
computer.actions_one.add(test)
assert test.device == computer
assert next(iter(test.components)) == hdd, 'Event has to have new components'
assert next(iter(test.components)) == hdd, 'Action has to have new components'
# Remove event
computer.events_one.clear()
# Remove action
computer.actions_one.clear()
assert not test.device
assert not test.components, 'Event has to loose the components'
assert not test.components, 'Action has to loose the components'
# If we add a component to a device AFTER assigning the event
# to the device, the event doesn't get the new component
computer.events_one.add(test)
# If we add a component to a device AFTER assigning the action
# to the device, the action doesn't get the new component
computer.actions_one.add(test)
ram = RamModule()
computer.components.add(ram)
assert len(test.components) == 1
@pytest.mark.usefixtures(conftest.auth_app_context.__name__)
def test_update_components_event_multiple():
def test_update_components_action_multiple():
computer = Desktop(serial_number='sn1',
model='ml1',
manufacturer='mr1',
@ -174,12 +174,12 @@ def test_update_components_event_multiple():
assert not ready.components
# Add
computer.events_multiple.add(ready)
computer.actions_multiple.add(ready)
assert ready.devices == OrderedSet([computer])
assert next(iter(ready.components)) == hdd
# Remove
computer.events_multiple.remove(ready)
computer.actions_multiple.remove(ready)
assert not ready.devices
assert not ready.components
@ -209,22 +209,23 @@ def test_update_parent():
assert not benchmark.parent
@pytest.mark.parametrize('event_model_state', [
@pytest.mark.parametrize('action_model_state', [
(models.ToRepair, states.Physical.ToBeRepaired),
(models.Repair, states.Physical.Repaired),
(models.ToPrepare, states.Physical.Preparing),
(models.ReadyToUse, states.Physical.ReadyToBeUsed),
(models.Prepare, states.Physical.Prepared)
])
def test_generic_event(event_model_state: Tuple[models.Event, states.Trading], user: UserClient):
"""Tests POSTing all generic events."""
event_model, state = event_model_state
def test_generic_action(action_model_state: Tuple[models.Action, states.Trading],
user: UserClient):
"""Tests POSTing all generic actions."""
action_model, state = action_model_state
snapshot, _ = user.post(file('basic.snapshot'), res=models.Snapshot)
event = {'type': event_model.t, 'devices': [snapshot['device']['id']]}
event, _ = user.post(event, res=models.Event)
assert event['devices'][0]['id'] == snapshot['device']['id']
action = {'type': action_model.t, 'devices': [snapshot['device']['id']]}
action, _ = user.post(action, res=models.Action)
assert action['devices'][0]['id'] == snapshot['device']['id']
device, _ = user.get(res=Device, item=snapshot['device']['id'])
assert device['events'][-1]['id'] == event['id']
assert device['actions'][-1]['id'] == action['id']
assert device['physical'] == state.name
@ -245,7 +246,7 @@ def test_live():
db.session.commit()
client = UserClient(app, 'foo@foo.com', 'foo', response_wrapper=app.response_class)
client.login()
live, _ = client.get(res=models.Event, item=str(db_live.id))
live, _ = client.get(res=models.Action, item=str(db_live.id))
assert live['ip'] == '79.147.10.10'
assert live['subdivision'] == 'ES-CA'
assert live['country'] == 'ES'
@ -265,27 +266,27 @@ def test_reserve_and_cancel(user: UserClient):
"""
@pytest.mark.parametrize('event_model_state', [
@pytest.mark.parametrize('action_model_state', [
(models.Sell, states.Trading.Sold),
(models.Donate, states.Trading.Donated),
(models.Rent, states.Trading.Renting),
(models.DisposeProduct, states.Trading.ProductDisposed)
])
def test_trade(event_model_state: Tuple[models.Event, states.Trading], user: UserClient):
"""Tests POSTing all Trade events."""
event_model, state = event_model_state
def test_trade(action_model_state: Tuple[models.Action, states.Trading], user: UserClient):
"""Tests POSTing all Trade actions."""
action_model, state = action_model_state
snapshot, _ = user.post(file('basic.snapshot'), res=models.Snapshot)
event = {
'type': event_model.t,
action = {
'type': action_model.t,
'devices': [snapshot['device']['id']],
'to': user.user['individuals'][0]['id'],
'shippingDate': '2018-06-29T12:28:54',
'invoiceNumber': 'ABC'
}
event, _ = user.post(event, res=models.Event)
assert event['devices'][0]['id'] == snapshot['device']['id']
action, _ = user.post(action, res=models.Action)
assert action['devices'][0]['id'] == snapshot['device']['id']
device, _ = user.get(res=Device, item=snapshot['device']['id'])
assert device['events'][-1]['id'] == event['id']
assert device['actions'][-1]['id'] == action['id']
assert device['trading'] == state.name
@ -306,7 +307,7 @@ def test_price_custom():
client = UserClient(app, 'foo@foo.com', 'foo', response_wrapper=app.response_class)
client.login()
p, _ = client.get(res=models.Event, item=str(price.id))
p, _ = client.get(res=models.Action, item=str(price.id))
assert p['device']['id'] == price.device.id == computer.id
assert p['price'] == 25.25
assert p['currency'] == Currency.EUR.name == 'EUR'
@ -324,7 +325,7 @@ def test_price_custom_client(user: UserClient):
'price': 25,
'currency': Currency.EUR.name,
'device': snapshot['device']['id']
}, res=models.Event)
}, res=models.Action)
assert 25 == price['price']
assert Currency.EUR.name == price['currency']

View File

@ -5,13 +5,13 @@ import pytest
from ereuse_devicehub.client import UserClient
from ereuse_devicehub.db import db
from ereuse_devicehub.resources.action.models import Action, BenchmarkDataStorage, \
BenchmarkProcessor, RateComputer, Snapshot, VisualTest
from ereuse_devicehub.resources.action.rate.workbench.v1_0 import CannotRate
from ereuse_devicehub.resources.device.models import Computer, Desktop, Device, HardDrive, \
Processor, RamModule
from ereuse_devicehub.resources.enums import AppearanceRange, ComputerChassis, \
FunctionalityRange
from ereuse_devicehub.resources.event.models import BenchmarkDataStorage, BenchmarkProcessor, \
Event, RateComputer, Snapshot, VisualTest
from ereuse_devicehub.resources.event.rate.workbench.v1_0 import CannotRate
from tests import conftest
from tests.conftest import file
@ -46,7 +46,7 @@ def test_manual_rate_after_workbench_rate(user: UserClient):
'device': device['id'],
'appearanceRange': 'A',
'functionalityRange': 'A'
}, res=Event)
}, res=Action)
device, _ = user.get(res=Device, item=snapshot['device']['id'])
assert 'A' == device['rate']['appearanceRange']
@ -57,9 +57,9 @@ def test_price_from_rate():
pc = Desktop(chassis=ComputerChassis.Tower)
hdd = HardDrive(size=476940)
hdd.events_one.add(BenchmarkDataStorage(read_speed=126, write_speed=29.8))
hdd.actions_one.add(BenchmarkDataStorage(read_speed=126, write_speed=29.8))
cpu = Processor(cores=2, speed=3.4)
cpu.events_one.add(BenchmarkProcessor(rate=27136.44))
cpu.actions_one.add(BenchmarkProcessor(rate=27136.44))
pc.components |= {
hdd,
RamModule(size=4096, speed=1600),
@ -73,8 +73,8 @@ def test_price_from_rate():
device=pc)
rate, price = RateComputer.compute(pc)
# events = pc.events
# price = next(e for e in events if isinstance(e, EreusePrice))
# actions = pc.actions
# price = next(e for e in actions if isinstance(e, EreusePrice))
assert price.price == Decimal('92.2001')
assert price.retailer.standard.amount == Decimal('40.9714')
assert price.platform.standard.amount == Decimal('18.8434')
@ -111,8 +111,8 @@ def test_no_rate_if_no_visual_test(user: UserClient):
"""
# Upload a basic snapshot
s = file('basic.snapshot')
# Delete snapshot device events
del s['device']['events']
# Delete snapshot device actions
del s['device']['actions']
snapshot, _ = user.post(s, res=Snapshot)
device, _ = user.get(res=Device, item=snapshot['device']['id'])
# How to assert CannotRate Exception
@ -135,6 +135,6 @@ def test_multiple_rates(user: UserClient):
ensuring that the tests / benchmarks...
from the first rate do not contaminate the second rate.
This ensures that rates only takes the last version of events
This ensures that rates only takes the last version of actions
and components (in case device has new components, for example).
"""

View File

@ -15,12 +15,12 @@ import math
import pytest
from ereuse_devicehub.resources.action.models import BenchmarkDataStorage, BenchmarkProcessor, \
VisualTest
from ereuse_devicehub.resources.action.rate.workbench.v1_0 import DataStorageRate, ProcessorRate, \
RamRate, RateAlgorithm
from ereuse_devicehub.resources.device.models import Desktop, HardDrive, Processor, RamModule
from ereuse_devicehub.resources.enums import AppearanceRange, ComputerChassis, FunctionalityRange
from ereuse_devicehub.resources.event.models import BenchmarkDataStorage, BenchmarkProcessor, \
VisualTest
from ereuse_devicehub.resources.event.rate.workbench.v1_0 import DataStorageRate, ProcessorRate, \
RamRate, RateAlgorithm
def test_rate_data_storage_rate():
@ -30,14 +30,14 @@ def test_rate_data_storage_rate():
"""
hdd_1969 = HardDrive(size=476940)
hdd_1969.events_one.add(BenchmarkDataStorage(read_speed=126, write_speed=29.8))
hdd_1969.actions_one.add(BenchmarkDataStorage(read_speed=126, write_speed=29.8))
data_storage_rate = DataStorageRate().compute([hdd_1969])
assert math.isclose(data_storage_rate, 4.02, rel_tol=0.001)
hdd_3054 = HardDrive(size=476940)
hdd_3054.events_one.add(BenchmarkDataStorage(read_speed=158, write_speed=34.7))
hdd_3054.actions_one.add(BenchmarkDataStorage(read_speed=158, write_speed=34.7))
# calculate DataStorage Rate
data_storage_rate = DataStorageRate().compute([hdd_3054])
@ -45,14 +45,14 @@ def test_rate_data_storage_rate():
assert math.isclose(data_storage_rate, 4.07, rel_tol=0.001)
hdd_81 = HardDrive(size=76319)
hdd_81.events_one.add(BenchmarkDataStorage(read_speed=72.2, write_speed=24.3))
hdd_81.actions_one.add(BenchmarkDataStorage(read_speed=72.2, write_speed=24.3))
data_storage_rate = DataStorageRate().compute([hdd_81])
assert math.isclose(data_storage_rate, 2.61, rel_tol=0.001)
hdd_1556 = HardDrive(size=152587)
hdd_1556.events_one.add(BenchmarkDataStorage(read_speed=78.1, write_speed=24.4))
hdd_1556.actions_one.add(BenchmarkDataStorage(read_speed=78.1, write_speed=24.4))
data_storage_rate = DataStorageRate().compute([hdd_1556])
@ -67,7 +67,7 @@ def test_rate_data_storage_size_is_null():
"""
hdd_null = HardDrive(size=None)
hdd_null.events_one.add(BenchmarkDataStorage(read_speed=0, write_speed=0))
hdd_null.actions_one.add(BenchmarkDataStorage(read_speed=0, write_speed=0))
data_storage_rate = DataStorageRate().compute([hdd_null])
assert data_storage_rate is None
@ -78,7 +78,7 @@ def test_rate_no_data_storage():
Test without data storage devices
"""
hdd_null = HardDrive()
hdd_null.events_one.add(BenchmarkDataStorage(read_speed=0, write_speed=0))
hdd_null.actions_one.add(BenchmarkDataStorage(read_speed=0, write_speed=0))
data_storage_rate = DataStorageRate().compute([hdd_null])
assert data_storage_rate is None
@ -179,7 +179,7 @@ def test_rate_processor_rate():
cpu = Processor(cores=1, speed=1.6)
# add score processor benchmark
cpu.events_one.add(BenchmarkProcessor(rate=3192.34))
cpu.actions_one.add(BenchmarkProcessor(rate=3192.34))
processor_rate = ProcessorRate().compute(cpu)
@ -194,14 +194,14 @@ def test_rate_processor_rate_2cores():
cpu = Processor(cores=2, speed=3.4)
# add score processor benchmark
cpu.events_one.add(BenchmarkProcessor(rate=27136.44))
cpu.actions_one.add(BenchmarkProcessor(rate=27136.44))
processor_rate = ProcessorRate().compute(cpu)
assert math.isclose(processor_rate, 3.95, rel_tol=0.001)
cpu = Processor(cores=2, speed=3.3)
cpu.events_one.add(BenchmarkProcessor(rate=26339.48))
cpu.actions_one.add(BenchmarkProcessor(rate=26339.48))
processor_rate = ProcessorRate().compute(cpu)
@ -213,7 +213,7 @@ def test_rate_processor_with_null_cores():
Test with processor device have null number of cores
"""
cpu = Processor(cores=None, speed=3.3)
cpu.events_one.add(BenchmarkProcessor())
cpu.actions_one.add(BenchmarkProcessor())
processor_rate = ProcessorRate().compute(cpu)
@ -225,7 +225,7 @@ def test_rate_processor_with_null_speed():
Test with processor device have null speed value
"""
cpu = Processor(cores=1, speed=None)
cpu.events_one.add(BenchmarkProcessor(rate=0))
cpu.actions_one.add(BenchmarkProcessor(rate=0))
processor_rate = ProcessorRate().compute(cpu)
@ -239,11 +239,11 @@ def test_rate_computer_rate():
price = 92.2
# add components characteristics of pc with id = 1193
hdd_1969 = HardDrive(size=476940)
hdd_1969.events_one.add(BenchmarkDataStorage(read_speed=126, write_speed=29.8))
hdd_1969.actions_one.add(BenchmarkDataStorage(read_speed=126, write_speed=29.8))
ram1 = RamModule(size=4096, speed=1600)
ram2 = RamModule(size=2048, speed=1067)
cpu = Processor(cores=2, speed=3.4)
cpu.events_one.add(BenchmarkProcessor(rate=27136.44))
cpu.actions_one.add(BenchmarkProcessor(rate=27136.44))
pc_1193.components.add(hdd_1969, ram1, ram2, cpu)
# add functionality and appearance range
rate_pc_1193 = WorkbenchRate(appearance_range=AppearanceRange.A, functionality_range=FunctionalityRange.A)
@ -256,10 +256,10 @@ def test_rate_computer_rate():
pc_1201 = Computer()
price = 69.6
hdd_3054 = HardDrive(size=476940)
hdd_3054.events_one.add(BenchmarkDataStorage(read_speed=158, write_speed=34.7))
hdd_3054.actions_one.add(BenchmarkDataStorage(read_speed=158, write_speed=34.7))
ram1 = RamModule(size=2048, speed=1333)
cpu = Processor(cores=2, speed=3.3)
cpu.events_one.add(BenchmarkProcessor(rate=26339.48))
cpu.actions_one.add(BenchmarkProcessor(rate=26339.48))
pc_1201.components.add(hdd_3054, ram1, cpu)
# add functionality and appearance range
rate_pc_1201 = WorkbenchRate(appearance_range=AppearanceRange.B, functionality_range=FunctionalityRange.A)
@ -272,13 +272,13 @@ def test_rate_computer_rate():
pc_79 = Computer()
price = VeryLow
hdd_81 = HardDrive(size=76319)
hdd_81.events_one.add(BenchmarkDataStorage(read_speed=72.2, write_speed=24.3))
hdd_81.actions_one.add(BenchmarkDataStorage(read_speed=72.2, write_speed=24.3))
ram1 = RamModule(size=512, speed=667)
ram2 = RamModule(size=512, speed=800)
ram3 = RamModule(size=512, speed=667)
ram4 = RamModule(size=512, speed=533)
cpu = Processor(cores=1, speed=1.6)
cpu.events_one.add(BenchmarkProcessor(rate=3192.34))
cpu.actions_one.add(BenchmarkProcessor(rate=3192.34))
pc_79.components.add(hdd_81, ram1, ram2, ram3, ram4, cpu)
# add functionality and appearance range
rate_pc_79 = WorkbenchRate(appearance_range=AppearanceRange.C, functionality_range=FunctionalityRange.A)
@ -291,10 +291,10 @@ def test_rate_computer_rate():
pc_798 = Computer()
price = 50
hdd_1556 = HardDrive(size=152587)
hdd_1556.events_one.add(BenchmarkDataStorage(read_speed=78.1, write_speed=24.4))
hdd_1556.actions_one.add(BenchmarkDataStorage(read_speed=78.1, write_speed=24.4))
ram0 = RamModule(size=0, speed=None)
cpu = Processor(cores=2, speed=2.5)
cpu.events_one.add(BenchmarkProcessor(rate=9974.3))
cpu.actions_one.add(BenchmarkProcessor(rate=9974.3))
pc_798.components.add(hdd_1556, ram0, cpu)
# add functionality and appearance range
rate_pc_798 = WorkbenchRate(appearance_range=AppearanceRange.B, functionality_range=FunctionalityRange.A)
@ -308,9 +308,9 @@ def test_rate_computer_rate():
# Create a new Computer with components characteristics of pc with id = 1193
pc_test = Desktop(chassis=ComputerChassis.Tower)
data_storage = HardDrive(size=476940)
data_storage.events_one.add(BenchmarkDataStorage(read_speed=126, write_speed=29.8))
data_storage.actions_one.add(BenchmarkDataStorage(read_speed=126, write_speed=29.8))
cpu = Processor(cores=2, speed=3.4)
cpu.events_one.add(BenchmarkProcessor(rate=27136.44))
cpu.actions_one.add(BenchmarkProcessor(rate=27136.44))
pc_test.components |= {
data_storage,
RamModule(size=4096, speed=1600),
@ -336,9 +336,9 @@ def test_rate_computer_rate():
# Create a new Computer with components characteristics of pc with id = 1201
pc_test = Desktop(chassis=ComputerChassis.Tower)
data_storage = HardDrive(size=476940)
data_storage.events_one.add(BenchmarkDataStorage(read_speed=158, write_speed=34.7))
data_storage.actions_one.add(BenchmarkDataStorage(read_speed=158, write_speed=34.7))
cpu = Processor(cores=2, speed=3.3)
cpu.events_one.add(BenchmarkProcessor(rate=26339.48))
cpu.actions_one.add(BenchmarkProcessor(rate=26339.48))
pc_test.components |= {
data_storage,
RamModule(size=2048, speed=1333),
@ -363,9 +363,9 @@ def test_rate_computer_rate():
# Create a new Computer with components characteristics of pc with id = 79
pc_test = Desktop(chassis=ComputerChassis.Tower)
data_storage = HardDrive(size=76319)
data_storage.events_one.add(BenchmarkDataStorage(read_speed=72.2, write_speed=24.3))
data_storage.actions_one.add(BenchmarkDataStorage(read_speed=72.2, write_speed=24.3))
cpu = Processor(cores=1, speed=1.6)
cpu.events_one.add(BenchmarkProcessor(rate=3192.34))
cpu.actions_one.add(BenchmarkProcessor(rate=3192.34))
pc_test.components |= {
data_storage,
RamModule(size=512, speed=667),
@ -392,9 +392,9 @@ def test_rate_computer_rate():
# Create a new Computer with components characteristics of pc with id = 798
pc_test = Desktop(chassis=ComputerChassis.Tower)
data_storage = HardDrive(size=152587)
data_storage.events_one.add(BenchmarkDataStorage(read_speed=78.1, write_speed=24.4))
data_storage.actions_one.add(BenchmarkDataStorage(read_speed=78.1, write_speed=24.4))
cpu = Processor(cores=2, speed=2.5)
cpu.events_one.add(BenchmarkProcessor(rate=9974.3))
cpu.actions_one.add(BenchmarkProcessor(rate=9974.3))
pc_test.components |= {
data_storage,
RamModule(size=0, speed=None),

View File

@ -6,8 +6,8 @@ from pathlib import Path
import pytest
from ereuse_devicehub.client import UserClient
from ereuse_devicehub.resources.action.models import Snapshot
from ereuse_devicehub.resources.documents import documents
from ereuse_devicehub.resources.event.models import Snapshot
from tests.conftest import file

View File

@ -11,14 +11,14 @@ from teal.marshmallow import ValidationError
from ereuse_devicehub.client import UserClient
from ereuse_devicehub.db import db
from ereuse_devicehub.devicehub import Devicehub
from ereuse_devicehub.resources.action.models import Action, BenchmarkDataStorage, \
BenchmarkProcessor, EraseSectors, RateComputer, Snapshot, SnapshotRequest, VisualTest
from ereuse_devicehub.resources.device import models as m
from ereuse_devicehub.resources.device.exceptions import NeedsId
from ereuse_devicehub.resources.device.models import SolidStateDrive
from ereuse_devicehub.resources.device.sync import MismatchBetweenProperties, \
MismatchBetweenTagsAndHid
from ereuse_devicehub.resources.enums import ComputerChassis, SnapshotSoftware
from ereuse_devicehub.resources.event.models import BenchmarkDataStorage, BenchmarkProcessor, \
EraseSectors, Event, RateComputer, Snapshot, SnapshotRequest, VisualTest
from ereuse_devicehub.resources.tag import Tag
from ereuse_devicehub.resources.user.models import User
from tests.conftest import file
@ -42,7 +42,7 @@ def test_snapshot_model():
db.session.add(snapshot)
db.session.commit()
device = m.Desktop.query.one() # type: m.Desktop
e1 = device.events[0]
e1 = device.actions[0]
assert isinstance(e1, Snapshot), 'Creation order must be preserved: 1. snapshot, 2. WR'
db.session.delete(device)
db.session.commit()
@ -66,9 +66,9 @@ def test_snapshot_post(user: UserClient):
Tests the post snapshot endpoint (validation, etc), data correctness,
and relationship correctness.
"""
# TODO add all event_types to check, how to add correctly??
# TODO add all action_types to check, how to add correctly??
snapshot = snapshot_and_check(user, file('basic.snapshot'),
event_types=(
action_types=(
BenchmarkProcessor.t,
VisualTest.t,
RateComputer.t
@ -79,7 +79,7 @@ def test_snapshot_post(user: UserClient):
assert snapshot['uuid'] == 'f5efd26e-8754-46bc-87bf-fbccc39d60d9'
assert snapshot['elapsed'] == 4
assert snapshot['author']['id'] == user.user['id']
assert 'events' not in snapshot['device']
assert 'actions' not in snapshot['device']
assert 'author' not in snapshot['device']
device, _ = user.get(res=m.Device, item=snapshot['device']['id'])
key = itemgetter('serialNumber')
@ -89,8 +89,8 @@ def test_snapshot_post(user: UserClient):
assert {c['type'] for c in snapshot['components']} == {m.GraphicCard.t, m.RamModule.t,
m.Processor.t}
rate = next(e for e in snapshot['events'] if e['type'] == RateComputer.t)
rate, _ = user.get(res=Event, item=rate['id'])
rate = next(e for e in snapshot['actions'] if e['type'] == RateComputer.t)
rate, _ = user.get(res=Action, item=rate['id'])
assert rate['device']['id'] == snapshot['device']['id']
rate['components'].sort(key=key)
assert rate['components'] == snapshot['components']
@ -103,13 +103,13 @@ def test_snapshot_component_add_remove(user: UserClient):
All computers generate HID.
"""
def get_events_info(events: List[dict]) -> tuple:
def get_actions_info(actions: List[dict]) -> tuple:
return tuple(
(
e['type'],
[c['serialNumber'] for c in e['components']]
)
for e in user.get_many(res=Event, resources=events, key='id')
for e in user.get_many(res=Action, resources=actions, key='id')
)
# We add the first device (2 times). The distribution of components
@ -118,7 +118,7 @@ def test_snapshot_component_add_remove(user: UserClient):
s1 = file('1-device-with-components.snapshot')
snapshot1 = snapshot_and_check(user,
s1,
event_types=(BenchmarkProcessor.t,),
action_types=(BenchmarkProcessor.t,),
perform_second_snapshot=False)
pc1_id = snapshot1['device']['id']
pc1, _ = user.get(res=m.Device, item=pc1_id)
@ -126,22 +126,22 @@ def test_snapshot_component_add_remove(user: UserClient):
assert tuple(c['serialNumber'] for c in pc1['components']) == ('p1c1s', 'p1c2s', 'p1c3s')
# Components contain parent
assert all(c['parent'] == pc1_id for c in pc1['components'])
# pc has two events: Snapshot and the BenchmarkProcessor
# TODO change assert to len(pc1['events']) == 2 cause we add BenchmarkProcessor event
assert len(pc1['events']) == 2
# TODO pc1['events'][0]['type'] == BenchmarkProcessor.t
assert pc1['events'][1]['type'] == Snapshot.t
# pc has two actions: Snapshot and the BenchmarkProcessor
# TODO change assert to len(pc1['actions']) == 2 cause we add BenchmarkProcessor action
assert len(pc1['actions']) == 2
# TODO pc1['actions'][0]['type'] == BenchmarkProcessor.t
assert pc1['actions'][1]['type'] == Snapshot.t
# p1c1s has Snapshot
p1c1s, _ = user.get(res=m.Device, item=pc1['components'][0]['id'])
assert tuple(e['type'] for e in p1c1s['events']) == ('Snapshot',)
assert tuple(e['type'] for e in p1c1s['actions']) == ('Snapshot',)
# We register a new device
# It has the processor of the first one (p1c2s)
# PC 1: p1c1s, p1c3s. PC 2: p2c1s, p1c2s
# Events PC1: Snapshot, Remove. PC2: Snapshot
# Actions PC1: Snapshot, Remove. PC2: Snapshot
s2 = file('2-second-device-with-components-of-first.snapshot')
# num_events = 2 = Remove, Add
snapshot2 = snapshot_and_check(user, s2, event_types=('Remove',),
# num_actions = 2 = Remove, Add
snapshot2 = snapshot_and_check(user, s2, action_types=('Remove',),
perform_second_snapshot=False)
pc2_id = snapshot2['device']['id']
pc1, _ = user.get(res=m.Device, item=pc1_id)
@ -149,14 +149,14 @@ def test_snapshot_component_add_remove(user: UserClient):
# PC1
assert tuple(c['serialNumber'] for c in pc1['components']) == ('p1c1s', 'p1c3s')
assert all(c['parent'] == pc1_id for c in pc1['components'])
assert tuple(e['type'] for e in pc1['events']) == ('BenchmarkProcessor', 'Snapshot', 'Remove')
assert tuple(e['type'] for e in pc1['actions']) == ('BenchmarkProcessor', 'Snapshot', 'Remove')
# PC2
assert tuple(c['serialNumber'] for c in pc2['components']) == ('p1c2s', 'p2c1s')
assert all(c['parent'] == pc2_id for c in pc2['components'])
assert tuple(e['type'] for e in pc2['events']) == ('Snapshot',)
assert tuple(e['type'] for e in pc2['actions']) == ('Snapshot',)
# 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']) == (
assert tuple(e['type'] for e in p1c2s['actions']) == (
'BenchmarkProcessor', 'Snapshot', 'Snapshot', 'Remove'
)
@ -171,7 +171,7 @@ def test_snapshot_component_add_remove(user: UserClient):
# PC1
assert {c['serialNumber'] for c in pc1['components']} == {'p1c2s', 'p1c3s'}
assert all(c['parent'] == pc1_id for c in pc1['components'])
assert tuple(get_events_info(pc1['events'])) == (
assert tuple(get_actions_info(pc1['actions'])) == (
# id, type, components, snapshot
('BenchmarkProcessor', []), # first BenchmarkProcessor
('Snapshot', ['p1c1s', 'p1c2s', 'p1c3s']), # first Snapshot1
@ -181,13 +181,13 @@ def test_snapshot_component_add_remove(user: UserClient):
# PC2
assert tuple(c['serialNumber'] for c in pc2['components']) == ('p2c1s',)
assert all(c['parent'] == pc2_id for c in pc2['components'])
assert tuple(e['type'] for e in pc2['events']) == (
assert tuple(e['type'] for e in pc2['actions']) == (
'Snapshot', # Second Snapshot
'Remove' # the processor we added in 2.
)
# p1c2s has Snapshot, Remove and Add
p1c2s, _ = user.get(res=m.Device, item=pc1['components'][0]['id'])
assert tuple(get_events_info(p1c2s['events'])) == (
assert tuple(get_actions_info(p1c2s['actions'])) == (
('BenchmarkProcessor', []), # first BenchmarkProcessor
('Snapshot', ['p1c1s', 'p1c2s', 'p1c3s']), # First Snapshot to PC1
('Snapshot', ['p1c2s', 'p2c1s']), # Second Snapshot to PC2
@ -206,7 +206,7 @@ def test_snapshot_component_add_remove(user: UserClient):
assert {c['serialNumber'] for c in pc1['components']} == {'p1c3s', 'p1c4s'}
assert all(c['parent'] == pc1_id for c in pc1['components'])
# This last Snapshot only
assert get_events_info(pc1['events'])[-1] == ('Snapshot', ['p1c3s', 'p1c4s'])
assert get_actions_info(pc1['actions'])[-1] == ('Snapshot', ['p1c3s', 'p1c4s'])
# PC2
# We haven't changed PC2
assert tuple(c['serialNumber'] for c in pc2['components']) == ('p2c1s',)
@ -247,7 +247,7 @@ def test_snapshot_tag_inner_tag(tag_id: str, user: UserClient, app: Devicehub):
b['device']['tags'] = [{'type': 'Tag', 'id': tag_id}]
snapshot_and_check(user, b,
event_types=(RateComputer.t, BenchmarkProcessor.t, VisualTest.t))
action_types=(RateComputer.t, BenchmarkProcessor.t, VisualTest.t))
with app.app_context():
tag = Tag.query.one() # type: Tag
assert tag.device_id == 1, 'Tag should be linked to the first device'
@ -313,19 +313,19 @@ def test_erase_privacy_standards_endtime_sort(user: UserClient):
erasures have always custom endTime value set.
"""
s = file('erase-sectors.snapshot')
assert s['components'][0]['events'][0]['endTime'] == '2018-06-01T09:12:06+02:00'
snapshot = snapshot_and_check(user, s, event_types=(
assert s['components'][0]['actions'][0]['endTime'] == '2018-06-01T09:12:06+02:00'
snapshot = snapshot_and_check(user, s, action_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)
erase = next(e for e in snapshot['actions'] if e['type'] == EraseSectors.t)
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=(
s['components'][0]['actions'][0]['endTime'] = '2018-06-01T07:14:00+00:00'
snapshot = snapshot_and_check(user, s, action_types=(
EraseSectors.t,
BenchmarkDataStorage.t,
BenchmarkProcessor.t
@ -333,17 +333,17 @@ def test_erase_privacy_standards_endtime_sort(user: UserClient):
# 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
storage, _ = user.get(res=m.Device, item=storage['id']) # Let's get storage actions too
# 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']
# erasure1/2 have an user defined time and others actions endTime = created
erasure1, erasure2, benchmark_hdd1, _snapshot1, benchmark_hdd2, _snapshot2 = storage['actions']
assert erasure1['type'] == erasure2['type'] == 'EraseSectors'
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:14:00+00:00'
get_snapshot, _ = user.get(res=Action, item=_snapshot2['id'])
assert get_snapshot['actions'][0]['endTime'] == '2018-06-01T07:14:00+00:00'
assert snapshot == get_snapshot
erasure, _ = user.get(res=Event, item=erasure1['id'])
erasure, _ = user.get(res=Action, item=erasure1['id'])
assert len(erasure['steps']) == 2
assert erasure['steps'][0]['startTime'] == '2018-06-01T06:15:00+00:00'
assert erasure['steps'][0]['endTime'] == '2018-06-01T07:16:00+00:00'
@ -364,7 +364,7 @@ def test_erase_privacy_standards_endtime_sort(user: UserClient):
# Let's try a second erasure with an error
s['uuid'] = uuid4()
s['components'][0]['events'][0]['severity'] = 'Error'
s['components'][0]['actions'][0]['severity'] = 'Error'
snapshot, _ = user.post(s, res=Snapshot)
storage, _ = user.get(res=m.Device, item=storage['id'])
assert storage['hid'] == 'solidstatedrive-c1mr-c1ml-c1s'
@ -378,7 +378,7 @@ def test_test_data_storage(user: UserClient):
s = file('erase-sectors-2-hdd.snapshot')
snapshot, _ = user.post(res=Snapshot, data=s)
incidence_test = next(
ev for ev in snapshot['events']
ev for ev in snapshot['actions']
if ev.get('reallocatedSectorCount', None) == 15
)
assert incidence_test['severity'] == 'Error'
@ -388,14 +388,14 @@ def test_test_data_storage(user: UserClient):
@pytest.mark.xfail(reason='Not implemented yet, new rate is need it')
def test_snapshot_computer_monitor(user: UserClient):
s = file('computer-monitor.snapshot')
snapshot_and_check(user, s, event_types=('ManualRate',))
snapshot_and_check(user, s, action_types=('ManualRate',))
# todo check that ManualRate has generated an AggregateRate
@pytest.mark.xfail(reason='Not implemented yet, new rate is need it')
def test_snapshot_mobile_smartphone_imei_manual_rate(user: UserClient):
s = file('smartphone.snapshot')
snapshot = snapshot_and_check(user, s, event_types=('VisualTest',))
snapshot = snapshot_and_check(user, s, action_types=('VisualTest',))
mobile, _ = user.get(res=m.Device, item=snapshot['device']['id'])
assert mobile['imei'] == 3568680000414120
# todo check that manual rate has been created
@ -443,32 +443,32 @@ def assert_similar_components(components1: List[dict], components2: List[dict]):
def snapshot_and_check(user: UserClient,
input_snapshot: dict,
event_types: Tuple[str, ...] = tuple(),
action_types: Tuple[str, ...] = tuple(),
perform_second_snapshot=True) -> dict:
"""
Performs a Snapshot and then checks if the result is ok:
- There have been performed the types of events and in the same
order as described in the passed-in ``event_types``.
- There have been performed the types of actions and in the same
order as described in the passed-in ``action_types``.
- The inputted devices are similar to the resulted ones.
- There is no Remove event after the first Add.
- There is no Remove action after the first Add.
- All input components are now inside the parent device.
Optionally, it can perform a second Snapshot which should
perform an exact result, except for the events.
perform an exact result, except for the actions.
:return: The last resulting snapshot.
"""
snapshot, _ = user.post(res=Snapshot, data=input_snapshot)
assert all(e['type'] in event_types for e in snapshot['events'])
assert len(snapshot['events']) == len(event_types)
# Ensure there is no Remove event after the first Add
assert all(e['type'] in action_types for e in snapshot['actions'])
assert len(snapshot['actions']) == len(action_types)
# Ensure there is no Remove action after the first Add
found_add = False
for event in snapshot['events']:
if event['type'] == 'Add':
for action in snapshot['actions']:
if action['type'] == 'Add':
found_add = True
if found_add:
assert event['type'] != 'Receive', 'All Remove events must be before the Add ones'
assert action['type'] != 'Receive', 'All Remove actions must be before the Add ones'
assert input_snapshot['device']
assert_similar_device(input_snapshot['device'], snapshot['device'])
if input_snapshot.get('components', None):
@ -478,7 +478,8 @@ def snapshot_and_check(user: UserClient,
if perform_second_snapshot:
if 'uuid' in input_snapshot:
input_snapshot['uuid'] = uuid4()
return snapshot_and_check(user, input_snapshot, event_types, perform_second_snapshot=False)
return snapshot_and_check(user, input_snapshot, action_types,
perform_second_snapshot=False)
else:
return snapshot
@ -487,7 +488,7 @@ def snapshot_and_check(user: UserClient,
@pytest.mark.xfail(reason='Not implemented yet, new rate is need it')
def test_snapshot_keyboard(user: UserClient):
s = file('keyboard.snapshot')
snapshot = snapshot_and_check(user, s, event_types=('ManualRate',))
snapshot = snapshot_and_check(user, s, action_types=('ManualRate',))
keyboard = snapshot['device']
assert keyboard['layout'] == 'ES'

View File

@ -11,10 +11,10 @@ from teal.marshmallow import ValidationError
from ereuse_devicehub.client import UserClient
from ereuse_devicehub.db import db
from ereuse_devicehub.devicehub import Devicehub
from ereuse_devicehub.resources.action.models import Snapshot
from ereuse_devicehub.resources.agent.models import Organization
from ereuse_devicehub.resources.device.models import Desktop, Device
from ereuse_devicehub.resources.enums import ComputerChassis
from ereuse_devicehub.resources.event.models import Snapshot
from ereuse_devicehub.resources.tag import Tag
from ereuse_devicehub.resources.tag.view import CannotCreateETag, LinkedToAnotherDevice, \
TagNotLinked

View File

@ -8,34 +8,33 @@ import pathlib
import pytest
from ereuse_devicehub.client import UserClient
from ereuse_devicehub.resources.action import models as em
from ereuse_devicehub.resources.device.exceptions import NeedsId
from ereuse_devicehub.resources.device.models import Device
from ereuse_devicehub.resources.event import models as em
from ereuse_devicehub.resources.tag.model import Tag
from tests.conftest import file
def test_workbench_server_condensed(user: UserClient):
"""
As :def:`.test_workbench_server_phases` but all the events
As :def:`.test_workbench_server_phases` but all the actions
condensed in only one big ``Snapshot`` file, as described
in the docs.
"""
s = file('workbench-server-1.snapshot')
del s['expectedEvents']
s['device']['events'].append(file('workbench-server-2.stress-test'))
s['components'][4]['events'].extend((
s['device']['actions'].append(file('workbench-server-2.stress-test'))
s['components'][4]['actions'].extend((
file('workbench-server-3.erase'),
file('workbench-server-4.install')
))
s['components'][5]['events'].append(file('workbench-server-3.erase'))
s['components'][5]['actions'].append(file('workbench-server-3.erase'))
# Create tags
for t in s['device']['tags']:
user.post({'id': t['id']}, res=Tag)
snapshot, _ = user.post(res=em.Snapshot, data=s)
events = snapshot['events']
assert {(event['type'], event['device']) for event in events} == {
actions = snapshot['actions']
assert {(action['type'], action['device']) for action in actions} == {
('BenchmarkProcessorSysbench', 5),
('StressTest', 1),
('EraseSectors', 6),
@ -63,9 +62,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'][2]['type'] == 'VisualTest'
assert device['events'][2]['appearanceRange'] == 'A'
assert device['events'][2]['functionalityRange'] == 'B'
assert device['actions'][2]['type'] == 'VisualTest'
assert device['actions'][2]['appearanceRange'] == 'A'
assert device['actions'][2]['functionalityRange'] == 'B'
assert device['tags'][0]['id'] == 'tag1'
@ -74,12 +73,12 @@ def test_workbench_server_phases(user: UserClient):
"""
Tests the phases described in the docs section `Snapshots from
Workbench <http://devicehub.ereuse.org/
events.html#snapshots-from-workbench>`_.
actions.html#snapshots-from-workbench>`_.
"""
# 1. Snapshot with sync / rate / benchmarks / test data storage
s = file('workbench-server-1.snapshot')
snapshot, _ = user.post(res=em.Snapshot, data=s)
assert not snapshot['closed'], 'Snapshot must be waiting for the new events'
assert not snapshot['closed'], 'Snapshot must be waiting for the new actions'
# 2. stress test
st = file('workbench-server-2.stress-test')
@ -102,39 +101,39 @@ def test_workbench_server_phases(user: UserClient):
i['snapshot'], i['device'] = snapshot['id'], ssd_id
install, _ = user.post(res=em.Install, data=i)
# Check events have been appended in Snapshot and devices
# Check actions have been appended in Snapshot and devices
# and that Snapshot is closed
snapshot, _ = user.get(res=em.Snapshot, item=snapshot['id'])
events = snapshot['events']
assert len(events) == 9
assert events[0]['type'] == 'Rate'
assert events[0]['device'] == 1
assert events[0]['closed']
assert events[0]['type'] == 'RateComputer'
assert events[0]['device'] == 1
assert events[1]['type'] == 'BenchmarkProcessor'
assert events[1]['device'] == 5
assert events[2]['type'] == 'BenchmarkProcessorSysbench'
assert events[2]['device'] == 5
assert events[3]['type'] == 'BenchmarkDataStorage'
assert events[3]['device'] == 6
assert events[4]['type'] == 'TestDataStorage'
assert events[4]['device'] == 6
assert events[4]['type'] == 'BenchmarkDataStorage'
assert events[4]['device'] == 7
assert events[5]['type'] == 'StressTest'
assert events[5]['device'] == 1
assert events[6]['type'] == 'EraseSectors'
assert events[6]['device'] == 6
assert events[7]['type'] == 'EraseSectors'
assert events[7]['device'] == 7
assert events[8]['type'] == 'Install'
assert events[8]['device'] == 6
actions = snapshot['actions']
assert len(actions) == 9
assert actions[0]['type'] == 'Rate'
assert actions[0]['device'] == 1
assert actions[0]['closed']
assert actions[0]['type'] == 'RateComputer'
assert actions[0]['device'] == 1
assert actions[1]['type'] == 'BenchmarkProcessor'
assert actions[1]['device'] == 5
assert actions[2]['type'] == 'BenchmarkProcessorSysbench'
assert actions[2]['device'] == 5
assert actions[3]['type'] == 'BenchmarkDataStorage'
assert actions[3]['device'] == 6
assert actions[4]['type'] == 'TestDataStorage'
assert actions[4]['device'] == 6
assert actions[4]['type'] == 'BenchmarkDataStorage'
assert actions[4]['device'] == 7
assert actions[5]['type'] == 'StressTest'
assert actions[5]['device'] == 1
assert actions[6]['type'] == 'EraseSectors'
assert actions[6]['device'] == 6
assert actions[7]['type'] == 'EraseSectors'
assert actions[7]['device'] == 7
assert actions[8]['type'] == 'Install'
assert actions[8]['device'] == 6
assert snapshot['closed']
assert snapshot['severity'] == 'Info'
pc, _ = user.get(res=Device, item=snapshot['id'])
assert len(pc['events']) == 10 # todo shall I add child events?
assert len(pc['actions']) == 10 # todo shall I add child actions?
def test_real_hp_11(user: UserClient):
@ -143,7 +142,7 @@ def test_real_hp_11(user: UserClient):
pc = snapshot['device']
assert pc['hid'] == 'desktop-hewlett-packard-hp_compaq_8100_elite_sff-czc0408yjg'
assert pc['chassis'] == 'Tower'
assert set(e['type'] for e in snapshot['events']) == {
assert set(e['type'] for e in snapshot['actions']) == {
'EreusePrice',
'RateComputer',
'BenchmarkDataStorage',
@ -155,7 +154,7 @@ def test_real_hp_11(user: UserClient):
'TestBios',
'VisualTest'
}
assert len(list(e['type'] for e in snapshot['events'])) == 10
assert len(list(e['type'] for e in snapshot['actions'])) == 10
assert pc['networkSpeeds'] == [1000, None], 'Device has no WiFi'
assert pc['processorModel'] == 'intel core i3 cpu 530 @ 2.93ghz'
assert pc['ramSize'] == 8192
@ -171,7 +170,7 @@ def test_real_toshiba_11(user: UserClient):
def test_snapshot_real_eee_1001pxd_with_rate(user: UserClient):
"""
Checks the values of the device, components,
events and their relationships of a real pc.
actions and their relationships of a real pc.
"""
s = file('real-eee-1001pxd.snapshot.11')
snapshot, _ = user.post(res=em.Snapshot, data=s)
@ -186,8 +185,8 @@ def test_snapshot_real_eee_1001pxd_with_rate(user: UserClient):
assert pc['networkSpeeds'] == [100, 0], 'Although it has WiFi we do not know the speed'
assert pc['rate']
rate = pc['rate']
# assert pc['events'][0]['appearanceRange'] == 'A'
# assert pc['events'][0]['functionalityRange'] == 'B'
# assert pc['actions'][0]['appearanceRange'] == 'A'
# assert pc['actions'][0]['functionalityRange'] == 'B'
# TODO add appearance and functionality Range in device[rate]
assert rate['processorRange'] == 'VERY_LOW'
@ -197,7 +196,7 @@ def test_snapshot_real_eee_1001pxd_with_rate(user: UserClient):
# TODO add camelCase instead of snake_case
assert rate['dataStorage'] == 3.76
assert rate['type'] == 'RateComputer'
# TODO change pc[events] TestBios instead of rate[biosRange]
# TODO change pc[actions] TestBios instead of rate[biosRange]
# assert rate['biosRange'] == 'C'
assert rate['appearance'] == 0, 'appearance B equals 0 points'
# todo fix gets correctly functionality rates values not equals to 0.
@ -223,32 +222,32 @@ def test_snapshot_real_eee_1001pxd_with_rate(user: UserClient):
assert 'hid' not in cpu
assert pc['processorModel'] == cpu['model'] == 'intel atom cpu n455 @ 1.66ghz'
cpu, _ = user.get(res=Device, item=cpu['id'])
events = cpu['events']
sysbench = next(e for e in events if e['type'] == em.BenchmarkProcessorSysbench.t)
actions = cpu['actions']
sysbench = next(e for e in actions if e['type'] == em.BenchmarkProcessorSysbench.t)
assert sysbench['elapsed'] == 164
assert math.isclose(sysbench['rate'], 164, rel_tol=0.001)
assert sysbench['snapshot'] == snapshot['id']
assert sysbench['device'] == cpu['id']
assert sysbench['parent'] == pc['id']
benchmark_cpu = next(e for e in events if e['type'] == em.BenchmarkProcessor.t)
benchmark_cpu = next(e for e in actions if e['type'] == em.BenchmarkProcessor.t)
assert math.isclose(benchmark_cpu['rate'], 6666, rel_tol=0.001)
assert benchmark_cpu['elapsed'] == 0
event_types = tuple(e['type'] for e in events)
assert em.BenchmarkRamSysbench.t in event_types
assert em.StressTest.t in event_types
assert em.Snapshot.t in event_types
assert len(events) == 7
action_types = tuple(e['type'] for e in actions)
assert em.BenchmarkRamSysbench.t in action_types
assert em.StressTest.t in action_types
assert em.Snapshot.t in action_types
assert len(actions) == 7
gpu = components[3]
assert gpu['model'] == 'atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller'
assert gpu['manufacturer'] == 'intel corporation'
assert gpu['memory'] == 256
gpu, _ = user.get(res=Device, item=gpu['id'])
event_types = tuple(e['type'] for e in gpu['events'])
assert em.BenchmarkRamSysbench.t in event_types
assert em.StressTest.t in event_types
assert em.Snapshot.t in event_types
# todo why?? change event types 3 to 5
assert len(event_types) == 5
action_types = tuple(e['type'] for e in gpu['actions'])
assert em.BenchmarkRamSysbench.t in action_types
assert em.StressTest.t in action_types
assert em.Snapshot.t in action_types
# todo why?? change action types 3 to 5
assert len(action_types) == 5
sound = components[4]
assert sound['model'] == 'nm10/ich7 family high definition audio controller'
sound = components[5]
@ -263,16 +262,16 @@ def test_snapshot_real_eee_1001pxd_with_rate(user: UserClient):
assert hdd['interface'] == 'ATA'
assert hdd['size'] == 238475
hdd, _ = user.get(res=Device, item=hdd['id'])
event_types = tuple(e['type'] for e in hdd['events'])
assert em.BenchmarkRamSysbench.t in event_types
assert em.StressTest.t in event_types
assert em.BenchmarkDataStorage.t in event_types
assert em.TestDataStorage.t in event_types
assert em.EraseBasic.t in event_types
assert em.Snapshot.t in event_types
# todo why?? change event types 6 to 8
assert len(event_types) == 8
erase = next(e for e in hdd['events'] if e['type'] == em.EraseBasic.t)
action_types = tuple(e['type'] for e in hdd['actions'])
assert em.BenchmarkRamSysbench.t in action_types
assert em.StressTest.t in action_types
assert em.BenchmarkDataStorage.t in action_types
assert em.TestDataStorage.t in action_types
assert em.EraseBasic.t in action_types
assert em.Snapshot.t in action_types
# todo why?? change action types 6 to 8
assert len(action_types) == 8
erase = next(e for e in hdd['actions'] if e['type'] == em.EraseBasic.t)
assert erase['endTime']
assert erase['startTime']
assert erase['severity'] == 'Info'

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Acer",
"model": "Aspire 5737Z",
"serialNumber": "LXAZ70X0669112B8DB1601",
"events": [],
"actions": [],
"type": "Laptop",
"chassis": "Netbook"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 Duo CPU T6400 @ 2.00GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 2.0,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Western Digital",
"model": "WDC WD5000BEVT-2",
"serialNumber": "WD-WXN209S36759",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 476940,
"interface": null
@ -39,7 +38,7 @@
"manufacturer": "NVIDIA Corporation",
"model": "C79 GeForce 9400M G",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -47,7 +46,7 @@
"manufacturer": "Broadcom Inc. and subsidiaries",
"model": "NetXtreme BCM5764M Gigabit Ethernet PCIe",
"serialNumber": "00:23:5a:5f:6b:8d",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -56,7 +55,7 @@
"manufacturer": "Qualcomm Atheros",
"model": "AR928X Wireless Network Adapter",
"serialNumber": "00:24:2b:d3:dd:19",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": true
},
@ -64,21 +63,21 @@
"manufacturer": "Chicony Electronics Co., Ltd.",
"model": "CNF7017",
"serialNumber": "SN0001",
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "NVIDIA Corporation",
"model": "MCP79 High Definition Audio",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 4,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "ASUS",
"model": "All Series",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i5-4440 CPU @ 3.10GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 3.299993,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Kingston",
"model": "99U5584-003.A00LF",
"serialNumber": "290E5155",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 4096,
@ -41,7 +40,7 @@
"manufacturer": "Western Digital",
"model": "WDC WD5000AAKX-0",
"serialNumber": "WD-WMC2E8912230",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 476940,
"interface": null
@ -50,7 +49,7 @@
"manufacturer": "Intel Corporation",
"model": "Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -58,7 +57,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "40:16:7e:64:11:7f",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -67,14 +66,14 @@
"manufacturer": "Intel Corporation",
"model": "8 Series/C220 Series Chipset High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "ASUSTeK COMPUTER INC.",
"model": "H81M-K",
"serialNumber": "140322933901299",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 3,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "ASUS",
"model": "All Series",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i5-4440 CPU @ 3.10GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 1.4710990000000002,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Kingston",
"model": "9905584-017.A00LF",
"serialNumber": "9D341297",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 4096,
@ -41,7 +40,7 @@
"manufacturer": "Western Digital",
"model": "WDC WD5000AAKX-0",
"serialNumber": "WD-WCC2EVE36697",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 476940,
"interface": null
@ -50,7 +49,7 @@
"manufacturer": "Intel Corporation",
"model": "Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -58,7 +57,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "e0:3f:49:1a:cf:8d",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -67,14 +66,14 @@
"manufacturer": "Intel Corporation",
"model": "8 Series/C220 Series Chipset High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "ASUSTeK COMPUTER INC.",
"model": "H81M-K",
"serialNumber": "131219772601126",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 3,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Celeron CPU N3050 @ 1.60GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 0.47998,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Kingston",
"model": "99U5469-044.A00LF",
"serialNumber": "17220285",
"events": [],
"actions": [],
"type": "RamModule",
"format": "SODIMM",
"size": 4096,
@ -41,7 +40,7 @@
"manufacturer": "Toshiba",
"model": "THNSNS12",
"serialNumber": "Y2IS101GT4BY",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 122104,
"interface": null
@ -50,7 +49,7 @@
"manufacturer": "Intel Corporation",
"model": "Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -58,7 +57,7 @@
"manufacturer": "Intel Corporation",
"model": "Wireless 3165",
"serialNumber": "34:02:86:5b:47:b2",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": true
},
@ -66,7 +65,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "b8:ae:ed:76:91:83",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -75,14 +74,14 @@
"manufacturer": "Intel Corporation",
"model": "Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Intel Corporation",
"model": "NUC5CPYB",
"serialNumber": "GEPY523011FH",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 1,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 CPU 6600 @ 2.40GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 2.394,
"address": 64,
@ -29,7 +28,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 1024,
@ -40,7 +39,7 @@
"manufacturer": null,
"model": "SAMSUNG HD250HJ",
"serialNumber": "S0URJDQP811025",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 238475,
"interface": null
@ -49,7 +48,7 @@
"manufacturer": "Intel Corporation",
"model": "82G965 Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -57,7 +56,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "00:1b:fc:30:75:09",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -66,14 +65,14 @@
"manufacturer": "Intel Corporation",
"model": "82801H HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "ASUSTeK Computer INC.",
"model": "P5B-VM",
"serialNumber": "MB-1234567890",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 7,
"firewire": 1,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "ASUS",
"model": "All Series",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i5-4440 CPU @ 3.10GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 3.1001890000000003,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Kingston",
"model": "9905584-017.A00LF",
"serialNumber": "9D341297",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 4096,
@ -41,7 +40,7 @@
"manufacturer": "Western Digital",
"model": "WDC WD5000AAKX-0",
"serialNumber": "WD-WCC2EVE36697",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 476940,
"interface": null
@ -50,7 +49,7 @@
"manufacturer": "Intel Corporation",
"model": "Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -58,7 +57,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "e0:3f:49:1a:cf:8d",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -67,14 +66,14 @@
"manufacturer": "Intel Corporation",
"model": "8 Series/C220 Series Chipset High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "ASUSTeK COMPUTER INC.",
"model": "H81M-K",
"serialNumber": "131219772601126",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 3,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Dell Inc.",
"model": "Latitude E5530 non-vPro",
"serialNumber": "D8FTRY1",
"events": [],
"actions": [],
"type": "Laptop",
"chassis": "Laptop"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i5-3340M CPU @ 2.70GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 1.204321,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Micron",
"model": "8KTF51264HZ-1G6E1",
"serialNumber": "E88F671D",
"events": [],
"actions": [],
"type": "RamModule",
"format": "SODIMM",
"size": 4096,
@ -41,7 +40,7 @@
"manufacturer": "Micron",
"model": "8KTF51264HZ-1G6E1",
"serialNumber": "E88F671E",
"events": [],
"actions": [],
"type": "RamModule",
"format": "SODIMM",
"size": 4096,
@ -52,7 +51,7 @@
"manufacturer": null,
"model": "HGST HTS725050A7",
"serialNumber": "TF755AWHKL0LHM",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 476940,
"interface": null
@ -61,7 +60,7 @@
"manufacturer": "Intel Corporation",
"model": "3rd Gen Core processor Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -69,7 +68,7 @@
"manufacturer": "Broadcom Limited",
"model": "BCM43228 802.11a/b/g/n",
"serialNumber": null,
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": false
},
@ -77,7 +76,7 @@
"manufacturer": "Broadcom Limited",
"model": "NetXtreme BCM5761 Gigabit Ethernet PCIe",
"serialNumber": "f0:1f:af:41:3f:18",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -86,21 +85,21 @@
"manufacturer": "CN0Y4TWT7248737FA56RA01",
"model": "Laptop_Integrated_Webcam_E4HD",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Intel Corporation",
"model": "7 Series/C216 Chipset Family High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Dell Inc.",
"model": "0VP63H",
"serialNumber": "/D8FTRY1/CN1296139I001F/",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 3,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 CPU 6600 @ 2.40GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 2.394,
"address": 64,
@ -29,7 +28,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 1024,
@ -40,7 +39,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 1024,
@ -51,7 +50,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 1024,
@ -62,7 +61,7 @@
"manufacturer": null,
"model": "SAMSUNG HD250HJ",
"serialNumber": "S0URJDQP811025",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 238475,
"interface": null
@ -71,7 +70,7 @@
"manufacturer": "Intel Corporation",
"model": "82G965 Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -79,7 +78,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "00:1b:fc:30:75:09",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -88,14 +87,14 @@
"manufacturer": "Intel Corporation",
"model": "82801H HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "ASUSTeK Computer INC.",
"model": "P5B-VM",
"serialNumber": "MB-1234567890",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 7,
"firewire": 1,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "ASUS",
"model": "All Series",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i5-4440 CPU @ 3.10GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 2.200311,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Kingston",
"model": "99U5584-003.A00LF",
"serialNumber": "8618F309",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 4096,
@ -41,7 +40,7 @@
"manufacturer": "Western Digital",
"model": "WDC WD5000AAKX-6",
"serialNumber": "WD-WCC2ETY84203",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 476940,
"interface": null
@ -50,7 +49,7 @@
"manufacturer": "Intel Corporation",
"model": "Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -58,7 +57,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "e0:3f:49:1a:d0:44",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -67,14 +66,14 @@
"manufacturer": "Intel Corporation",
"model": "8 Series/C220 Series Chipset High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "ASUSTeK COMPUTER INC.",
"model": "H81M-K",
"serialNumber": "131219772601195",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 3,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "ASUSTeK Computer INC.",
"model": "1000H",
"serialNumber": "8BOAAQ191999",
"events": [],
"actions": [],
"type": "Laptop",
"chassis": "Netbook"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Atom CPU N270 @ 1.60GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 1.6,
"address": 32,
@ -29,7 +28,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -39,7 +38,7 @@
"manufacturer": null,
"model": "TS32GSSD370S",
"serialNumber": "C304332411",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 30533,
"interface": null
@ -48,7 +47,7 @@
"manufacturer": "Intel Corporation",
"model": "Mobile 945GSE Express Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -56,7 +55,7 @@
"manufacturer": "Qualcomm Atheros",
"model": "AR8121/AR8113/AR8114 Gigabit or Fast Ethernet",
"serialNumber": "00:23:54:8d:be:66",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 100,
"wireless": false
@ -65,7 +64,7 @@
"manufacturer": "Ralink corp.",
"model": "RT2790 Wireless 802.11n 1T/2R PCIe",
"serialNumber": "00:15:af:dc:44:eb",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": true
},
@ -73,21 +72,21 @@
"manufacturer": "Intel Corporation",
"model": "NM10/ICH7 Family High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Chicony Electronics Co., Ltd.",
"model": "CNF7129",
"serialNumber": "SN0001",
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "ASUSTeK Computer INC.",
"model": "1000H",
"serialNumber": "Eee0123456789",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 5,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Hewlett-Packard",
"model": "HP Compaq dc7900 Small Form Factor",
"serialNumber": "CZC901381R",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 Duo CPU E8400 @ 3.00GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 3.0,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "JEDEC ID:AD 00 00 00 00 00 00 00",
"model": "HYMP125U64CP8-S6",
"serialNumber": "01200000",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -41,7 +40,7 @@
"manufacturer": "Seagate",
"model": "ST3160815AS",
"serialNumber": "6RX7AWEZ",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 152627,
"interface": null
@ -50,7 +49,7 @@
"manufacturer": "Intel Corporation",
"model": "4 Series Chipset Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -58,7 +57,7 @@
"manufacturer": "Intel Corporation",
"model": "82567LM-3 Gigabit Network Connection",
"serialNumber": "00:23:7d:49:5e:31",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -67,7 +66,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8169 PCI Gigabit Ethernet Controller",
"serialNumber": "00:b0:c2:02:ab:b7",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -76,14 +75,14 @@
"manufacturer": "Intel Corporation",
"model": "82801JD/DO HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Hewlett-Packard",
"model": "3031h",
"serialNumber": "CZC901381R",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 8,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Hewlett-Packard",
"model": "HP Compaq 8100 Elite SFF",
"serialNumber": "CZC0408YPV",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i3 CPU 530 @ 2.93GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 2.9330000000000003,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "JEDEC ID:80 2C",
"model": "16JTF25664AZ-1G4F",
"serialNumber": "92072F30",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -41,7 +40,7 @@
"manufacturer": "JEDEC ID:80 2C",
"model": "16JTF25664AZ-1G4F",
"serialNumber": "A4482E29",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -52,7 +51,7 @@
"manufacturer": "JEDEC ID:80 2C",
"model": "16JTF25664AZ-1G4F",
"serialNumber": "939E2E29",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -63,7 +62,7 @@
"manufacturer": "JEDEC ID:80 2C",
"model": "16JTF25664AZ-1G4F",
"serialNumber": "48FD2E30",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -74,7 +73,7 @@
"manufacturer": "Western Digital",
"model": "WDC WD3200AAJS-6",
"serialNumber": "WD-WCAV2U856544",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 305245,
"interface": null
@ -83,7 +82,7 @@
"manufacturer": "Intel Corporation",
"model": "Core Processor Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -91,7 +90,7 @@
"manufacturer": "Intel Corporation",
"model": "82578DM Gigabit Network Connection",
"serialNumber": "6c:62:6d:81:4d:ae",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -100,14 +99,14 @@
"manufacturer": "Intel Corporation",
"model": "5 Series/3400 Series Chipset High Definition Audio",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Hewlett-Packard",
"model": "304Ah",
"serialNumber": "CZC0408YPV",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 2,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Hewlett-Packard",
"model": "Pavilion dv4000",
"serialNumber": "2CE5270ZWC",
"events": [],
"actions": [],
"type": "Laptop",
"chassis": "Netbook"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Pentium M processor 1.60GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 1.6,
"address": 32,
@ -29,7 +28,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 512,
@ -39,7 +38,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 512,
@ -49,7 +48,7 @@
"manufacturer": "Fujitsu",
"model": "MHT2080A",
"serialNumber": "NN4FT561BDC2",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 76319,
"interface": null
@ -58,7 +57,7 @@
"manufacturer": "Intel Corporation",
"model": "Mobile 915GM/GMS/910GML Express Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -66,7 +65,7 @@
"manufacturer": "Intel Corporation",
"model": "PRO/Wireless 2200BG Calexico2 Network Connection",
"serialNumber": "00:12:f0:c7:68:51",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": true
},
@ -74,7 +73,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL-8100/8101L/8139 PCI Fast Ethernet Adapter",
"serialNumber": "00:0a:e4:d4:71:82",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 100,
"wireless": false
@ -83,14 +82,14 @@
"manufacturer": "Intel Corporation",
"model": "82801FB/FBM/FR/FW/FRW AC'97 Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Hewlett-Packard",
"model": "09BC",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 5,
"firewire": 1,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "LENOVO",
"model": "7220W3T",
"serialNumber": "S4R6062",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 Duo CPU E8400 @ 3.00GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 3.0,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -41,7 +40,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -52,7 +51,7 @@
"manufacturer": "Seagate",
"model": "ST3250318AS",
"serialNumber": "6VY54ZKX",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 238475,
"interface": null
@ -61,7 +60,7 @@
"manufacturer": "Intel Corporation",
"model": "4 Series Chipset Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -69,7 +68,7 @@
"manufacturer": "Intel Corporation",
"model": "82567LM-3 Gigabit Network Connection",
"serialNumber": "00:24:7e:02:19:d7",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -78,14 +77,14 @@
"manufacturer": "Intel Corporation",
"model": "82801JD/DO HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "LENOVO",
"model": "LENOVO",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 8,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "LENOVO",
"model": "7220W3T",
"serialNumber": "S4R6460",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 Duo CPU E8400 @ 3.00GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 3.0,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -41,7 +40,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -52,7 +51,7 @@
"manufacturer": null,
"model": "SAMSUNG HD251HJ",
"serialNumber": "S1L6J9BZ103714",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 238475,
"interface": null
@ -61,7 +60,7 @@
"manufacturer": "Intel Corporation",
"model": "4 Series Chipset Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -69,7 +68,7 @@
"manufacturer": "Intel Corporation",
"model": "82567LM-3 Gigabit Network Connection",
"serialNumber": "00:24:7e:02:15:1a",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -78,14 +77,14 @@
"manufacturer": "Intel Corporation",
"model": "82801JD/DO HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "LENOVO",
"model": "LENOVO",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 8,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "LENOVO",
"model": "3493BAG",
"serialNumber": "PB357N0",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Pentium CPU G645 @ 2.90GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 1.674792,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Micron",
"model": "16JTF25664AZ-1G4F1",
"serialNumber": "292E48DA",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -41,7 +40,7 @@
"manufacturer": "Seagate",
"model": "ST250DM000-1BD14",
"serialNumber": "Z2AYPLNP",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 238475,
"interface": null
@ -50,7 +49,7 @@
"manufacturer": "Intel Corporation",
"model": "2nd Generation Core Processor Family Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -58,7 +57,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "d4:3d:7e:41:c4:c4",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -67,14 +66,14 @@
"manufacturer": "Intel Corporation",
"model": "6 Series/C200 Series Chipset Family High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "LENOVO",
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 2,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "LENOVO",
"model": "7220W3T",
"serialNumber": "S4WV119",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 Duo CPU E8400 @ 3.00GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 3.0,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -41,7 +40,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -52,7 +51,7 @@
"manufacturer": "Seagate",
"model": "ST3250318AS",
"serialNumber": "6VY52H7X",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 238475,
"interface": null
@ -61,7 +60,7 @@
"manufacturer": "Intel Corporation",
"model": "4 Series Chipset Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -69,7 +68,7 @@
"manufacturer": "Intel Corporation",
"model": "82567LM-3 Gigabit Network Connection",
"serialNumber": "1c:6f:65:03:fd:c4",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -78,14 +77,14 @@
"manufacturer": "Intel Corporation",
"model": "82801JD/DO HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "LENOVO",
"model": "LENOVO",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 8,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "NEC Computers SAS",
"model": "Powermate MLxxx",
"serialNumber": "SN 123456789ABC",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 Duo CPU E8400 @ 3.00GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 3.0,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Samsung",
"model": "M3 78T2863QZS-CE6",
"serialNumber": "253C8F0C",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 1024,
@ -41,7 +40,7 @@
"manufacturer": "Samsung",
"model": "M3 78T2863QZS-CE6",
"serialNumber": "253C8DE7",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 1024,
@ -52,7 +51,7 @@
"manufacturer": "Hitachi",
"model": "HDT72103",
"serialNumber": "STA2L7MV39LL6D",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 305245,
"interface": null
@ -61,7 +60,7 @@
"manufacturer": "Intel Corporation",
"model": "82Q35 Express Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -69,7 +68,7 @@
"manufacturer": "Intel Corporation",
"model": "82566DM-2 Gigabit Network Connection",
"serialNumber": "00:24:21:7a:90:02",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -78,14 +77,14 @@
"manufacturer": "Intel Corporation",
"model": "82801I HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Micro-Star International Co Ltd",
"model": "MS-7377",
"serialNumber": "9516777584",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 8,
"firewire": 1,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i3-2100 CPU @ 3.10GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 1.6862300000000001,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Kingston",
"model": "9905403-038.A00LF",
"serialNumber": "8F17943",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 4096,
@ -41,7 +40,7 @@
"manufacturer": "Seagate",
"model": "ST3500413AS",
"serialNumber": "Z2A3HR7N",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 476940,
"interface": null
@ -50,7 +49,7 @@
"manufacturer": "Intel Corporation",
"model": "2nd Generation Core Processor Family Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -58,7 +57,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "f4:6d:04:12:9b:85",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -67,14 +66,14 @@
"manufacturer": "Intel Corporation",
"model": "6 Series/C200 Series Chipset Family High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "ASUSTeK Computer INC.",
"model": "P8H61-M LE",
"serialNumber": "109192430003459",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 2,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Dell Inc.",
"model": "OptiPlex 745",
"serialNumber": "HQ5583J",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 CPU 6400 @ 2.13GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 2.133,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Infineon",
"model": "64T128020HU3SB",
"serialNumber": "07129114",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 1024,
@ -41,7 +40,7 @@
"manufacturer": "Infineon",
"model": "64T128020HU3SB",
"serialNumber": "07127E11",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 1024,
@ -52,7 +51,7 @@
"manufacturer": "Western Digital",
"model": "WDC WD3200AAKS-7",
"serialNumber": "WD-WMAV2W580992",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 305245,
"interface": null
@ -61,7 +60,7 @@
"manufacturer": "Intel Corporation",
"model": "82Q963/Q965 Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -69,7 +68,7 @@
"manufacturer": "Broadcom Limited",
"model": "NetXtreme BCM5754 Gigabit Ethernet PCI Express",
"serialNumber": "00:1a:a0:e0:60:62",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -78,14 +77,14 @@
"manufacturer": "Intel Corporation",
"model": "82801H HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Dell Inc.",
"model": "0HP962",
"serialNumber": "..CN137407AJ02SW.",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 7,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Dell Inc.",
"model": "OptiPlex GX520",
"serialNumber": "6G0772J",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Pentium 4 CPU 3.00GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 3.0,
"address": 64,
@ -29,7 +28,7 @@
"manufacturer": "Nanya Technology",
"model": "NT512T64U88A0BY-37",
"serialNumber": "197312A4",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 512,
@ -40,7 +39,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 512,
@ -51,7 +50,7 @@
"manufacturer": "Seagate",
"model": "ST3808110AS",
"serialNumber": "5LR30DTZ",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 76293,
"interface": null
@ -60,7 +59,7 @@
"manufacturer": "Intel Corporation",
"model": "82945G/GZ Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -68,7 +67,7 @@
"manufacturer": "Broadcom Limited",
"model": "NetXtreme BCM5751 Gigabit Ethernet PCI Express",
"serialNumber": "00:13:72:78:53:12",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -77,14 +76,14 @@
"manufacturer": "Intel Corporation",
"model": "82801G AC'97 Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Dell Inc.",
"model": "0UG982",
"serialNumber": "..CN1374063201S5.",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 5,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Hewlett-Packard",
"model": "HP Compaq dc7900 Small Form Factor",
"serialNumber": "CZC901381R",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core2 Duo CPU E8400 @ 3.00GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 3.0,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "JEDEC ID:AD 00 00 00 00 00 00 00",
"model": "HYMP125U64CP8-S6",
"serialNumber": "01200000",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -41,7 +40,7 @@
"manufacturer": "Seagate",
"model": "ST3160815AS",
"serialNumber": "6RX7AWEZ",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 152627,
"interface": null
@ -50,7 +49,7 @@
"manufacturer": "Intel Corporation",
"model": "4 Series Chipset Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -58,7 +57,7 @@
"manufacturer": "Intel Corporation",
"model": "82567LM-3 Gigabit Network Connection",
"serialNumber": "00:23:7d:49:5e:31",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -67,7 +66,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8169 PCI Gigabit Ethernet Controller",
"serialNumber": "00:b0:c2:02:ab:b7",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -76,14 +75,14 @@
"manufacturer": "Intel Corporation",
"model": "82801JD/DO HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Hewlett-Packard",
"model": "3031h",
"serialNumber": "CZC901381R",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 8,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "TOSHIBA",
"model": "PORTEGE R700",
"serialNumber": "YA059622H",
"events": [],
"actions": [],
"type": "Laptop",
"chassis": "Netbook"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i5 CPU M 560 @ 2.67GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 1.199,
"address": 64,
@ -29,7 +28,7 @@
"manufacturer": "Samsung",
"model": "M471B5773CHS-CH9",
"serialNumber": "67900CDD",
"events": [],
"actions": [],
"type": "RamModule",
"format": "SODIMM",
"size": 2048,
@ -40,7 +39,7 @@
"manufacturer": "Hitachi",
"model": "HTS54505",
"serialNumber": "101022PBN40317KS46YE",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 476940,
"interface": null
@ -49,7 +48,7 @@
"manufacturer": "Intel Corporation",
"model": "Core Processor Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -57,7 +56,7 @@
"manufacturer": "Intel Corporation",
"model": "82577LM Gigabit Network Connection",
"serialNumber": "00:23:18:02:0d:94",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -66,7 +65,7 @@
"manufacturer": "Intel Corporation",
"model": "Centrino Advanced-N 6200",
"serialNumber": "00:27:10:cd:5e:44",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": true
},
@ -74,7 +73,7 @@
"manufacturer": null,
"model": null,
"serialNumber": "02:80:37:ec:02:00",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": false
},
@ -82,21 +81,21 @@
"manufacturer": "Realtek",
"model": "2SF001",
"serialNumber": "0x0001",
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Intel Corporation",
"model": "5 Series/3400 Series Chipset High Definition Audio",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "TOSHIBA",
"model": "Portable PC",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 2,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "innotek GmbH",
"model": "VirtualBox",
"serialNumber": "0",
"events": [],
"actions": [],
"type": "Computer",
"chassis": "Virtual"
},
@ -19,7 +18,7 @@
"manufacturer": null,
"model": "VBOX HARDDISK",
"serialNumber": "VBd9783eb3-8ef7f22a",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 76856,
"interface": null
@ -28,7 +27,7 @@
"manufacturer": "Intel Corporation",
"model": "82540EM Gigabit Ethernet Controller",
"serialNumber": "08:00:27:43:d0:65",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -37,7 +36,7 @@
"manufacturer": "Oracle Corporation",
"model": "VirtualBox",
"serialNumber": "0",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 1,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "innotek GmbH",
"model": "VirtualBox",
"serialNumber": "0",
"events": [],
"actions": [],
"type": "Computer",
"chassis": "Virtual"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corporation",
"model": "82540EM Gigabit Ethernet Controller",
"serialNumber": "08:00:27:53:cb:af",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -28,14 +27,14 @@
"manufacturer": "Intel Corporation",
"model": "82801AA AC'97 Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Oracle Corporation",
"model": "VirtualBox",
"serialNumber": "0",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 2,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "innotek GmbH",
"model": "VirtualBox",
"serialNumber": "0",
"events": [],
"actions": [],
"type": "Computer",
"chassis": "Virtual"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corporation",
"model": "82540EM Gigabit Ethernet Controller",
"serialNumber": "08:00:27:53:cb:af",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -28,14 +27,14 @@
"manufacturer": "Intel Corporation",
"model": "82801AA AC'97 Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Oracle Corporation",
"model": "VirtualBox",
"serialNumber": "0",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 2,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Dell Inc.",
"model": "Vostro 260",
"serialNumber": "1Q63F5J",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i3-2120 CPU @ 3.30GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 1.6709470000000002,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Micron",
"model": "8JTF25664AZ-1G4M1",
"serialNumber": "E192532D",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -41,7 +40,7 @@
"manufacturer": "Micron",
"model": "8JTF25664AZ-1G4M1",
"serialNumber": "E192532C",
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -52,7 +51,7 @@
"manufacturer": "Seagate",
"model": "ST500DM002-1BD14",
"serialNumber": "Z2AYS308",
"events": [],
"actions": [],
"type": "HardDrive",
"size": 476940,
"interface": null
@ -61,7 +60,7 @@
"manufacturer": "Intel Corporation",
"model": "2nd Generation Core Processor Family Integrated Graphics Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -69,7 +68,7 @@
"manufacturer": "Realtek Semiconductor Co., Ltd.",
"model": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"serialNumber": "d4:be:d9:ec:2d:ea",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -78,14 +77,14 @@
"manufacturer": "Intel Corporation",
"model": "6 Series/C200 Series Chipset Family High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Dell Inc.",
"model": "0GDG8Y",
"serialNumber": "..CN70163257067Z.",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 2,
"firewire": 0,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "LENOVO",
"model": "415522G",
"serialNumber": "S4T6208",
"events": [],
"actions": [],
"type": "Desktop",
"chassis": "Tower"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Xeon CPU E5520 @ 2.27GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 1.729,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -41,7 +40,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -52,7 +51,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -63,7 +62,7 @@
"manufacturer": null,
"model": null,
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "DIMM",
"size": 2048,
@ -74,7 +73,7 @@
"manufacturer": "NVIDIA Corporation",
"model": "GT200GL Quadro FX 3800",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -82,7 +81,7 @@
"manufacturer": "NVIDIA Corporation",
"model": "GF100GL Quadro 4000",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -90,7 +89,7 @@
"manufacturer": "Broadcom Limited",
"model": "NetXtreme BCM5755 Gigabit Ethernet PCI Express",
"serialNumber": "00:27:13:53:ec:62",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -99,7 +98,7 @@
"manufacturer": "Broadcom Limited",
"model": "NetXtreme BCM5754 Gigabit Ethernet PCI Express",
"serialNumber": "00:27:13:53:ec:63",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"speed": 1000,
"wireless": false
@ -108,21 +107,21 @@
"manufacturer": "NVIDIA Corporation",
"model": "GF100 High Definition Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Intel Corporation",
"model": "82801JI HD Audio Controller",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "LENOVO",
"model": "LENOVO",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 8,
"firewire": 1,

View File

@ -3,14 +3,13 @@
"uuid": "00000000-0000-0000-0000-000000000000",
"software": "Workbench",
"version": "11.0a1",
"expectedEvents": [],
"closed": false,
"endTime": "2000-01-01 00:00:00+00:00",
"device": {
"manufacturer": "Timi",
"model": "TM1613",
"serialNumber": "13138/00064437",
"events": [],
"actions": [],
"type": "Laptop",
"chassis": "Netbook"
},
@ -19,7 +18,7 @@
"manufacturer": "Intel Corp.",
"model": "Intel Core i5-6200U CPU @ 2.30GHz",
"serialNumber": null,
"events": [],
"actions": [],
"type": "Processor",
"speed": 2.684156,
"address": 64,
@ -30,7 +29,7 @@
"manufacturer": "Samsung",
"model": "M471A1K43BB0-CPB",
"serialNumber": null,
"events": [],
"actions": [],
"type": "RamModule",
"format": "SODIMM",
"size": 8192,
@ -40,7 +39,7 @@
"manufacturer": "Intel Corporation",
"model": "Sky Lake Integrated Graphics",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -48,7 +47,7 @@
"manufacturer": "NVIDIA Corporation",
"model": "NVIDIA Corporation",
"serialNumber": null,
"events": [],
"actions": [],
"type": "GraphicCard",
"memory": null
},
@ -56,7 +55,7 @@
"manufacturer": "Intel Corporation",
"model": "Wireless 8260",
"serialNumber": "a0:c5:89:41:a8:a7",
"events": [],
"actions": [],
"type": "NetworkAdapter",
"wireless": true
},
@ -64,21 +63,21 @@
"manufacturer": "SunplusIT Inc",
"model": "XiaoMi USB 2.0 Webcam",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Intel Corporation",
"model": "Intel Corporation",
"serialNumber": null,
"events": [],
"actions": [],
"type": "SoundCard"
},
{
"manufacturer": "Timi",
"model": "TM1613",
"serialNumber": "MMG5S000000226B1P02YK",
"events": [],
"actions": [],
"type": "Motherboard",
"usb": 1,
"firewire": 0,