-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
otbr: Automatically migrate OTBR settings to last-good backup #4417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| __pycache__/ | ||
| .DS_Store |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,63 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import sys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from pathlib import Path | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sys.path.append(str(Path(__file__).parent.parent / "rootfs/usr/local/bin")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import pytest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import shutil | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from unittest.mock import patch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from migrate_otbr_settings import main, parse_otbr_settings, is_valid_otbr_settings_file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+11
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sys.path.append(str(Path(__file__).parent.parent / "rootfs/usr/local/bin")) | |
| import pytest | |
| import shutil | |
| from unittest.mock import patch | |
| from migrate_otbr_settings import main, parse_otbr_settings, is_valid_otbr_settings_file | |
| import importlib.util | |
| import pytest | |
| import shutil | |
| from unittest.mock import patch | |
| _MIGRATE_OTBR_SETTINGS_PATH = ( | |
| Path(__file__).parent.parent / "rootfs/usr/local/bin" / "migrate_otbr_settings.py" | |
| ) | |
| _spec = importlib.util.spec_from_file_location( | |
| "migrate_otbr_settings", _MIGRATE_OTBR_SETTINGS_PATH | |
| ) | |
| if _spec is None or _spec.loader is None: | |
| raise ImportError(f"Cannot load migrate_otbr_settings from {_MIGRATE_OTBR_SETTINGS_PATH}") | |
| _migrate_otbr_settings = importlib.util.module_from_spec(_spec) | |
| _spec.loader.exec_module(_migrate_otbr_settings) # type: ignore[union-attr] | |
| main = _migrate_otbr_settings.main | |
| parse_otbr_settings = _migrate_otbr_settings.parse_otbr_settings | |
| is_valid_otbr_settings_file = _migrate_otbr_settings.is_valid_otbr_settings_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess instead of going by length we could just test for some usually available tags 🤔
I'd go for these five, they are pretty much required: