Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 3e15183

Browse files
committed
Use data models from official sdk
1 parent 6820f86 commit 3e15183

4 files changed

Lines changed: 21 additions & 47 deletions

File tree

packages/jumpstarter-driver-corellium/fixtures/http/get-models-200.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
"flavor": "rpi4b",
66
"description": "Raspberry Pi 4",
77
"model": "rpi4b",
8-
"peripherals": false,
9-
"quotas": {
10-
"cores": 4,
11-
"cpus": 4
12-
}
8+
"peripherals": false
139
}
1410
]

packages/jumpstarter-driver-corellium/jumpstarter_driver_corellium/corellium/api_test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ def test_create_instance_ok(requests_mock):
133133

134134
project = Project("d59db33d-27bd-4b22-878d-49e4758a648e", "Default Project")
135135
device = Device(
136-
name="rd1ae", type="automotive", flavor="kronos", description="", model="kronos", peripherals=False, quotas={}
136+
name="rd1ae",
137+
type="automotive",
138+
flavor="kronos",
139+
description="",
140+
model="kronos",
141+
peripherals=False,
137142
)
138143
instance = api.create_instance("my-instance", project, device, "1.1.1", "Critical Application Monitor (Baremetal)")
139144

@@ -162,7 +167,6 @@ def test_create_instance_error(requests_mock, status_code, data, msg):
162167
description="",
163168
model="kronos",
164169
peripherals=False,
165-
quotas={},
166170
)
167171
api.create_instance("my-instance", project, device, "1.1.1", "Critical Application Monitor (Baremetal)")
168172

packages/jumpstarter-driver-corellium/jumpstarter_driver_corellium/corellium/types.py

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
Corellium API types.
33
"""
44

5-
from dataclasses import dataclass, field
6-
from typing import Dict, Optional
5+
from dataclasses import dataclass
6+
from typing import Dict
7+
8+
from corellium_api import Instance, Model, Project
9+
10+
__all__ = ["Project", "Device", "Instance"]
11+
12+
Device = Model
713

814

915
@dataclass
@@ -20,40 +26,3 @@ def as_header(self) -> Dict[str, str]:
2026
Return a dict to be used as HTTP header for authenticated requests.
2127
"""
2228
return {"Authorization": f"Bearer {self.token}"}
23-
24-
25-
@dataclass
26-
class Project:
27-
"""
28-
Dataclass that represents a Corellium project.
29-
"""
30-
31-
id: str
32-
name: str
33-
34-
35-
@dataclass
36-
class Device:
37-
"""
38-
Dataclass to represent a Corellium Device.
39-
40-
A device object is used to create virtual instances.
41-
"""
42-
43-
name: str
44-
type: str
45-
flavor: str
46-
description: str
47-
model: str
48-
peripherals: bool
49-
quotas: dict
50-
51-
52-
@dataclass
53-
class Instance:
54-
"""
55-
Virtual instance dataclass.
56-
"""
57-
58-
id: str
59-
state: Optional[str] = field(default=None)

packages/jumpstarter-driver-corellium/jumpstarter_driver_corellium/driver_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ def test_driver_power_on_ok(monkeypatch):
7171

7272
project = Project("1", "Default Project")
7373
device = Device(
74-
name="rd1ae", type="automotive", flavor="kronos", description="", model="kronos", peripherals=False, quotas={}
74+
name="rd1ae",
75+
type="automotive",
76+
flavor="kronos",
77+
description="",
78+
model="kronos",
79+
peripherals=False,
7580
)
7681
instance = Instance(id="7f4f241c-821f-4219-905f-c3b50b0db5dd", state="on")
7782
root = Corellium(project_id="1", device_name="jmp", device_flavor="kronos", device_os="1.0")

0 commit comments

Comments
 (0)