Skip to content

Commit 3bc4ff7

Browse files
committed
Attempt to fix tests hanging on azure
Use curl instead of openssl s_client
1 parent 524f615 commit 3bc4ff7

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

tests/tests.rs

+10-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::io::Write;
2-
use std::process::{Command, Stdio};
1+
use std::process::Command;
32
use std::thread;
43
use std::time;
54

@@ -22,24 +21,16 @@ fn server() {
2221

2322
thread::sleep(time::Duration::from_secs(1));
2423

25-
let mut cli = Command::new("openssl")
26-
.arg("s_client")
27-
.arg("-ign_eof")
28-
.arg("-connect")
29-
.arg("localhost:1337")
30-
.stdin(Stdio::piped())
31-
.spawn()
32-
.expect("cannot run openssl");
33-
34-
cli.stdin
35-
.as_mut()
36-
.unwrap()
37-
.write(b"GET / HTTP/1.0\r\n\r\n")
38-
.unwrap();
39-
40-
let rc = cli.wait().expect("openssl failed");
24+
let output = Command::new("curl")
25+
.arg("--insecure")
26+
.arg("--http1.0")
27+
.arg("--silent")
28+
.arg("https://localhost:1337")
29+
.output()
30+
.expect("cannot run curl");
4131

42-
assert!(rc.success());
32+
println!("client output: {:?}", output.stdout);
33+
assert_eq!(output.stdout, b"Try POST /echo\n");
4334

4435
srv.kill().unwrap();
4536
}

0 commit comments

Comments
 (0)