Merge branch 'testing' into changes/4025-new-hid

This commit is contained in:
Cayo Puigdefabregas 2022-12-15 16:17:09 +01:00
commit b3b4e8cd2b
7 changed files with 27 additions and 7 deletions

View File

@ -90,7 +90,9 @@ class SnapshotsLog(Thing):
settings_version = self.snapshot.settings_version or ''
settings_version = "".join([x[0] for x in settings_version.split(' ') if x])
return "{} ({})".format(self.version, settings_version)
if settings_version:
return "{} ({})".format(self.version, settings_version)
return "{}".format(self.version)
class PlaceholdersLog(Thing):

View File

@ -343,6 +343,7 @@ class ParseSnapshotLsHw:
"components": self.components,
"uuid": snapshot['uuid'],
"version": "14.0.0",
"settings_version": snapshot.get("settings_version"),
"endTime": snapshot["timestamp"],
"elapsed": 1,
"sid": snapshot["sid"],

View File

@ -22,6 +22,7 @@ class Snapshot_lite(Thing):
sid = String(required=True)
type = String(required=True)
timestamp = String(required=True)
settings_version = String(required=False)
data = Nested(Snapshot_lite_data, required=True)
@validates_schema

View File

@ -14,7 +14,7 @@ WB_SMART_TEST = short
WB_ERASE = EraseBasic
WB_ERASE_STEPS = 1
WB_ERASE_LEADING_ZEROS = False
VERSION = "Basic Erasure (BE)"
VERSION = Basic Erasure (BE)
{% elif baseline_erease %}
DH_HOST = {{ api_host }}
@ -28,11 +28,11 @@ WB_SMART_TEST = short
WB_ERASE = EraseSectors
WB_ERASE_STEPS = {{ erase_steps }}
WB_ERASE_LEADING_ZEROS = True
VERSION = {%if erase_steps < 3 %}"Baseline Secure Erasure (BSE)"{% else %}"Enhanced Secure Erasure (ESE)"{% endif %}
VERSION = {%if erase_steps < 3 %}Baseline Secure Erasure (BSE){% else %}Enhanced Secure Erasure (ESE){% endif %}
{% else %}
SNAPSHOTS_PATH = /mnt
LOGS_PATH = /mnt
VERSION = "Basic Metadata (BM)"
VERSION = Basic Metadata (BM)
{% endif %}

View File

@ -1,14 +1,14 @@
isos = {
"demo": {
'iso': "USODY_2022.8.0-Demo.iso",
'url': 'http://releases.usody.com/demo/',
'url': 'https://releases.usody.com/demo/',
},
"register": {
'iso': "USODY_2022.8.0-beta.iso",
'url': 'http://releases.usody.com/2022/',
'url': 'https://releases.usody.com/2022/',
},
"erease": {
'iso': "USODY_14.0.0.iso",
'url': 'http://releases.usody.com/v14/',
'url': 'https://releases.usody.com/v14/',
},
}

View File

@ -6,6 +6,7 @@
"software": "Workbench",
"version": "2022.03.00",
"schema_api": "1.0.0",
"settings_version": "Basic Metadata",
"data": {
"lspci": "",
"lshw": {

View File

@ -1413,3 +1413,18 @@ def test_bug_4028_components(user: UserClient):
for c in m.Device.query.filter():
assert c.binding or c.placeholder
@pytest.mark.mvp
@pytest.mark.usefixtures(conftest.app_context.__name__)
def test_settings_version(user: UserClient):
"""Tests when we have one computer and then we change the disk, then
the new disk need to have placeholder too."""
s = file_json("2022-03-31_17h18m51s_ZQMPKKX51K67R68VO2X9RNZL08JPL_snapshot.json")
body, res = user.post(s, uri="/api/inventory/")
assert m.Computer.query.first().dhid == body['dhid']
snapshot = Snapshot.query.first()
log = SnapshotsLog.query.first()
assert log.get_version() == "14.0 (BM)"
assert snapshot.settings_version == "Basic Metadata"