Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run integration tests with valgrind #5

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/libssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y valgrind
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y openssl libssl3 libssl-dev lld
- run: export VALGRIND="valgrind -q"
- run: make test
- run: VALGRIND="valgrind -q" make test integration

docs:
name: Check for documentation errors
Expand Down
2 changes: 2 additions & 0 deletions rustls-libssl/tests/maybe-valgrind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec $VALGRIND "$@"
28 changes: 16 additions & 12 deletions rustls-libssl/tests/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,33 @@ fn client() {

wait_for_port(4443);

let openssl_insecure_output = Command::new("target/client")
let openssl_insecure_output = Command::new("tests/maybe-valgrind.sh")
.env("LD_LIBRARY_PATH", "")
.args(&["localhost", "4443", "insecure"])
.args(&["target/client", "localhost", "4443", "insecure"])
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

let rustls_insecure_output = Command::new("target/client")
.args(&["localhost", "4443", "insecure"])
let rustls_insecure_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/client", "localhost", "4443", "insecure"])
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

assert_eq!(openssl_insecure_output, rustls_insecure_output);

let openssl_secure_output = Command::new("target/client")
let openssl_secure_output = Command::new("tests/maybe-valgrind.sh")
.env("LD_LIBRARY_PATH", "")
.args(&["localhost", "4443", "test-ca/rsa/ca.cert"])
.args(&["target/client", "localhost", "4443", "test-ca/rsa/ca.cert"])
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

let rustls_secure_output = Command::new("target/client")
.args(&["localhost", "4443", "test-ca/rsa/ca.cert"])
let rustls_secure_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/client", "localhost", "4443", "test-ca/rsa/ca.cert"])
.stdout(Stdio::piped())
.output()
.map(print_output)
Expand All @@ -91,14 +91,16 @@ fn client() {
#[test]
#[ignore]
fn constants() {
let openssl_output = Command::new("target/constants")
let openssl_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/constants"])
.env("LD_LIBRARY_PATH", "")
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

let rustls_output = Command::new("target/constants")
let rustls_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/constants"])
.stdout(Stdio::piped())
.output()
.map(print_output)
Expand All @@ -110,14 +112,16 @@ fn constants() {
#[test]
#[ignore]
fn ciphers() {
let openssl_output = Command::new("target/ciphers")
let openssl_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/ciphers"])
.env("LD_LIBRARY_PATH", "")
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

let rustls_output = Command::new("target/ciphers")
let rustls_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/ciphers"])
.stdout(Stdio::piped())
.output()
.map(print_output)
Expand Down