diff options
| author | tb <> | 2022-10-20 07:33:14 +0000 |
|---|---|---|
| committer | tb <> | 2022-10-20 07:33:14 +0000 |
| commit | 6ef02c2707dc554983552781e5b767ae8103de15 (patch) | |
| tree | b247df918127dddb71d90f7030ba1dad5bba19a2 /src | |
| parent | 3daa6137ebbb54877916ab760ed8716f17551850 (diff) | |
| download | openbsd-6ef02c2707dc554983552781e5b767ae8103de15.tar.gz openbsd-6ef02c2707dc554983552781e5b767ae8103de15.tar.bz2 openbsd-6ef02c2707dc554983552781e5b767ae8103de15.zip | |
Provide a harness driving rust-openssl's regress tests
rust-openssl is an integral part of the Rust ecosystem and more than a
dozen ports, including lang/rust itself, depend on it. We need to ensure
that it keeps working with LibreSSL.
If the rust and rust-openssl-tests packages are installed, create a cargo
workspace under obj/ that compiles and runs the rust-openssl regress tests
much like what is done for the openssl-ruby tests. This expands our regress
coverage: for instance, this would have caught the broken ASN.1 indefinite
length encoding caused by asn1/tasn_enc.c r1.25.
Positive feedback beck jsing semarie
Testing and ok anton
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libssl/rust-openssl/Cargo.toml | 8 | ||||
| -rw-r--r-- | src/regress/lib/libssl/rust-openssl/Makefile | 48 | ||||
| -rw-r--r-- | src/regress/lib/libssl/rust-openssl/config | 6 |
3 files changed, 62 insertions, 0 deletions
diff --git a/src/regress/lib/libssl/rust-openssl/Cargo.toml b/src/regress/lib/libssl/rust-openssl/Cargo.toml new file mode 100644 index 0000000000..c33c3475a7 --- /dev/null +++ b/src/regress/lib/libssl/rust-openssl/Cargo.toml | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | [workspace] | ||
| 2 | members = [ | ||
| 3 | "openssl", | ||
| 4 | "openssl-errors", | ||
| 5 | "openssl-macros", | ||
| 6 | "openssl-sys", | ||
| 7 | "systest", | ||
| 8 | ] | ||
diff --git a/src/regress/lib/libssl/rust-openssl/Makefile b/src/regress/lib/libssl/rust-openssl/Makefile new file mode 100644 index 0000000000..88e231ec08 --- /dev/null +++ b/src/regress/lib/libssl/rust-openssl/Makefile | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.1.1.1 2022/10/20 07:33:14 tb Exp $ | ||
| 2 | |||
| 3 | RUST_OPENSSL_TESTS = /usr/local/share/rust-openssl-tests | ||
| 4 | CARGO = /usr/local/bin/cargo | ||
| 5 | |||
| 6 | .if !exists(${RUST_OPENSSL_TESTS}) || !exists(${CARGO}) | ||
| 7 | regress: | ||
| 8 | @echo packages rust-openssl-tests and rust are required for this regress | ||
| 9 | @echo SKIPPED | ||
| 10 | .else | ||
| 11 | |||
| 12 | REGRESS_TARGETS += rust-openssl-test | ||
| 13 | |||
| 14 | WORKSPACE_LINKS = openssl openssl-errors openssl-macros openssl-sys systest | ||
| 15 | |||
| 16 | _WORKSPACE_COOKIE = .workspace | ||
| 17 | |||
| 18 | ${_WORKSPACE_COOKIE}: | ||
| 19 | . if ${.CURDIR} != ${.OBJDIR} | ||
| 20 | cp ${.CURDIR}/Cargo.toml ${.OBJDIR}/ | ||
| 21 | . endif | ||
| 22 | mkdir -p .cargo | ||
| 23 | cp ${.CURDIR}/config .cargo/ | ||
| 24 | cd ${.OBJDIR} && ln -sf ${WORKSPACE_LINKS:S,^,${RUST_OPENSSL_TESTS}/,} . | ||
| 25 | touch $@ | ||
| 26 | |||
| 27 | CLEANFILES += Cargo.lock | ||
| 28 | |||
| 29 | . if ${.CURDIR} != ${.OBJDIR} | ||
| 30 | CLEANFILES += Cargo.toml | ||
| 31 | . endif | ||
| 32 | |||
| 33 | rust-openssl-test: ${_WORKSPACE_COOKIE} | ||
| 34 | cd ${.OBJDIR} && cargo test --offline --color=never -- --color=never | ||
| 35 | |||
| 36 | CLEANFILES += ${_WORKSPACE_COOKIE} ${WORKSPACE_LINKS} | ||
| 37 | |||
| 38 | . if make(clean) || make(cleandir) | ||
| 39 | . if exists(.cargo) || exists(target) | ||
| 40 | .BEGIN: | ||
| 41 | rm -rf .cargo | ||
| 42 | rm -rf target | ||
| 43 | . endif | ||
| 44 | . endif | ||
| 45 | |||
| 46 | .endif | ||
| 47 | |||
| 48 | .include <bsd.regress.mk> | ||
diff --git a/src/regress/lib/libssl/rust-openssl/config b/src/regress/lib/libssl/rust-openssl/config new file mode 100644 index 0000000000..a47474744d --- /dev/null +++ b/src/regress/lib/libssl/rust-openssl/config | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | [net] | ||
| 2 | offline = true | ||
| 3 | [source.modcargo] | ||
| 4 | directory = '/usr/local/share/rust-openssl-tests/modcargo-crates' | ||
| 5 | [source.crates-io] | ||
| 6 | replace-with = 'modcargo' | ||
