File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33use std:: time:: Duration ;
44
55use anyhow:: { anyhow, Context , Result } ;
6+ use serde:: Deserialize ;
67use tokio:: time:: sleep;
78
9+ #[ derive( Deserialize ) ]
10+ struct SmokeStatus {
11+ status : String ,
12+ }
13+
814#[ cfg_attr( not( target_os = "windows" ) , ignore) ]
915#[ tokio:: test( flavor = "current_thread" ) ]
1016async fn win_ca_smoke ( ) -> Result < ( ) > {
@@ -46,11 +52,26 @@ async fn win_ca_smoke() -> Result<()> {
4652 . await
4753 . context ( "reading body from win-ca smoke target" ) ?;
4854
49- if body. trim ( ) == "ok" {
55+ let trimmed = body. trim ( ) ;
56+
57+ if trimmed. eq_ignore_ascii_case ( "ok" ) {
5058 println ! ( "win-ca smoke OK" ) ;
5159 return Ok ( ( ) ) ;
5260 }
5361
62+ if let Ok ( json) = serde_json:: from_str :: < SmokeStatus > ( trimmed) {
63+ if json. status . trim ( ) . eq_ignore_ascii_case ( "ok" ) {
64+ println ! ( "win-ca smoke OK" ) ;
65+ return Ok ( ( ) ) ;
66+ }
67+
68+ return Err ( anyhow ! (
69+ "unexpected JSON status {:?} from {}" ,
70+ json. status,
71+ target
72+ ) ) ;
73+ }
74+
5475 return Err ( anyhow ! (
5576 "unexpected response body {:?} from {}" ,
5677 body,
You can’t perform that action at this time.
0 commit comments