• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2#
3# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
4# Copyright (c) 2017, Oracle and/or its affiliates.  All rights reserved.
5#
6# Licensed under the OpenSSL license (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
10
11#
12# OpenSSL external testing using the Python Cryptography module
13#
14set -e
15
16O_EXE=`pwd`/$BLDTOP/apps
17O_BINC=`pwd`/$BLDTOP/include
18O_SINC=`pwd`/$SRCTOP/include
19O_LIB=`pwd`/$BLDTOP
20
21export PATH=$O_EXE:$PATH
22export LD_LIBRARY_PATH=$O_LIB:$LD_LIBRARY_PATH
23
24# Check/Set openssl version
25OPENSSL_VERSION=`openssl version | cut -f 2 -d ' '`
26
27echo "------------------------------------------------------------------"
28echo "Testing OpenSSL using Python Cryptography:"
29echo "   CWD:                $PWD"
30echo "   SRCTOP:             $SRCTOP"
31echo "   BLDTOP:             $BLDTOP"
32echo "   OpenSSL version:    $OPENSSL_VERSION"
33echo "------------------------------------------------------------------"
34
35cd $SRCTOP
36
37# Create a python virtual env and activate
38rm -rf venv-pycrypto
39virtualenv venv-pycrypto
40. ./venv-pycrypto/bin/activate
41
42cd pyca-cryptography
43
44pip install .[test]
45
46echo "------------------------------------------------------------------"
47echo "Building cryptography"
48echo "------------------------------------------------------------------"
49python ./setup.py clean
50
51CFLAGS="-I$O_BINC -I$O_SINC -L$O_LIB" python ./setup.py build
52
53echo "------------------------------------------------------------------"
54echo "Running tests"
55echo "------------------------------------------------------------------"
56
57CFLAGS="-I$O_BINC -I$O_SINC -L$O_LIB" python ./setup.py test
58
59cd ../
60deactivate
61rm -rf venv-pycrypto
62
63exit 0
64
65