Skip to content

Commit

Permalink
change port and use 127.0.0.1 for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
glendc committed Jun 2, 2024
1 parent 35291a8 commit df9c68c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions tests/cli_tests/http_echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ use super::utils;
#[tokio::test]
#[ignore]
async fn test_http_echo() {
let _guard = utils::RamaService::echo(64101);
let _guard = utils::RamaService::echo(63101);

let lines = utils::RamaService::http(vec![":64101"]).unwrap();
let lines = utils::RamaService::http(vec!["http://127.0.0.1:63101"]).unwrap();
assert!(lines.contains("HTTP/1.1 200 OK"), "lines: {:?}", lines);

let lines = utils::RamaService::http(vec![":64101", "foo:bar", "a=4", "q==1"]).unwrap();
let lines =
utils::RamaService::http(vec!["http://127.0.0.1:63101", "foo:bar", "a=4", "q==1"]).unwrap();
assert!(lines.contains("HTTP/1.1 200 OK"), "lines: {:?}", lines);
assert!(lines.contains(r##""method":"POST""##), "lines: {:?}", lines);
assert!(lines.contains(r##""foo","bar""##), "lines: {:?}", lines);
Expand Down
4 changes: 2 additions & 2 deletions tests/cli_tests/http_ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use super::utils;
#[tokio::test]
#[ignore]
async fn test_http_ip() {
let _guard = utils::RamaService::ip(64100);
let _guard = utils::RamaService::ip(63100);

let lines = utils::RamaService::http(vec![":64100"]).unwrap();
let lines = utils::RamaService::http(vec!["http://127.0.0.1:63100"]).unwrap();
assert!(lines.contains("HTTP/1.1 200 OK"));
assert!(lines.contains("127.0.0.1:"));
}
2 changes: 1 addition & 1 deletion tests/cli_tests/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl RamaService {
thread::spawn(move || {
for line in stdout {
let line = line.unwrap();
println!("rama ip >> {}", line);
eprintln!("rama ip >> {}", line);
}
});

Expand Down

0 comments on commit df9c68c

Please sign in to comment.