1
- #! /bin/sh -x
1
+ #! /bin/sh
2
2
3
3
. " $( dirname " $0 " ) " /functions
4
4
. detect-environment
5
5
. compile-options
6
6
. version
7
7
8
+ # Special handling for Windows
8
9
case " $OS " in
9
10
mingw)
10
11
if [ " no" != " $ESCAPETEST " ]; then
15
16
;;
16
17
esac
17
18
19
+ # Launches an interactive shell for debugging purposes.
20
+ # This is useful for developers who want to inspect the environment mid-build.
18
21
if [ " $TEST_SHELL " = " 1" ]; then
19
22
if [ -n " $SHELL " ]; then
20
23
" $SHELL " -i
@@ -23,25 +26,33 @@ if [ "$TEST_SHELL" = "1" ]; then
23
26
else
24
27
/bin/sh -i
25
28
fi
26
- echo " Forcing failure to interrupt build..."
29
+ log_debug " Forcing failure to interrupt build..."
27
30
exit 1
28
- else
29
- if [ " $TESTS " = all ]; then
30
- chmod -R g-w " $BASEDIR " /core/tests/acceptance/*
31
- chmod -R g-w " $BASEDIR " /masterfiles/tests/acceptance/*
32
- chmod -R g-w " $BASEDIR " /masterfiles/lib/*
33
- chmod -R g-w " $BASEDIR " /masterfiles/inventory/*
34
- if [ " $PROJECT " != " community" ]; then
35
- chmod -R g-w " $BASEDIR " /enterprise/tests/acceptance/*
36
- fi
37
- for project in $( projects_to_test) ; do
38
- # Unfortunately VERBOSE env variable is being used by both
39
- # "testall" script and automake. As a result, setting VERBOSE=1
40
- # causes testall to pass "1" as an argument to cf-agent!
41
- # Workarount: VERBOSE=-I
42
- NETWORK_TESTS=0 $MAKE -C " $BASEDIR " /" $project " VERBOSE=-I check
43
- done
44
- elif [ " $TESTS " = unit ]; then
45
- $MAKE -C " $BASEDIR " /core/tests/unit VERBOSE=-I check
31
+ fi
32
+
33
+ if [ " $TESTS " = all ]; then
34
+ # Run all tests
35
+
36
+ # Make sure tests are not writable by others.
37
+ # Otherwise, the agent will refuse to run them due to security concerns.
38
+ chmod -R g-w " $BASEDIR " /core/tests/acceptance/*
39
+ chmod -R g-w " $BASEDIR " /masterfiles/tests/acceptance/*
40
+ chmod -R g-w " $BASEDIR " /masterfiles/lib/*
41
+ chmod -R g-w " $BASEDIR " /masterfiles/inventory/*
42
+
43
+ # Enterprise repo will not be there in a community build
44
+ if [ " $PROJECT " != " community" ]; then
45
+ chmod -R g-w " $BASEDIR " /enterprise/tests/acceptance/*
46
46
fi
47
+
48
+ for project in $( projects_to_test) ; do
49
+ # Unfortunately VERBOSE env variable is being used by both
50
+ # "testall" script and automake. As a result, setting VERBOSE=1
51
+ # causes testall to pass "1" as an argument to cf-agent!
52
+ # Workaround: VERBOSE=-I
53
+ NETWORK_TESTS=0 $MAKE -C " $BASEDIR " /" $project " VERBOSE=-I check
54
+ done
55
+ elif [ " $TESTS " = unit ]; then
56
+ # Run only unit tests
57
+ $MAKE -C " $BASEDIR " /core/tests/unit VERBOSE=-I check
47
58
fi
0 commit comments