|
21 | 21 | #[derive(PartialEq, Debug)]
|
22 | 22 | pub enum CapturedUpdateInstallerRequest {
|
23 | 23 | StartUpdate { url: String, options: Options, reboot_controller_present: bool },
|
| 24 | + SuspendUpdate { attempt_id: Option<String> }, |
| 25 | + ResumeUpdate { attempt_id: Option<String> }, |
| 26 | + CancelUpdate { attempt_id: Option<String> }, |
24 | 27 | }
|
25 | 28 |
|
26 | 29 | // Options does not impl Eq, but it is semantically Eq.
|
@@ -148,12 +151,27 @@ impl MockUpdateInstallerService {
|
148 | 151 | let response = self.start_update_response.lock();
|
149 | 152 | responder.send(response.as_deref().map_err(|e| *e)).unwrap();
|
150 | 153 | }
|
| 154 | + InstallerRequest::SuspendUpdate { attempt_id, responder } => { |
| 155 | + self.captured_args |
| 156 | + .lock() |
| 157 | + .push(CapturedUpdateInstallerRequest::SuspendUpdate { attempt_id }); |
| 158 | + responder.send(Ok(())).unwrap(); |
| 159 | + } |
| 160 | + InstallerRequest::ResumeUpdate { attempt_id, responder } => { |
| 161 | + self.captured_args |
| 162 | + .lock() |
| 163 | + .push(CapturedUpdateInstallerRequest::ResumeUpdate { attempt_id }); |
| 164 | + responder.send(Ok(())).unwrap(); |
| 165 | + } |
| 166 | + InstallerRequest::CancelUpdate { attempt_id, responder } => { |
| 167 | + self.captured_args |
| 168 | + .lock() |
| 169 | + .push(CapturedUpdateInstallerRequest::CancelUpdate { attempt_id }); |
| 170 | + responder.send(Ok(())).unwrap(); |
| 171 | + } |
151 | 172 | InstallerRequest::GetLastUpdateResult { .. }
|
152 | 173 | | InstallerRequest::GetUpdateResult { .. }
|
153 |
| - | InstallerRequest::MonitorUpdate { .. } |
154 |
| - | InstallerRequest::SuspendUpdate { .. } |
155 |
| - | InstallerRequest::ResumeUpdate { .. } |
156 |
| - | InstallerRequest::CancelUpdate { .. } => { |
| 174 | + | InstallerRequest::MonitorUpdate { .. } => { |
157 | 175 | panic!("unexpected request: {req:?}");
|
158 | 176 | }
|
159 | 177 | }
|
|
0 commit comments