3 # Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
4 # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
6 # Licensed under the Apache License 2.0 (the "License"). You may not use
7 # this file except in compliance with the License. You can obtain a copy
8 # in the file LICENSE in the source distribution or at
9 # https://www.openssl.org/source/license.html
12 # OpenSSL external testing using the Python Cryptography module
17 O_EXE=`pwd`/$BLDTOP/apps
18 O_BINC=`pwd`/$BLDTOP/include
19 O_SINC=`pwd`/$SRCTOP/include
22 export PATH=$O_EXE:$PATH
23 export LD_LIBRARY_PATH=$O_LIB:$LD_LIBRARY_PATH
25 # Check/Set openssl version
26 OPENSSL_VERSION=`openssl version | cut -f 2 -d ' '`
28 echo "------------------------------------------------------------------"
29 echo "Testing OpenSSL using Python Cryptography:"
31 echo " SRCTOP: $SRCTOP"
32 echo " BLDTOP: $BLDTOP"
33 echo " OpenSSL version: $OPENSSL_VERSION"
34 echo "------------------------------------------------------------------"
38 # Create a python virtual env and activate
39 rm -rf venv-cryptography
40 python -m venv venv-cryptography
41 . ./venv-cryptography/bin/activate
42 # Upgrade pip to always have latest
47 echo "------------------------------------------------------------------"
48 echo "Building cryptography and installing test requirements"
49 echo "------------------------------------------------------------------"
50 LDFLAGS="-L$O_LIB" CFLAGS="-I$O_BINC -I$O_SINC " pip install .[test]
51 pip install -e vectors
53 echo "------------------------------------------------------------------"
54 echo "Print linked libraries"
55 echo "------------------------------------------------------------------"
56 ldd $(find ../venv-cryptography/lib/ -iname '*.so')
59 echo "------------------------------------------------------------------"
61 echo "------------------------------------------------------------------"
62 pytest -n auto tests --wycheproof-root=../wycheproof
66 rm -rf venv-cryptography