1#!/bin/bash 2 3# Copyright 2015 Google Inc. All rights reserved. 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17set -ev 18 19 20# If we're on Travis, we need to set up the environment. 21if [[ "${TRAVIS}" == "true" ]]; then 22 # If merging to master and not a pull request, run system test. 23 if [[ "${TRAVIS_BRANCH}" == "master" ]] && \ 24 [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then 25 echo "Running in Travis during merge, decrypting stored key file." 26 # Convert encrypted JSON key file into decrypted file to be used. 27 openssl aes-256-cbc -K ${OAUTH2CLIENT_KEY} \ 28 -iv ${OAUTH2CLIENT_IV} \ 29 -in tests/data/key.json.enc \ 30 -out ${OAUTH2CLIENT_TEST_JSON_KEY_PATH} -d 31 # Convert encrypted P12 key file into decrypted file to be used. 32 openssl aes-256-cbc -K ${OAUTH2CLIENT_KEY} \ 33 -iv ${OAUTH2CLIENT_IV} \ 34 -in tests/data/key.p12.enc \ 35 -out ${OAUTH2CLIENT_TEST_P12_KEY_PATH} -d 36 # Convert encrypted User JSON key file into decrypted file to be used. 37 openssl aes-256-cbc -K ${OAUTH2CLIENT_KEY} \ 38 -iv ${OAUTH2CLIENT_IV} \ 39 -in tests/data/user-key.json.enc \ 40 -out ${OAUTH2CLIENT_TEST_USER_KEY_PATH} -d 41 else 42 echo "Running in Travis during non-merge to master, doing nothing." 43 exit 44 fi 45fi 46 47# Run the system tests for each tested package. 48python scripts/run_system_tests.py 49