fix(ota): recover corrupt companion settings stores
This commit is contained in:
1 parent
7bad5f9b30
commit
90d8a7f3c4
4 files changed
+149
-38
No files matched your search
@@ -204,8 +204,10 @@ int main() {
|
||||
fs.files["/ota_config"][4]^=1;
|
||||
const auto damaged=fs.files["/ota_config"];
|
||||
reboot(fs);
|
||||
command("ota config hops 7", "ERR");
|
||||
assert(fs.files["/ota_config"]==damaged);
|
||||
command("ota config hops 7", "OK");
|
||||
assert(fs.files["/ota_config"]!=damaged && context.manager.hops==7);
|
||||
reboot(fs);
|
||||
assert(context.manager.hops==7);
|
||||
fs.files.clear(); reboot(fs);
|
||||
acquire_ok=false;
|
||||
command("ota config hops 7", "ERR unavailable");
|
||||
|
||||
@@ -61,8 +61,10 @@ int main() {
|
||||
fs.files["/ota_speed"][4] ^= 1; // damaged image is not partly adopted
|
||||
beginSpeedConfig(&fs);
|
||||
assert(speedFactor() == 1.0f);
|
||||
command("set ota.speed 2", "ERR");
|
||||
assert(speedFactor() == 1.0f);
|
||||
command("set ota.speed 2", "OK ota.speed=2x (saved)");
|
||||
assert(speedFactor() == 2.0f);
|
||||
beginSpeedConfig(&fs);
|
||||
assert(speedFactor() == 2.0f);
|
||||
fs.files.clear();
|
||||
beginSpeedConfig(&fs);
|
||||
command("ota set speed 1.125", "OK ota.speed=1.125x");
|
||||
|
||||
Reference in new issue
Block a user