Accept ARNavi VPS 0.2.0 through the existing client contract
This commit is contained in:
@@ -63,6 +63,7 @@ def apply(hosts, identifier, revision):
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
)
|
)
|
||||||
or time.time() - host["last_sync_at"] > 30
|
or time.time() - host["last_sync_at"] > 30
|
||||||
):
|
):
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ def enqueue(hosts, identifier, request_id, preset_id):
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
}:
|
}:
|
||||||
raise EquipmentError("Подключите проверенную версию VPS Host с поддержкой очереди.")
|
raise EquipmentError("Подключите проверенную версию VPS Host с поддержкой очереди.")
|
||||||
count = db.execute(
|
count = db.execute(
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
automatic_access = None
|
automatic_access = None
|
||||||
@@ -325,6 +326,7 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
}:
|
}:
|
||||||
raise EquipmentError("Для разрешения обеих SIM установите актуальный VPS Host.")
|
raise EquipmentError("Для разрешения обеих SIM установите актуальный VPS Host.")
|
||||||
if body["kind"] == "select-sim" and source.get("status", {}).get("version") not in {
|
if body["kind"] == "select-sim" and source.get("status", {}).get("version") not in {
|
||||||
@@ -351,6 +353,7 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
}:
|
}:
|
||||||
raise EquipmentError("Для смены SIM установите актуальный VPS Host.")
|
raise EquipmentError("Для смены SIM установите актуальный VPS Host.")
|
||||||
else:
|
else:
|
||||||
@@ -402,6 +405,7 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
),
|
),
|
||||||
"request-position": (
|
"request-position": (
|
||||||
"0.1.8",
|
"0.1.8",
|
||||||
@@ -443,6 +447,7 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
),
|
),
|
||||||
"pulse-output": (
|
"pulse-output": (
|
||||||
"0.1.9",
|
"0.1.9",
|
||||||
@@ -483,6 +488,7 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
),
|
),
|
||||||
"set-output": (
|
"set-output": (
|
||||||
"0.1.10",
|
"0.1.10",
|
||||||
@@ -522,6 +528,7 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
if source.get("status", {}).get("version") not in versions[command["kind"]]:
|
if source.get("status", {}).get("version") not in versions[command["kind"]]:
|
||||||
@@ -571,6 +578,7 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
)
|
)
|
||||||
for h in (source, target)
|
for h in (source, target)
|
||||||
):
|
):
|
||||||
@@ -658,6 +666,7 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
}
|
}
|
||||||
if durable_delivery:
|
if durable_delivery:
|
||||||
lifetime = (
|
lifetime = (
|
||||||
|
|||||||
@@ -72,3 +72,10 @@ def test_initial_usb_apply_accepts_current_shipped_host():
|
|||||||
host["status"]["version"] = version
|
host["status"]["version"] = version
|
||||||
assert apply(hosts, "device", 1) == {"ok": True}
|
assert apply(hosts, "device", 1) == {"ok": True}
|
||||||
hosts.equipment.apply.assert_called_once_with("device", 1)
|
hosts.equipment.apply.assert_called_once_with("device", 1)
|
||||||
|
|
||||||
|
|
||||||
|
def test_initial_apply_accepts_shared_host_without_changing_legacy_pairing():
|
||||||
|
hosts, _, host = context()
|
||||||
|
host["status"]["version"] = "0.2.0"
|
||||||
|
assert apply(hosts, "device", 1) == {"ok": True}
|
||||||
|
hosts.equipment.apply.assert_called_once_with("device", 1)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def sender(monkeypatch):
|
|||||||
return sent
|
return sent
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("version", ["0.1.26", "0.1.27", "0.1.28", "0.1.29", "0.1.30", "0.1.31"])
|
@pytest.mark.parametrize("version", ["0.1.26", "0.1.27", "0.1.28", "0.1.29", "0.1.30", "0.1.31", "0.2.0"])
|
||||||
def test_queue_survives_restart_and_idempotent_submit(ready, monkeypatch, version):
|
def test_queue_survives_restart_and_idempotent_submit(ready, monkeypatch, version):
|
||||||
equipment, hosts, row = ready
|
equipment, hosts, row = ready
|
||||||
for host in hosts.rows():
|
for host in hosts.rows():
|
||||||
|
|||||||
Reference in New Issue
Block a user