diff options
author | Shaun Taheri <github@taheris.co.uk> | 2016-09-05 18:03:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-05 18:03:54 +0200 |
commit | 6d48b0a1727e277ffe5b8b1f2dc625bdc739b160 (patch) | |
tree | 37a001266cf40180987f5134bae5860ea2865823 | |
parent | adf1a926ff8de8b71b011b62fa06dac47c182b66 (diff) | |
parent | 2a9797aaa9b69249097fcfd9940a8e68043eaae6 (diff) | |
download | rvi_sota_client-6d48b0a1727e277ffe5b8b1f2dc625bdc739b160.tar.gz |
Merge pull request #119 from advancedtelematic/bugfix/pro-1270/installing-update-event
Send InstallingUpdate Event before an install
-rw-r--r-- | src/interpreter.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/interpreter.rs b/src/interpreter.rs index 7d95007..3495def 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -217,6 +217,7 @@ impl<'t> GlobalInterpreter<'t> { } Command::StartInstall(dl) => { + etx.send(Event::InstallingUpdate(dl.update_id.clone())); let _ = sota.install_update(dl) .map(|report| etx.send(Event::InstallComplete(report))) .map_err(|report| etx.send(Event::InstallFailed(report))); @@ -349,6 +350,7 @@ mod tests { signature: "".to_string() })); assert_rx(erx, &[ + Event::InstallingUpdate("1".to_string()), Event::InstallComplete( UpdateReport::single("1".to_string(), UpdateResultCode::OK, "".to_string()) ) @@ -367,9 +369,10 @@ mod tests { signature: "".to_string() })); assert_rx(erx, &[ + Event::InstallingUpdate("1".to_string()), Event::InstallFailed( UpdateReport::single("1".to_string(), UpdateResultCode::INSTALL_FAILED, "failed".to_string()) - ), + ) ]); } } |