|
8 | 8 |
|
9 | 9 | from zigpy_znp.types.nvids import NwkNvIds, OsalExNvIds
|
10 | 10 |
|
11 |
| -from zigpy_znp.tools.nvram_backup import main as nvram_backup |
12 |
| -from zigpy_znp.tools.nvram_restore import main as nvram_restore |
| 11 | +from zigpy_znp.tools.nvram_read import main as nvram_read |
| 12 | +from zigpy_znp.tools.nvram_write import main as nvram_write |
13 | 13 |
|
14 | 14 |
|
15 | 15 | from test_api import pytest_mark_asyncio_timeout # noqa: F401
|
@@ -135,7 +135,7 @@ def close(self):
|
135 | 135 |
|
136 | 136 |
|
137 | 137 | @pytest_mark_asyncio_timeout(seconds=5)
|
138 |
| -async def test_nvram_backup(openable_serial_znp_server, tmp_path): |
| 138 | +async def test_nvram_read(openable_serial_znp_server, tmp_path): |
139 | 139 | def osal_nv_read(req):
|
140 | 140 | nvid = NwkNvIds(req.Id).name
|
141 | 141 |
|
@@ -178,14 +178,14 @@ def nv_read(req):
|
178 | 178 | )
|
179 | 179 |
|
180 | 180 | backup_file = tmp_path / "backup.json"
|
181 |
| - await nvram_backup([openable_serial_znp_server._port_path, "-o", str(backup_file)]) |
| 181 | + await nvram_read([openable_serial_znp_server._port_path, "-o", str(backup_file)]) |
182 | 182 |
|
183 | 183 | # The backup JSON written to disk should be an exact copy of our fake NVRAM
|
184 | 184 | assert json.loads(backup_file.read_text()) == REAL_BACKUP
|
185 | 185 |
|
186 | 186 |
|
187 | 187 | @pytest_mark_asyncio_timeout(seconds=5)
|
188 |
| -async def test_nvram_restore(openable_serial_znp_server, tmp_path): |
| 188 | +async def test_nvram_write(openable_serial_znp_server, tmp_path): |
189 | 189 | simulated_nvram = {"osal": {}, "nwk": {}}
|
190 | 190 |
|
191 | 191 | def osal_nv_item_init(req):
|
@@ -264,7 +264,7 @@ def nv_write(req):
|
264 | 264 | backup_file = tmp_path / "backup.json"
|
265 | 265 | backup_file.write_text(json.dumps(backup_obj))
|
266 | 266 |
|
267 |
| - await nvram_restore([openable_serial_znp_server._port_path, "-i", str(backup_file)]) |
| 267 | + await nvram_write([openable_serial_znp_server._port_path, "-i", str(backup_file)]) |
268 | 268 |
|
269 | 269 | # Convert every value to its hex representation to match the backup format
|
270 | 270 | simulated_nvram_hex = {
|
|
0 commit comments