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