@@ -19,19 +19,19 @@ load test_helpers
19
19
local version=$( grep ' ENV JENKINS_VERSION' Dockerfile | sed -e ' s/ENV JENKINS_VERSION //' )
20
20
# need the last line of output, removing the last char
21
21
local actual_version=$( docker run --rm -ti -e JENKINS_OPTS=" --help --version" --name $SUT_CONTAINER -P $SUT_IMAGE | tail -n 1)
22
- assert " ${version} " echo ${actual_version::- 1}
22
+ assert " ${version} " echo " ${actual_version::- 1} "
23
23
}
24
24
25
25
@test " test jenkins arguments" {
26
26
# running --help --version should return the version, not the help
27
27
local version=$( grep ' ENV JENKINS_VERSION' Dockerfile | sed -e ' s/ENV JENKINS_VERSION //' )
28
28
# need the last line of output, removing the last char
29
29
local actual_version=$( docker run --rm -ti --name $SUT_CONTAINER -P $SUT_IMAGE --help --version | tail -n 1)
30
- assert " ${version} " echo ${actual_version::- 1}
30
+ assert " ${version} " echo " ${actual_version::- 1} "
31
31
}
32
32
33
33
@test " create test container" {
34
- docker run -d --name $SUT_CONTAINER -P $SUT_IMAGE
34
+ docker run -d -e JAVA_OPTS= " -Duser.timezone=Europe/Madrid -Dhudson.model.DirectoryBrowserSupport.CSP= \" default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; \" " - -name $SUT_CONTAINER -P $SUT_IMAGE
35
35
}
36
36
37
37
@test " test container is running" {
@@ -43,6 +43,10 @@ load test_helpers
43
43
retry 30 5 test_url /api/json
44
44
}
45
45
46
- @test " clean test containers" {
47
- cleanup $SUT_CONTAINER
46
+ @test " JAVA_OPTS are set" {
47
+ local sed_expr=' s/<wbr>//g;s/<td class="pane">.*<\/td><td class.*normal">//g;s/<t.>//g;s/<\/t.>//g'
48
+ assert ' default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';' \
49
+ bash -c " curl -fsSL $( get_jenkins_url) /systemInfo | sed 's/<\/tr>/<\/tr>\'$'\n/g' | grep '<td class=\" pane\" >hudson.model.DirectoryBrowserSupport.CSP</td>' | sed -e '${sed_expr} '"
50
+ assert ' Europe/Madrid' \
51
+ bash -c " curl -fsSL $( get_jenkins_url) /systemInfo | sed 's/<\/tr>/<\/tr>\'$'\n/g' | grep '<td class=\" pane\" >user.timezone</td>' | sed -e '${sed_expr} '"
48
52
}
0 commit comments