xref: /freebsd/crypto/openssl/test/README-external.md (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
1*e0c4386eSCy SchubertRunning external test suites with OpenSSL
2*e0c4386eSCy Schubert=========================================
3*e0c4386eSCy Schubert
4*e0c4386eSCy SchubertIt is possible to integrate external test suites into OpenSSL's `make test`.
5*e0c4386eSCy SchubertThis capability is considered a developer option and does not work on all
6*e0c4386eSCy Schubertplatforms.
7*e0c4386eSCy Schubert
8*e0c4386eSCy SchubertPython PYCA/Cryptography test suite
9*e0c4386eSCy Schubert===================================
10*e0c4386eSCy Schubert
11*e0c4386eSCy SchubertThis python test suite runs cryptographic tests with a local OpenSSL build as
12*e0c4386eSCy Schubertthe implementation.
13*e0c4386eSCy Schubert
14*e0c4386eSCy SchubertFirst checkout the `PYCA/Cryptography` module into `./pyca-cryptography` using:
15*e0c4386eSCy Schubert
16*e0c4386eSCy Schubert    $ git submodule update --init
17*e0c4386eSCy Schubert
18*e0c4386eSCy SchubertThen configure/build OpenSSL compatible with the python module:
19*e0c4386eSCy Schubert
20*e0c4386eSCy Schubert    $ ./config shared enable-external-tests
21*e0c4386eSCy Schubert    $ make
22*e0c4386eSCy Schubert
23*e0c4386eSCy SchubertThe tests will run in a python virtual environment which requires virtualenv
24*e0c4386eSCy Schubertto be installed.
25*e0c4386eSCy Schubert
26*e0c4386eSCy Schubert    $ make test VERBOSE=1 TESTS=test_external_pyca
27*e0c4386eSCy Schubert
28*e0c4386eSCy SchubertTest failures and suppressions
29*e0c4386eSCy Schubert------------------------------
30*e0c4386eSCy Schubert
31*e0c4386eSCy SchubertSome tests target older (<=1.0.2) versions so will not run. Other tests target
32*e0c4386eSCy Schubertother crypto implementations so are not relevant. Currently no tests fail.
33*e0c4386eSCy Schubert
34*e0c4386eSCy Schubertkrb5 test suite
35*e0c4386eSCy Schubert===============
36*e0c4386eSCy Schubert
37*e0c4386eSCy SchubertMuch like the PYCA/Cryptography test suite, this builds and runs the krb5
38*e0c4386eSCy Schuberttests against the local OpenSSL build.
39*e0c4386eSCy Schubert
40*e0c4386eSCy SchubertYou will need a git checkout of krb5 at the top level:
41*e0c4386eSCy Schubert
42*e0c4386eSCy Schubert    $ git clone https://github.com/krb5/krb5
43*e0c4386eSCy Schubert
44*e0c4386eSCy Schubertkrb5's master has to pass this same CI, but a known-good version is
45*e0c4386eSCy Schubertkrb5-1.15.1-final if you want to be sure.
46*e0c4386eSCy Schubert
47*e0c4386eSCy Schubert    $ cd krb5
48*e0c4386eSCy Schubert    $ git checkout krb5-1.15.1-final
49*e0c4386eSCy Schubert    $ cd ..
50*e0c4386eSCy Schubert
51*e0c4386eSCy SchubertOpenSSL must be built with external tests enabled:
52*e0c4386eSCy Schubert
53*e0c4386eSCy Schubert    $ ./config enable-external-tests
54*e0c4386eSCy Schubert    $ make
55*e0c4386eSCy Schubert
56*e0c4386eSCy Schubertkrb5's tests will then be run as part of the rest of the suite, or can be
57*e0c4386eSCy Schubertexplicitly run (with more debugging):
58*e0c4386eSCy Schubert
59*e0c4386eSCy Schubert    $ VERBOSE=1 make TESTS=test_external_krb5 test
60*e0c4386eSCy Schubert
61*e0c4386eSCy SchubertTest-failures suppressions
62*e0c4386eSCy Schubert--------------------------
63*e0c4386eSCy Schubert
64*e0c4386eSCy Schubertkrb5 will automatically adapt its test suite to account for the configuration
65*e0c4386eSCy Schubertof your system.  Certain tests may require more installed packages to run.  No
66*e0c4386eSCy Schuberttests are expected to fail.
67*e0c4386eSCy Schubert
68*e0c4386eSCy SchubertGOST engine test suite
69*e0c4386eSCy Schubert===============
70*e0c4386eSCy Schubert
71*e0c4386eSCy SchubertMuch like the PYCA/Cryptography test suite, this builds and runs the GOST engine
72*e0c4386eSCy Schuberttests against the local OpenSSL build.
73*e0c4386eSCy Schubert
74*e0c4386eSCy SchubertYou will need a git checkout of gost-engine at the top level:
75*e0c4386eSCy Schubert
76*e0c4386eSCy Schubert    $ git submodule update --init
77*e0c4386eSCy Schubert
78*e0c4386eSCy SchubertThen configure/build OpenSSL enabling external tests:
79*e0c4386eSCy Schubert
80*e0c4386eSCy Schubert    $ ./config shared enable-external-tests
81*e0c4386eSCy Schubert    $ make
82*e0c4386eSCy Schubert
83*e0c4386eSCy SchubertGOST engine requires CMake for the build process.
84*e0c4386eSCy Schubert
85*e0c4386eSCy SchubertGOST engine tests will then be run as part of the rest of the suite, or can be
86*e0c4386eSCy Schubertexplicitly run (with more debugging):
87*e0c4386eSCy Schubert
88*e0c4386eSCy Schubert    $ make test VERBOSE=1 TESTS=test_external_gost_engine
89*e0c4386eSCy Schubert
90*e0c4386eSCy SchubertUpdating test suites
91*e0c4386eSCy Schubert====================
92*e0c4386eSCy Schubert
93*e0c4386eSCy SchubertTo update the commit for any of the above test suites:
94*e0c4386eSCy Schubert
95*e0c4386eSCy Schubert- Make sure the submodules are cloned locally:
96*e0c4386eSCy Schubert
97*e0c4386eSCy Schubert    $ git submodule update --init --recursive
98*e0c4386eSCy Schubert
99*e0c4386eSCy Schubert- Enter subdirectory and pull from the repository (use a specific branch/tag if required):
100*e0c4386eSCy Schubert
101*e0c4386eSCy Schubert    $ cd `<submodule-dir>`
102*e0c4386eSCy Schubert    $ git pull origin master
103*e0c4386eSCy Schubert
104*e0c4386eSCy Schubert- Go to root directory, there should be a new git status:
105*e0c4386eSCy Schubert
106*e0c4386eSCy Schubert    $ cd ../
107*e0c4386eSCy Schubert    $ git status
108*e0c4386eSCy Schubert      ...
109*e0c4386eSCy Schubert      #       modified:   `<submodule-dir>` (new commits)
110*e0c4386eSCy Schubert      ...
111*e0c4386eSCy Schubert
112*e0c4386eSCy Schubert- Add/commit/push the update
113*e0c4386eSCy Schubert
114*e0c4386eSCy Schubert    $ git add `<submodule-dir>`
115*e0c4386eSCy Schubert    $ git commit -m `"Updated <submodule> to latest commit"`
116*e0c4386eSCy Schubert    $ git push
117