-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathassignment-test.sh
More file actions
executable file
·41 lines (33 loc) · 1.06 KB
/
assignment-test.sh
File metadata and controls
executable file
·41 lines (33 loc) · 1.06 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
#!/bin/bash
pushd $(dirname $0)
source script-helpers
SCRIPTS_DIR=$(pwd)
SOURCE_DIR=$(realpath ${SCRIPTS_DIR}/../../../)
pushd ${SOURCE_DIR}/finder-app
./writer.sh
rc=$?
if [ $rc -ne 1 ]; then
add_validate_error "writer.sh should have exited with return value 1 if no parameters were specified"
fi
./writer.sh "$filedir"
rc=$?
if [ $rc -ne 1 ]; then
add_validate_error "writer.sh should have exited with return value 1 if write string is not specified"
fi
# Run finder-test.sh with default directory and random directory
./finder-test.sh
rc=$?
if [ $rc -ne 0 ]; then
add_validate_error "finder-test.sh execution for default directory failed with return code $rc"
fi
# generate directory name from random string
dir_name=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w32 | head -n 1)
./finder-test.sh 10 AELD_IS_FUN $dir_name
rc=$?
if [ $rc -ne 0 ]; then
add_validate_error "finder-test.sh execution for random directory failed with return code $rc"
fi
if [ ! -z "${validate_error}" ]; then
echo "Validation failed with error list ${validate_error}"
exit 1
fi