-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunGraphTester.sh
More file actions
53 lines (39 loc) · 1.3 KB
/
runGraphTester.sh
File metadata and controls
53 lines (39 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
# Fail correctly on pipes
set -o pipefail
# Exit on error
set -o errexit
# FOR DEBUGGING!
# set -o xtrace
# Set variables for current FILE, & DIR
__DIR__="$(cd "$(dirname "${0}")"; echo $(pwd))"
__BASE__="$(basename "${0}")"
__FILE__="${__DIR__}/${__BASE__}"
CURRENT_WORKING_DIR=$(pwd)
# Exit when using undeclared variables
# set -o nounset # DOES NOT WORK NICELY WITH VIRTUALENV
command_exists () {
type "$1" &> /dev/null ;
}
#
#
#
# END OF BASH SCRIPT BOILERPLATE http://kvz.io/blog/2013/11/21/bash-best-practices/
#
#
#
# INPUT ARGUMENTS
GRAPHTESTER_DIRECTORY="${1:-Undefined}"
LOGGING_DIRECTORY="${2:-Undefined}"
GRAPHTESTER_DIRECTORY=$(cd "$GRAPHTESTER_DIRECTORY" && pwd)
LOGGING_DIRECTORY=$(cd "$LOGGING_DIRECTORY" && pwd)
# INPUT VALIDATION
if [[ "${GRAPHTESTER_DIRECTORY}" == Undefined ]]; then echo "ERROR: NO GRAPHTESTER_DIRECTORY PASS ALONG"; exit; fi
if [[ "${LOGGING_DIRECTORY}" == Undefined ]]; then echo "ERROR: NO LOGGING_DIRECTORY PASS ALONG"; exit; fi
# START ACTUAL SCRIPT
echo; echo "1 RUNNING THE TESTS"; echo;
cd ${GRAPHTESTER_DIRECTORY}
source graphTesterVirtualEnv/bin/activate
python2 mmri/test_otp.py tests/static-tests.json "${LOGGING_DIRECTORY}/`date +%Y-%m-%d.%H:%M:%S`.json" -u http://0.0.0.0:9050/otp/routers/default/plan --today
deactivate
cd ${CURRENT_WORKING_DIR}