Browse code

Revert "Implemented a single-directive library import for Origin Bash scripts"

Clayton Coleman authored on 2016/05/12 07:17:07
Showing 87 changed files
... ...
@@ -7,14 +7,14 @@ set -o pipefail
7 7
 # Set a useful format for xtrace output
8 8
 # export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
9 9
 
10
-OS_ROOT=$(
10
+ORIGIN_ROOT=$(
11 11
   unset CDPATH
12 12
   origin_root=$(dirname "${BASH_SOURCE}")/../..
13 13
   cd "${origin_root}"
14 14
   pwd
15 15
 )
16
-source "${OS_ROOT}/hack/lib/init.sh"
17
-source ${OS_ROOT}/contrib/vagrant/provision-util.sh
16
+source ${ORIGIN_ROOT}/hack/common.sh
17
+source ${ORIGIN_ROOT}/contrib/vagrant/provision-util.sh
18 18
 
19 19
 # Passed as arguments to provisioning script
20 20
 MASTER_IP=${1:-""}
... ...
@@ -26,7 +26,7 @@ INSTANCE_PREFIX=${4:-${OPENSHIFT_INSTANCE_PREFIX:-openshift}}
26 26
 FIXUP_NET_UDEV=false
27 27
 NETWORK_PLUGIN=${OPENSHIFT_NETWORK_PLUGIN:-""}
28 28
 NODE_INDEX=0
29
-CONFIG_ROOT=${OS_ROOT}
29
+CONFIG_ROOT=${ORIGIN_ROOT}
30 30
 SKIP_BUILD=${OPENSHIFT_SKIP_BUILD:-false}
31 31
 
32 32
 # Parse optional arguments
... ...
@@ -6,7 +6,8 @@ set -o pipefail
6 6
 
7 7
 STARTTIME=$(date +%s)
8 8
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
9
-source "${OS_ROOT}/hack/lib/init.sh"
9
+source "${OS_ROOT}/hack/common.sh"
10
+source "${OS_ROOT}/hack/util.sh"
10 11
 os::log::install_errexit
11 12
 
12 13
 pushd "${OS_ROOT}/assets" > /dev/null
... ...
@@ -11,7 +11,8 @@ set -o pipefail
11 11
 
12 12
 STARTTIME=$(date +%s)
13 13
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
14
-source "${OS_ROOT}/hack/lib/init.sh"
14
+source "${OS_ROOT}/hack/common.sh"
15
+source "${OS_ROOT}/hack/util.sh"
15 16
 os::log::install_errexit
16 17
 
17 18
 # Go to the top of the tree.
... ...
@@ -8,7 +8,8 @@ set -o pipefail
8 8
 
9 9
 STARTTIME=$(date +%s)
10 10
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
11
-source "${OS_ROOT}/hack/lib/init.sh"
11
+source "${OS_ROOT}/hack/common.sh"
12
+source "${OS_ROOT}/hack/util.sh"
12 13
 os::log::install_errexit
13 14
 
14 15
 platforms=( "${OS_CROSS_COMPILE_PLATFORMS[@]}" )
... ...
@@ -8,7 +8,8 @@ set -o pipefail
8 8
 
9 9
 STARTTIME=$(date +%s)
10 10
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
11
-source "${OS_ROOT}/hack/lib/init.sh"
11
+source "${OS_ROOT}/hack/common.sh"
12
+source "${OS_ROOT}/hack/util.sh"
12 13
 os::log::install_errexit
13 14
 
14 15
 # only works on Linux for now, all other platforms must build binaries themselves
... ...
@@ -13,7 +13,8 @@ set -o pipefail
13 13
 
14 14
 STARTTIME=$(date +%s)
15 15
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
16
-source "${OS_ROOT}/hack/lib/init.sh"
16
+source "${OS_ROOT}/hack/common.sh"
17
+source "${OS_ROOT}/hack/util.sh"
17 18
 source "${OS_ROOT}/contrib/node/install-sdn.sh"
18 19
 os::log::install_errexit
19 20
 
... ...
@@ -15,7 +15,7 @@ function absolute_path() {
15 15
 
16 16
 STARTTIME=$(date +%s)
17 17
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
18
-source "${OS_ROOT}/hack/lib/init.sh"
18
+source "${OS_ROOT}/hack/text.sh"
19 19
 origin_path="src/github.com/openshift/origin"
20 20
 
21 21
 # TODO: Remove this check and fix the docker command instead after the
... ...
@@ -11,7 +11,8 @@ set -o pipefail
11 11
 
12 12
 STARTTIME=$(date +%s)
13 13
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
14
-source "${OS_ROOT}/hack/lib/init.sh"
14
+source "${OS_ROOT}/hack/common.sh"
15
+source "${OS_ROOT}/hack/util.sh"
15 16
 os::log::install_errexit
16 17
 
17 18
 # Go to the top of the tree.
... ...
@@ -7,7 +7,8 @@ set -o nounset
7 7
 set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/common.sh"
11
+source "${OS_ROOT}/hack/util.sh"
11 12
 os::log::install_errexit
12 13
 
13 14
 # Go to the top of the tree.
... ...
@@ -3,7 +3,7 @@
3 3
 set -e
4 4
 
5 5
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
6
-source "${OS_ROOT}/hack/lib/init.sh"
6
+source "${OS_ROOT}/hack/common.sh"
7 7
 
8 8
 pushd ${OS_ROOT}/assets > /dev/null
9 9
   echo "Cleaning up bower_components, node_modules, and dist directories..."
... ...
@@ -2,6 +2,11 @@
2 2
 # This utility file contains functions that wrap commands to be tested. All wrapper functions run commands
3 3
 # in a sub-shell and redirect all output. Tests in test-cmd *must* use these functions for testing.
4 4
 
5
+# We assume ${OS_ROOT} is set
6
+source "${OS_ROOT}/hack/text.sh"
7
+source "${OS_ROOT}/hack/util.sh"
8
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9
+
5 10
 # expect_success runs the cmd and expects an exit code of 0
6 11
 function os::cmd::expect_success() {
7 12
 	if [[ $# -ne 1 ]]; then echo "os::cmd::expect_success expects only one argument, got $#"; exit 1; fi
... ...
@@ -9,7 +14,6 @@ function os::cmd::expect_success() {
9 9
 
10 10
 	os::cmd::internal::expect_exit_code_run_grep "${cmd}"
11 11
 }
12
-readonly -f os::cmd::expect_success
13 12
 
14 13
 # expect_failure runs the cmd and expects a non-zero exit code
15 14
 function os::cmd::expect_failure() {
... ...
@@ -18,7 +22,6 @@ function os::cmd::expect_failure() {
18 18
 
19 19
 	os::cmd::internal::expect_exit_code_run_grep "${cmd}" "os::cmd::internal::failure_func"
20 20
 }
21
-readonly -f os::cmd::expect_failure
22 21
 
23 22
 # expect_success_and_text runs the cmd and expects an exit code of 0
24 23
 # as well as running a grep test to find the given string in the output
... ...
@@ -29,7 +32,6 @@ function os::cmd::expect_success_and_text() {
29 29
 
30 30
 	os::cmd::internal::expect_exit_code_run_grep "${cmd}" "os::cmd::internal::success_func" "${expected_text}"
31 31
 }
32
-readonly -f os::cmd::expect_success_and_text
33 32
 
34 33
 # expect_failure_and_text runs the cmd and expects a non-zero exit code
35 34
 # as well as running a grep test to find the given string in the output
... ...
@@ -40,7 +42,6 @@ function os::cmd::expect_failure_and_text() {
40 40
 
41 41
 	os::cmd::internal::expect_exit_code_run_grep "${cmd}" "os::cmd::internal::failure_func" "${expected_text}"
42 42
 }
43
-readonly -f os::cmd::expect_failure_and_text
44 43
 
45 44
 # expect_success_and_not_text runs the cmd and expects an exit code of 0
46 45
 # as well as running a grep test to ensure the given string is not in the output
... ...
@@ -51,7 +52,6 @@ function os::cmd::expect_success_and_not_text() {
51 51
 
52 52
 	os::cmd::internal::expect_exit_code_run_grep "${cmd}" "os::cmd::internal::success_func" "${expected_text}" "os::cmd::internal::failure_func"
53 53
 }
54
-readonly -f os::cmd::expect_success_and_not_text
55 54
 
56 55
 # expect_failure_and_not_text runs the cmd and expects a non-zero exit code
57 56
 # as well as running a grep test to ensure the given string is not in the output
... ...
@@ -62,7 +62,6 @@ function os::cmd::expect_failure_and_not_text() {
62 62
 
63 63
 	os::cmd::internal::expect_exit_code_run_grep "${cmd}" "os::cmd::internal::failure_func" "${expected_text}" "os::cmd::internal::failure_func"
64 64
 }
65
-readonly -f os::cmd::expect_failure_and_not_text
66 65
 
67 66
 # expect_code runs the cmd and expects a given exit code
68 67
 function os::cmd::expect_code() {
... ...
@@ -72,7 +71,6 @@ function os::cmd::expect_code() {
72 72
 
73 73
 	os::cmd::internal::expect_exit_code_run_grep "${cmd}" "os::cmd::internal::specific_code_func ${expected_cmd_code}"
74 74
 }
75
-readonly -f os::cmd::expect_code
76 75
 
77 76
 # expect_code_and_text runs the cmd and expects the given exit code
78 77
 # as well as running a grep test to find the given string in the output
... ...
@@ -84,7 +82,6 @@ function os::cmd::expect_code_and_text() {
84 84
 
85 85
 	os::cmd::internal::expect_exit_code_run_grep "${cmd}" "os::cmd::internal::specific_code_func ${expected_cmd_code}" "${expected_text}"
86 86
 }
87
-readonly -f os::cmd::expect_code_and_text
88 87
 
89 88
 # expect_code_and_not_text runs the cmd and expects the given exit code
90 89
 # as well as running a grep test to ensure the given string is not in the output
... ...
@@ -96,7 +93,6 @@ function os::cmd::expect_code_and_not_text() {
96 96
 
97 97
 	os::cmd::internal::expect_exit_code_run_grep "${cmd}" "os::cmd::internal::specific_code_func ${expected_cmd_code}" "${expected_text}" "os::cmd::internal::failure_func"
98 98
 }
99
-readonly -f os::cmd::expect_code_and_not_text
100 99
 
101 100
 millisecond=1
102 101
 second=$(( 1000 * millisecond ))
... ...
@@ -113,7 +109,6 @@ function os::cmd::try_until_success() {
113 113
 
114 114
 	os::cmd::internal::run_until_exit_code "${cmd}" "os::cmd::internal::success_func" "${duration}" "${interval}"
115 115
 }
116
-readonly -f os::cmd::try_until_success
117 116
 
118 117
 # os::cmd::try_until_failure runs the cmd until either the command fails or times out
119 118
 # the default time-out for os::cmd::try_until_failure is 60 seconds.
... ...
@@ -125,7 +120,6 @@ function os::cmd::try_until_failure() {
125 125
 
126 126
 	os::cmd::internal::run_until_exit_code "${cmd}" "os::cmd::internal::failure_func" "${duration}" "${interval}"
127 127
 }
128
-readonly -f os::cmd::try_until_failure
129 128
 
130 129
 # os::cmd::try_until_text runs the cmd until either the command outputs the desired text or times out
131 130
 # the default time-out for os::cmd::try_until_text is 60 seconds.
... ...
@@ -138,7 +132,6 @@ function os::cmd::try_until_text() {
138 138
 
139 139
 	os::cmd::internal::run_until_text "${cmd}" "${text}" "${duration}" "${interval}"
140 140
 }
141
-readonly -f os::cmd::try_until_text
142 141
 
143 142
 # Functions in the os::cmd::internal namespace are discouraged from being used outside of os::cmd
144 143
 
... ...
@@ -230,15 +223,14 @@ function os::cmd::internal::expect_exit_code_run_grep() {
230 230
 	( IFS=$'\n'; echo "${junit_log[*]}" >> "${JUNIT_REPORT_OUTPUT:-/dev/null}" )
231 231
 	os::test::junit::declare_test_end
232 232
 	return "${return_code}"
233
+
233 234
 }
234
-readonly -f os::cmd::internal::expect_exit_code_run_grep
235 235
 
236 236
 # os::cmd::internal::init_tempdir initializes the temporary directory
237 237
 function os::cmd::internal::init_tempdir() {
238 238
 	mkdir -p "${os_cmd_internal_tmpdir}"
239 239
 	rm -f "${os_cmd_internal_tmpdir}"/tmp_std{out,err}.log
240 240
 }
241
-readonly -f os::cmd::internal::init_tempdir
242 241
 
243 242
 # os::cmd::internal::describe_call determines the file:line of the latest function call made
244 243
 # from outside of this file in the call stack, and the name of the function being called from
... ...
@@ -268,7 +260,6 @@ function os::cmd::internal::describe_call() {
268 268
 
269 269
 	echo "${full_name}"
270 270
 }
271
-readonly -f os::cmd::internal::describe_call
272 271
 
273 272
 # os::cmd::internal::determine_caller determines the file relative to the OpenShift Origin root directory
274 273
 # and line number of the function call to the outer os::cmd wrapper function
... ...
@@ -293,7 +284,6 @@ function os::cmd::internal::determine_caller() {
293 293
 	local caller_line="${BASH_LINENO[${call_depth}-1]}"
294 294
 	echo "${caller_file}:${caller_line}"
295 295
 }
296
-readonly -f os::cmd::internal::determine_caller
297 296
 
298 297
 # os::cmd::internal::describe_expectation describes a command return code evaluation function
299 298
 function os::cmd::internal::describe_expectation() {
... ...
@@ -310,7 +300,6 @@ function os::cmd::internal::describe_expectation() {
310 310
 		echo "any result"
311 311
 	esac
312 312
 }
313
-readonly -f os::cmd::internal::describe_expectation
314 313
 
315 314
 # os::cmd::internal::seconds_since_epoch returns the number of seconds elapsed since the epoch
316 315
 # with milli-second precision
... ...
@@ -323,7 +312,6 @@ function os::cmd::internal::seconds_since_epoch() {
323 323
 	fi
324 324
 	echo $(bc <<< "scale=3; ${ns}/1000000000")
325 325
 }
326
-readonly -f os::cmd::internal::seconds_since_epoch
327 326
 
328 327
 # os::cmd::internal::run_collecting_output runs the command given, piping stdout and stderr into
329 328
 # the given files, and returning the exit code of the command
... ...
@@ -336,7 +324,6 @@ function os::cmd::internal::run_collecting_output() {
336 336
 
337 337
 	return "${result}"
338 338
 }
339
-readonly -f os::cmd::internal::run_collecting_output
340 339
 
341 340
 # os::cmd::internal::success_func determines if the input exit code denotes success
342 341
 # this function returns 0 for false and 1 for true to be compatible with arithmetic tests
... ...
@@ -347,7 +334,6 @@ function os::cmd::internal::success_func() {
347 347
 	[[ "${exit_code}" -ne "0" ]]
348 348
 	return $?
349 349
 }
350
-readonly -f os::cmd::internal::success_func
351 350
 
352 351
 # os::cmd::internal::failure_func determines if the input exit code denotes failure
353 352
 # this function returns 0 for false and 1 for true to be compatible with arithmetic tests
... ...
@@ -358,7 +344,6 @@ function os::cmd::internal::failure_func() {
358 358
 	[[ "${exit_code}" -eq "0" ]]
359 359
 	return $?
360 360
 }
361
-readonly -f os::cmd::internal::failure_func
362 361
 
363 362
 # os::cmd::internal::specific_code_func determines if the input exit code matches the given code
364 363
 # this function returns 0 for false and 1 for true to be compatible with arithmetic tests
... ...
@@ -370,13 +355,11 @@ function os::cmd::internal::specific_code_func() {
370 370
 	[[ "${exit_code}" -ne "${expected_code}" ]]
371 371
 	return $?
372 372
 }
373
-readonly -f os::cmd::internal::specific_code_func
374 373
 
375 374
 # os::cmd::internal::get_results prints the stderr and stdout files
376 375
 function os::cmd::internal::get_results() {
377 376
 	cat "${os_cmd_internal_tmpout}" "${os_cmd_internal_tmperr}"
378 377
 }
379
-readonly -f os::cmd::internal::get_results
380 378
 
381 379
 # os::cmd::internal::get_try_until_results returns a concise view of the stdout and stderr output files
382 380
 # using a timeline format, where consecutive output lines that are the same are condensed into one line
... ...
@@ -396,14 +379,12 @@ function os::cmd::internal::print_try_until_results() {
396 396
 		echo "There was no error output from the command."
397 397
 	fi
398 398
 }
399
-readonly -f os::cmd::internal::print_try_until_results
400 399
 
401 400
 # os::cmd::internal::mark_attempt marks the end of an attempt in the stdout and stderr log files
402 401
 # this is used to make the try_until_* output more concise
403 402
 function os::cmd::internal::mark_attempt() {
404 403
 	echo -e '\x1e' >> "${os_cmd_internal_tmpout}" | tee "${os_cmd_internal_tmperr}"
405 404
 }
406
-readonly -f os::cmd::internal::mark_attempt
407 405
 
408 406
 # os::cmd::internal::compress_output compresses an output file into timeline representation
409 407
 function os::cmd::internal::compress_output() {
... ...
@@ -411,7 +392,6 @@ function os::cmd::internal::compress_output() {
411 411
 
412 412
 	awk -f ${OS_ROOT}/hack/compress.awk $logfile
413 413
 }
414
-readonly -f os::cmd::internal::compress_output
415 414
 
416 415
 # os::cmd::internal::print_results pretty-prints the stderr and stdout files
417 416
 function os::cmd::internal::print_results() {
... ...
@@ -429,7 +409,6 @@ function os::cmd::internal::print_results() {
429 429
 		echo "There was no error output from the command."
430 430
 	fi
431 431
 }
432
-readonly -f os::cmd::internal::print_results
433 432
 
434 433
 # os::cmd::internal::assemble_causes determines from the two input booleans which part of the test
435 434
 # failed and generates a nice delimited list of failure causes
... ...
@@ -448,7 +427,7 @@ function os::cmd::internal::assemble_causes() {
448 448
 	local list=$(printf '; %s' "${causes[@]}")
449 449
 	echo "${list:2}"
450 450
 }
451
-readonly -f os::cmd::internal::assemble_causes
451
+
452 452
 
453 453
 # os::cmd::internal::run_until_exit_code runs the provided command until the exit code test given
454 454
 # succeeds or the timeout given runs out. Output from the command to be tested is suppressed unless
... ...
@@ -530,7 +509,6 @@ function os::cmd::internal::run_until_exit_code() {
530 530
 	os::test::junit::declare_test_end
531 531
 	return "${return_code}"
532 532
 }
533
-readonly -f os::cmd::internal::run_until_exit_code
534 533
 
535 534
 # os::cmd::internal::run_until_text runs the provided command until the command output contains the
536 535
 # given text or the timeout given runs out. Output from the command to be tested is suppressed unless
... ...
@@ -615,4 +593,3 @@ function os::cmd::internal::run_until_text() {
615 615
 	os::test::junit::declare_test_end
616 616
 	return "${return_code}"
617 617
 }
618
-readonly -f os::cmd::internal::run_until_text
619 618
\ No newline at end of file
... ...
@@ -120,23 +120,21 @@ readonly OS_BINARY_RELEASE_CLIENT_EXTRA=(
120 120
 
121 121
 # os::build::binaries_from_targets take a list of build targets and return the
122 122
 # full go package to be built
123
-function os::build::binaries_from_targets() {
123
+os::build::binaries_from_targets() {
124 124
   local target
125 125
   for target; do
126 126
     echo "${OS_GO_PACKAGE}/${target}"
127 127
   done
128 128
 }
129
-readonly -f os::build::binaries_from_targets
130 129
 
131 130
 # Asks golang what it thinks the host platform is.  The go tool chain does some
132 131
 # slightly different things when the target platform matches the host platform.
133
-function os::build::host_platform() {
132
+os::build::host_platform() {
134 133
   echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)"
135 134
 }
136
-readonly -f os::build::host_platform
137 135
 
138 136
 # Create a user friendly version of host_platform for end users
139
-function os::build::host_platform_friendly() {
137
+os::build::host_platform_friendly() {
140 138
   local platform=${1:-}
141 139
   if [[ -z "${platform}" ]]; then
142 140
     platform=$(os::build::host_platform)
... ...
@@ -153,7 +151,6 @@ function os::build::host_platform_friendly() {
153 153
     echo "$(go env GOHOSTOS)-$(go env GOHOSTARCH)"
154 154
   fi
155 155
 }
156
-readonly -f os::build::host_platform_friendly
157 156
 
158 157
 # os::build::setup_env will check that the `go` commands is available in
159 158
 # ${PATH}. If not running on Travis, it will also check that the Go version is
... ...
@@ -164,7 +161,7 @@ readonly -f os::build::host_platform_friendly
164 164
 #     stuff.
165 165
 #   export GOBIN - This is actively unset if already set as we want binaries
166 166
 #     placed in a predictable place.
167
-function os::build::setup_env() {
167
+os::build::setup_env() {
168 168
   if [[ -z "$(which go)" ]]; then
169 169
     cat <<EOF
170 170
 
... ...
@@ -234,7 +231,6 @@ EOF
234 234
   export GOPATH
235 235
   export OS_TARGET_BIN
236 236
 }
237
-readonly -f os::build::setup_env
238 237
 
239 238
 # Build static binary targets.
240 239
 #
... ...
@@ -243,10 +239,9 @@ readonly -f os::build::setup_env
243 243
 #     are built.
244 244
 #   OS_BUILD_PLATFORMS - Incoming variable of targets to build for.  If unset
245 245
 #     then just the host architecture is built.
246
-function os::build::build_static_binaries() {
246
+os::build::build_static_binaries() {
247 247
   CGO_ENABLED=0 os::build::build_binaries -a -installsuffix=cgo $@
248 248
 }
249
-readonly -f os::build::build_static_binaries
250 249
 
251 250
 # Build binaries targets specified
252 251
 #
... ...
@@ -255,7 +250,7 @@ readonly -f os::build::build_static_binaries
255 255
 #     are built.
256 256
 #   OS_BUILD_PLATFORMS - Incoming variable of targets to build for.  If unset
257 257
 #     then just the host architecture is built.
258
-function os::build::build_binaries() {
258
+os::build::build_binaries() {
259 259
   # Create a sub-shell so that we don't pollute the outer environment
260 260
   (
261 261
     # Check for `go` binary and set ${GOPATH}.
... ...
@@ -326,12 +321,11 @@ function os::build::build_binaries() {
326 326
     done
327 327
   )
328 328
 }
329
-readonly -f os::build::build_binaries
330 329
 
331 330
 # Generates the set of target packages, binaries, and platforms to build for.
332 331
 # Accepts binaries via $@, and platforms via OS_BUILD_PLATFORMS, or defaults to
333 332
 # the current platform.
334
-function os::build::export_targets() {
333
+os::build::export_targets() {
335 334
   targets=()
336 335
   local arg
337 336
   for arg; do
... ...
@@ -351,7 +345,6 @@ function os::build::export_targets() {
351 351
     platforms=("$(os::build::host_platform)")
352 352
   fi
353 353
 }
354
-readonly -f os::build::export_targets
355 354
 
356 355
 # This will take $@ from $GOPATH/bin and copy them to the appropriate
357 356
 # place in ${OS_OUTPUT_BINDIR}
... ...
@@ -364,7 +357,7 @@ readonly -f os::build::export_targets
364 364
 # install' will place binaries that match the host platform directly in $GOBIN
365 365
 # while placing cross compiled binaries into `platform_arch` subdirs.  This
366 366
 # complicates pretty much everything else we do around packaging and such.
367
-function os::build::place_bins() {
367
+os::build::place_bins() {
368 368
   (
369 369
     local host_platform
370 370
     host_platform=$(os::build::host_platform)
... ...
@@ -456,9 +449,8 @@ function os::build::place_bins() {
456 456
     done
457 457
   )
458 458
 }
459
-readonly -f os::build::place_bins
460 459
 
461
-function os::build::archive_zip() {
460
+os::build::archive_zip() {
462 461
   local platform_segment="${platform//\//-}"
463 462
   local default_name="${OS_RELEASE_ARCHIVE}-${OS_GIT_VERSION}-${OS_GIT_COMMIT}-${platform_segment}.zip"
464 463
   local archive_name="${archive_name:-$default_name}"
... ...
@@ -470,9 +462,8 @@ function os::build::archive_zip() {
470 470
     zip "${OS_LOCAL_RELEASEPATH}/${archive_name}" -qj "${release_binpath}/${file}"
471 471
   done
472 472
 }
473
-readonly -f os::build::archive_zip
474 473
 
475
-function os::build::archive_tar() {
474
+os::build::archive_tar() {
476 475
   local platform_segment="${platform//\//-}"
477 476
   local base_name="${OS_RELEASE_ARCHIVE}-${OS_GIT_VERSION}-${OS_GIT_COMMIT}-${platform_segment}"
478 477
   local default_name="${base_name}.tar.gz"
... ...
@@ -487,7 +478,6 @@ function os::build::archive_tar() {
487 487
   fi
488 488
   popd &>/dev/null
489 489
 }
490
-readonly -f os::build::archive_tar
491 490
 
492 491
 # Checks if the filesystem on a partition that the provided path points to is
493 492
 # supporting hard links.
... ...
@@ -497,7 +487,7 @@ readonly -f os::build::archive_tar
497 497
 # Returns:
498 498
 #  0 - if hardlinks are supported
499 499
 #  non-zero - if hardlinks aren't supported
500
-function os::build::is_hardlink_supported() {
500
+os::build::is_hardlink_supported() {
501 501
   local path="$1"
502 502
   # Determine if FS supports hard links
503 503
   local temp_file=$(TMPDIR="${path}" mktemp)
... ...
@@ -505,7 +495,6 @@ function os::build::is_hardlink_supported() {
505 505
   rm -f "${temp_file}"
506 506
   return ${supported:-0}
507 507
 }
508
-readonly -f os::build::is_hardlink_supported
509 508
 
510 509
 # Extract a tar.gz compressed archive in a given directory. If the
511 510
 # archive contains hardlinks and the underlying filesystem is not
... ...
@@ -514,7 +503,7 @@ readonly -f os::build::is_hardlink_supported
514 514
 # Input:
515 515
 #   $1 - path to archive file
516 516
 #   $2 - directory where the archive will be extracted
517
-function os::build::extract_tar() {
517
+os::build::extract_tar() {
518 518
   local archive_file="$1"
519 519
   local change_dir="$2"
520 520
 
... ...
@@ -548,20 +537,18 @@ function os::build::extract_tar() {
548 548
     rm -rf "${temp_dir}"
549 549
   fi
550 550
 }
551
-readonly -f os::build::extract_tar
552 551
 
553 552
 # os::build::release_sha calculates a SHA256 checksum over the contents of the
554 553
 # built release directory.
555
-function os::build::release_sha() {
554
+os::build::release_sha() {
556 555
   pushd "${OS_LOCAL_RELEASEPATH}" &> /dev/null
557 556
   sha256sum * > CHECKSUM
558 557
   popd &> /dev/null
559 558
 }
560
-readonly -f os::build::release_sha
561 559
 
562 560
 # os::build::make_openshift_binary_symlinks makes symlinks for the openshift
563 561
 # binary in _output/local/bin/${platform}
564
-function os::build::make_openshift_binary_symlinks() {
562
+os::build::make_openshift_binary_symlinks() {
565 563
   platform=$(os::build::host_platform)
566 564
   if [[ -f "${OS_OUTPUT_BINPATH}/${platform}/openshift" ]]; then
567 565
     for linkname in "${OPENSHIFT_BINARY_SYMLINKS[@]}"; do
... ...
@@ -569,7 +556,6 @@ function os::build::make_openshift_binary_symlinks() {
569 569
     done
570 570
   fi
571 571
 }
572
-readonly -f os::build::make_openshift_binary_symlinks
573 572
 
574 573
 # os::build::detect_local_release_tars verifies there is only one primary and one
575 574
 # image binaries release tar in OS_LOCAL_RELEASEPATH for the given platform specified by
... ...
@@ -579,7 +565,7 @@ readonly -f os::build::make_openshift_binary_symlinks
579 579
 #
580 580
 #   OS_PRIMARY_RELEASE_TAR
581 581
 #   OS_IMAGE_RELEASE_TAR
582
-function os::build::detect_local_release_tars() {
582
+os::build::detect_local_release_tars() {
583 583
   local platform="$1"
584 584
 
585 585
   if [[ ! -d "${OS_LOCAL_RELEASEPATH}" ]]; then
... ...
@@ -613,11 +599,10 @@ function os::build::detect_local_release_tars() {
613 613
   export OS_CLIENT_RELEASE_TAR="${client}"
614 614
   export OS_RELEASE_COMMIT="$(cat ${OS_LOCAL_RELEASEPATH}/.commit)"
615 615
 }
616
-readonly -f os::build::detect_local_release_tars
617 616
 
618 617
 # os::build::get_version_vars loads the standard version variables as
619 618
 # ENV vars
620
-function os::build::get_version_vars() {
619
+os::build::get_version_vars() {
621 620
   if [[ -n ${OS_VERSION_FILE-} ]]; then
622 621
     source "${OS_VERSION_FILE}"
623 622
     return
... ...
@@ -625,10 +610,9 @@ function os::build::get_version_vars() {
625 625
   os::build::os_version_vars
626 626
   os::build::kube_version_vars
627 627
 }
628
-readonly -f os::build::get_version_vars
629 628
 
630 629
 # os::build::os_version_vars looks up the current Git vars
631
-function os::build::os_version_vars() {
630
+os::build::os_version_vars() {
632 631
   local git=(git --work-tree "${OS_ROOT}")
633 632
 
634 633
   if [[ -n ${OS_GIT_COMMIT-} ]] || OS_GIT_COMMIT=$("${git[@]}" rev-parse --short "HEAD^{commit}" 2>/dev/null); then
... ...
@@ -665,18 +649,16 @@ function os::build::os_version_vars() {
665 665
     fi
666 666
   fi
667 667
 }
668
-readonly -f os::build::os_version_vars
669 668
 
670 669
 # os::build::kube_version_vars returns the version of Kubernetes we have
671 670
 # vendored.
672
-function os::build::kube_version_vars() {
671
+os::build::kube_version_vars() {
673 672
   KUBE_GIT_VERSION=$(go run "${OS_ROOT}/tools/godepversion/godepversion.go" "${OS_ROOT}/Godeps/Godeps.json" "k8s.io/kubernetes/pkg/api" "comment")
674 673
   KUBE_GIT_COMMIT=$(go run "${OS_ROOT}/tools/godepversion/godepversion.go" "${OS_ROOT}/Godeps/Godeps.json" "k8s.io/kubernetes/pkg/api")
675 674
 }
676
-readonly -f os::build::kube_version_vars
677 675
 
678 676
 # Saves the environment flags to $1
679
-function os::build::save_version_vars() {
677
+os::build::save_version_vars() {
680 678
   local version_file=${1-}
681 679
   [[ -n ${version_file} ]] || {
682 680
     echo "!!! Internal error.  No file specified in os::build::save_version_vars"
... ...
@@ -693,10 +675,9 @@ KUBE_GIT_COMMIT='${KUBE_GIT_COMMIT-}'
693 693
 KUBE_GIT_VERSION='${KUBE_GIT_VERSION-}'
694 694
 EOF
695 695
 }
696
-readonly -f os::build::save_version_vars
697 696
 
698 697
 # golang 1.5 wants `-X key=val`, but golang 1.4- REQUIRES `-X key val`
699
-function os::build::ldflag() {
698
+os::build::ldflag() {
700 699
   local key=${1}
701 700
   local val=${2}
702 701
 
... ...
@@ -707,10 +688,9 @@ function os::build::ldflag() {
707 707
     echo "-X ${key}=${val}"
708 708
   fi
709 709
 }
710
-readonly -f os::build::ldflag
711 710
 
712 711
 # os::build::ldflags calculates the -ldflags argument for building OpenShift
713
-function os::build::ldflags() {
712
+os::build::ldflags() {
714 713
   # Run this in a subshell to prevent settings/variables from leaking.
715 714
   set -o errexit
716 715
   set -o nounset
... ...
@@ -732,23 +712,21 @@ function os::build::ldflags() {
732 732
   # The -ldflags parameter takes a single string, so join the output.
733 733
   echo "${ldflags[*]-}"
734 734
 }
735
-readonly -f os::build::ldflags
736 735
 
737 736
 # os::build::require_clean_tree exits if the current Git tree is not clean.
738
-function os::build::require_clean_tree() {
737
+os::build::require_clean_tree() {
739 738
   if ! git diff-index --quiet HEAD -- || test $(git ls-files --exclude-standard --others | wc -l) != 0; then
740 739
     echo "You can't have any staged or dirty files in $(pwd) for this command."
741 740
     echo "Either commit them or unstage them to continue."
742 741
     exit 1
743 742
   fi
744 743
 }
745
-readonly -f os::build::require_clean_tree
746 744
 
747 745
 # os::build::commit_range takes one or two arguments - if the first argument is an
748 746
 # integer, it is assumed to be a pull request and the local origin/pr/# branch is
749 747
 # used to determine the common range with the second argument. If the first argument
750 748
 # is not an integer, it is assumed to be a Git commit range and output directly.
751
-function os::build::commit_range() {
749
+os::build::commit_range() {
752 750
   local remote
753 751
   remote="${UPSTREAM_REMOTE:-origin}"
754 752
   if [[ "$1" =~ ^-?[0-9]+$ ]]; then
... ...
@@ -800,9 +778,8 @@ function os::build::commit_range() {
800 800
 
801 801
   echo "$1"
802 802
 }
803
-readonly -f os::build::commit_range
804 803
 
805
-function os::build::gen-docs() {
804
+os::build::gen-docs() {
806 805
   local cmd="$1"
807 806
   local dest="$2"
808 807
   local skipprefix="${3:-}"
... ...
@@ -838,9 +815,8 @@ function os::build::gen-docs() {
838 838
 
839 839
   echo "Assets generated in ${dest}"
840 840
 }
841
-readonly -f os::build::gen-docs
842 841
 
843
-function os::build::get-bin-output-path() {
842
+os::build::get-bin-output-path() {
844 843
   local os_root="${1:-}"
845 844
 
846 845
   if [[ -n "${os_root}" ]]; then
... ...
@@ -848,17 +824,15 @@ function os::build::get-bin-output-path() {
848 848
   fi
849 849
   echo ${os_root}_output/local/bin/$(os::build::host_platform)
850 850
 }
851
-readonly -f os::build::get-bin-output-path
852 851
 
853 852
 # os::build::find-binary locates a locally built binary for the current
854 853
 # platform and returns the path to the binary.  The base path to search
855 854
 # from will default to the current working directory but can be
856 855
 # overridden via the optional second argument.
857
-function os::build::find-binary() {
856
+os::build::find-binary() {
858 857
   local bin="$1"
859 858
   local os_root="${2:-}"
860 859
 
861 860
   local path=$( (ls -t $(os::build::get-bin-output-path "${os_root}")/${bin}) 2>/dev/null || true | head -1 )
862 861
   echo "$path"
863 862
 }
864
-readonly -f os::build::find-binary
865 863
\ No newline at end of file
... ...
@@ -7,7 +7,7 @@ set -o pipefail
7 7
 shopt -s globstar
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/common.sh"
11 11
 
12 12
 # Go to the top of the tree.
13 13
 cd "${OS_ROOT}"
... ...
@@ -11,7 +11,7 @@ set -o nounset
11 11
 set -o pipefail
12 12
 
13 13
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
14
-source "${OS_ROOT}/hack/lib/init.sh"
14
+source "${OS_ROOT}/hack/util.sh"
15 15
 
16 16
 set -e
17 17
 
... ...
@@ -8,7 +8,7 @@ set -o nounset
8 8
 set -o pipefail
9 9
 
10 10
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
11
-source "${OS_ROOT}/hack/lib/init.sh"
11
+source "${OS_ROOT}/hack/common.sh"
12 12
 
13 13
 # Go to the top of the tree.
14 14
 cd "${OS_ROOT}"
... ...
@@ -6,7 +6,8 @@ set -o pipefail
6 6
 
7 7
 STARTTIME=$(date +%s)
8 8
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
9
-source "${OS_ROOT}/hack/lib/init.sh"
9
+source "${OS_ROOT}/hack/common.sh"
10
+source "${OS_ROOT}/hack/util.sh"
10 11
 os::log::install_errexit
11 12
 
12 13
 EXAMPLES=examples
... ...
@@ -8,7 +8,8 @@ set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10 10
 cd "${OS_ROOT}"
11
-source "${OS_ROOT}/hack/lib/init.sh"
11
+source "${OS_ROOT}/hack/util.sh"
12
+source "${OS_ROOT}/hack/common.sh"
12 13
 os::log::install_errexit
13 14
 
14 15
 pushd "${OS_ROOT}/hack/swagger-doc" > /dev/null
... ...
@@ -6,7 +6,7 @@ OPENSHIFT_JVM_VERSION=v1.0.42
6 6
 
7 7
 STARTTIME=$(date +%s)
8 8
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
9
-source "${OS_ROOT}/hack/lib/init.sh"
9
+source "${OS_ROOT}/hack/common.sh"
10 10
 
11 11
 TMPDIR="${TMPDIR:-"/tmp"}"
12 12
 LOG_DIR="${LOG_DIR:-$(mktemp -d ${TMPDIR}/openshift.assets.logs.XXXX)}"
... ...
@@ -7,7 +7,7 @@ set -o nounset
7 7
 set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/util.sh"
11 11
 os::log::install_errexit
12 12
 
13 13
 etcd_version=$(go run ${OS_ROOT}/tools/godepversion/godepversion.go ${OS_ROOT}/Godeps/Godeps.json github.com/coreos/etcd/etcdserver)
... ...
@@ -4,7 +4,7 @@ set -e
4 4
 
5 5
 STARTTIME=$(date +%s)
6 6
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
7
-source "${OS_ROOT}/hack/lib/init.sh"
7
+source "${OS_ROOT}/hack/common.sh"
8 8
 
9 9
 GO_VERSION=($(go version))
10 10
 echo "Detected go version: $(go version)"
11 11
deleted file mode 100644
... ...
@@ -1,24 +0,0 @@
1
-#!/bin/bash
2
-
3
-# This script is meant to be the entrypoint for OpenShift Bash scripts to import all of the support
4
-# libraries at once in order to make Bash script preambles as minimal as possible. This script recur-
5
-# sively `source`s *.sh files in this directory tree. As such, no files should be `source`ed outside
6
-# of this script to ensure that we do not attempt to overwrite read-only variables.
7
-
8
-if [[ -z "${OS_ROOT:-}" ]]; then
9
-	echo "[ERROR] In order to import OpenShift Bash libraries, \$OS_ROOT must be set."
10
-	exit 1
11
-fi
12
-
13
-library_files=( $( find "${OS_ROOT}/hack/lib" -type f -name '*.sh' -not -path '*/hack/lib/init.sh' ) )
14
-# TODO(skuzmets): Move the contents of the following files into respective library files.
15
-library_files+=( "${OS_ROOT}/hack/cmd_util.sh" )
16
-library_files+=( "${OS_ROOT}/hack/common.sh" )
17
-library_files+=( "${OS_ROOT}/hack/text.sh" )
18
-library_files+=( "${OS_ROOT}/hack/util.sh" )
19
-
20
-for library_file in "${library_files[@]}"; do
21
-	source "${library_file}"
22
-done
23
-
24
-unset library_files library_file
25 1
\ No newline at end of file
... ...
@@ -14,7 +14,6 @@
14 14
 function os::log::install_system_logger_cleanup() {
15 15
     trap "os::log::clean_up_logger; $(trap -p EXIT | awk -F"'" '{print $2}')" EXIT
16 16
 }
17
-readonly -f os::log::install_system_logger_cleanup
18 17
 
19 18
 # os::log::clean_up_logger should be trapped so that it can stop the logging utility once the script that
20 19
 # installed it is finished.
... ...
@@ -82,7 +81,6 @@ function os::log::clean_up_logger() {
82 82
 
83 83
     return "${return_code}"
84 84
 }
85
-readonly -f os::log::clean_up_logger
86 85
 
87 86
 # os::log::internal::prune_datafile removes the given columns from a datafile created by 'sadf -d'
88 87
 #
... ...
@@ -120,7 +118,6 @@ function os::log::internal::prune_datafile() {
120 120
     sed -i '1s/^/# /' "${datafile}.tmp"
121 121
     mv "${datafile}.tmp" "${datafile}"
122 122
 }
123
-readonly -f os::log::internal::prune_datafile
124 123
 
125 124
 # os::log::internal::plot uses gnuplot to make a plot of some data across time points. This function is intended to be used 
126 125
 # on the output of a 'sar -f' read of a sar binary file. Plots will be made of all columns and stacked on each other with one x axis.
... ...
@@ -186,7 +183,7 @@ function os::log::internal::plot() {
186 186
 
187 187
     echo "[INFO] Stacked plot for log subset \"${plotname}\" written to ${LOG_DIR}/${plotname}.pdf"
188 188
 }
189
-readonly -f os::log::internal::plot
189
+
190 190
 
191 191
 # os::log::start_system_logger installs the system logger and begins logging
192 192
 #
... ...
@@ -210,7 +207,7 @@ function os::log::start_system_logger() {
210 210
 
211 211
     os::log::install_system_logger_cleanup
212 212
 }
213
-readonly -f os::log::start_system_logger
213
+
214 214
 
215 215
 # os::log::internal::run_system_logger runs the system logger in the background.
216 216
 # 'sar' is configured to run once a second for 24 hours, so the cleanup trap should be installed to ensure that
... ...
@@ -232,5 +229,4 @@ function os::log::internal::run_system_logger() {
232 232
     LOGGER_PID=$!
233 233
     readonly LOGGER_PID
234 234
     export LOGGER_PID
235
-}
236
-readonly -f os::log::internal::run_system_logger
237 235
\ No newline at end of file
236
+}
238 237
\ No newline at end of file
... ...
@@ -20,7 +20,6 @@ function os::test::junit::declare_suite_start() {
20 20
     NUM_OS_JUNIT_SUITES_IN_FLIGHT=$(( ${num_suites} + 1 ))
21 21
     export NUM_OS_JUNIT_SUITES_IN_FLIGHT
22 22
 }
23
-readonly -f os::test::junit::declare_suite_start
24 23
 
25 24
 # os::test::junit::declare_suite_end prints a message declaring the end of a test suite
26 25
 # If there aren't any suites in flight, this function will fail.
... ...
@@ -44,7 +43,6 @@ function os::test::junit::declare_suite_end() {
44 44
     NUM_OS_JUNIT_SUITES_IN_FLIGHT=$(( ${num_suites} - 1 ))
45 45
     export NUM_OS_JUNIT_SUITES_IN_FLIGHT
46 46
 }
47
-readonly -f os::test::junit::declare_suite_end
48 47
 
49 48
 # os::test::junit::declare_test_start prints a message declaring the start of a test case
50 49
 # If there is already a test marked as being in flight, this function will fail.
... ...
@@ -75,7 +73,6 @@ function os::test::junit::declare_test_start() {
75 75
     NUM_OS_JUNIT_TESTS_IN_FLIGHT=$(( ${num_tests} + 1 ))
76 76
     export NUM_OS_JUNIT_TESTS_IN_FLIGHT
77 77
 }
78
-readonly -f os::test::junit::declare_test_start
79 78
 
80 79
 # os::test::junit::declare_test_end prints a message declaring the end of a test case
81 80
 # If there is no test marked as being in flight, this function will fail.
... ...
@@ -99,7 +96,6 @@ function os::test::junit::declare_test_end() {
99 99
     NUM_OS_JUNIT_TESTS_IN_FLIGHT=$(( ${num_tests} - 1 ))
100 100
     export NUM_OS_JUNIT_TESTS_IN_FLIGHT
101 101
 }
102
-readonly -f os::test::junit::declare_test_end
103 102
 
104 103
 # os::test::junit::check_test_counters checks that we do not have any test suites or test cases in flight
105 104
 # This function should be called at the very end of any test script using jUnit markers to make sure no error in 
... ...
@@ -121,7 +117,6 @@ function os::test::junit::check_test_counters() {
121 121
         return 1
122 122
     fi
123 123
 }
124
-readonly -f os::test::junit::check_test_counters
125 124
 
126 125
 # os::test::junit::reconcile_output appends the necessary suite and test end statements to the jUnit output file
127 126
 # in order to ensure that the file is in a consistent state to allow for parsing
... ...
@@ -141,5 +136,4 @@ function os::test::junit::reconcile_output() {
141 141
     for (( i = 0; i < ${NUM_OS_JUNIT_SUITES_IN_FLIGHT:-0}; i++ )); do
142 142
         os::test::junit::declare_suite_end
143 143
     done
144
-}
145
-readonly -f os::test::junit::reconcile_output
146 144
\ No newline at end of file
145
+}
147 146
\ No newline at end of file
... ...
@@ -1,6 +1,9 @@
1 1
 #!/bin/bash
2 2
 
3 3
 # This script holds library functions for setting up the shell environment for OpenShift scripts
4
+#
5
+# This script assumes $OS_ROOT is set before being sourced
6
+source "${OS_ROOT}/hack/util.sh"
4 7
 
5 8
 # os::util::environment::use_sudo updates $USE_SUDO to be 'true', so that later scripts choosing between
6 9
 # execution using 'sudo' and execution without it chose to use 'sudo'
... ...
@@ -14,7 +17,6 @@
14 14
 function os::util::environment::use_sudo() {
15 15
     export USE_SUDO=true
16 16
 }
17
-readonly -f os::util::environment::use_sudo
18 17
 
19 18
 # os::util::environment::setup_time_vars sets up environment variables that describe durations of time
20 19
 # These variables can be used to specify times for other utility functions
... ...
@@ -32,7 +34,6 @@ function os::util::environment::setup_time_vars() {
32 32
     export TIME_SEC="$(( 1000  * ${TIME_MS} ))"
33 33
     export TIME_MIN="$(( 60 * ${TIME_SEC} ))"
34 34
 }
35
-readonly -f os::util::environment::setup_time_vars
36 35
 
37 36
 # os::util::environment::setup_all_server_vars sets up all environment variables necessary to configure and start an OpenShift server
38 37
 #
... ...
@@ -94,7 +95,6 @@ function os::util::environment::setup_all_server_vars() {
94 94
     os::util::environment::setup_server_vars
95 95
     os::util::environment::setup_images_vars
96 96
 }
97
-readonly -f os::util::environment::setup_all_server_vars
98 97
 
99 98
 # os::util::environment::update_path_var updates $PATH so that OpenShift binaries are available
100 99
 #
... ...
@@ -108,7 +108,6 @@ readonly -f os::util::environment::setup_all_server_vars
108 108
 function os::util::environment::update_path_var() {
109 109
     export PATH="${OS_ROOT}/_output/local/bin/$(os::util::host_platform):${PATH}"
110 110
 }
111
-readonly -f os::util::environment::update_path_var
112 111
 
113 112
 # os::util::environment::setup_misc_tmpdir_vars sets up temporary directory path variables
114 113
 #
... ...
@@ -139,7 +138,6 @@ function os::util::environment::setup_tmpdir_vars() {
139 139
 
140 140
     mkdir -p  "${BASETMPDIR}" "${LOG_DIR}" "${VOLUME_DIR}" "${ARTIFACT_DIR}" "${HOME}"
141 141
 }
142
-readonly -f os::util::environment::setup_tmpdir_vars
143 142
 
144 143
 # os::util::environment::setup_kubelet_vars sets up environment variables necessary for interacting with the kubelet
145 144
 #
... ...
@@ -161,7 +159,6 @@ function os::util::environment::setup_kubelet_vars() {
161 161
     export KUBELET_HOST="${KUBELET_HOST:-${KUBELET_BIND_HOST}}"
162 162
     export KUBELET_PORT="${KUBELET_PORT:-10250}"
163 163
 }
164
-readonly -f os::util::environment::setup_kubelet_vars
165 164
 
166 165
 # os::util::environment::setup_etcd_vars sets up environment variables necessary for interacting with etcd
167 166
 #
... ...
@@ -186,7 +183,6 @@ function os::util::environment::setup_etcd_vars() {
186 186
 
187 187
     mkdir -p "${ETCD_DATA_DIR}"
188 188
 }
189
-readonly -f os::util::environment::setup_etcd_vars
190 189
 
191 190
 # os::util::environment::setup_server_vars sets up environment variables necessary for interacting with the server
192 191
 # 
... ...
@@ -232,7 +228,6 @@ function os::util::environment::setup_server_vars() {
232 232
         export CURL_KEY="${MASTER_CONFIG_DIR}/admin.key"
233 233
     fi
234 234
 }
235
-readonly -f os::util::environment::setup_server_vars
236 235
 
237 236
 # os::util::environment::setup_images_vars sets up environment variables necessary for interacting with release images
238 237
 #
... ...
@@ -248,7 +243,7 @@ function os::util::environment::setup_images_vars() {
248 248
     # Use either the latest release built images, or latest.
249 249
     if [[ -z "${USE_IMAGES-}" ]]; then
250 250
         export TAG='latest'
251
-        export USE_IMAGES="openshift/origin-\${component}:latest"
251
+        export USE_IMAGES='openshift/origin-${component}:latest'
252 252
 
253 253
         if [[ -e "${OS_ROOT}/_output/local/releases/.commit" ]]; then
254 254
             export TAG="$(cat "${OS_ROOT}/_output/local/releases/.commit")"
... ...
@@ -256,4 +251,3 @@ function os::util::environment::setup_images_vars() {
256 256
         fi
257 257
     fi
258 258
 }
259
-readonly -f os::util::environment::setup_images_vars
260 259
\ No newline at end of file
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 # Go to the top of the tree.
11 11
 cd "${OS_ROOT}"
... ...
@@ -12,7 +12,8 @@ set -o nounset
12 12
 set -o pipefail
13 13
 
14 14
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
15
-source "${OS_ROOT}/hack/lib/init.sh"
15
+source "${OS_ROOT}/hack/common.sh"
16
+source "${OS_ROOT}/hack/util.sh"
16 17
 os::log::install_errexit
17 18
 
18 19
 # Go to the top of the tree.
... ...
@@ -12,7 +12,7 @@ set -o pipefail
12 12
 
13 13
 STARTTIME=$(date +%s)
14 14
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
15
-source "${OS_ROOT}/hack/lib/init.sh"
15
+source "${OS_ROOT}/hack/common.sh"
16 16
 
17 17
 # Go to the top of the tree.
18 18
 cd "${OS_ROOT}"
... ...
@@ -11,7 +11,7 @@ set -o nounset
11 11
 set -o pipefail
12 12
 
13 13
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
14
-source "${OS_ROOT}/hack/lib/init.sh"
14
+source "${OS_ROOT}/hack/common.sh"
15 15
 
16 16
 # Check for `go` binary and set ${GOPATH}.
17 17
 os::build::setup_env
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 "${OS_ROOT}/hack/build-go.sh" tools/rebasehelpers/godepchecker
11 11
 
... ...
@@ -7,7 +7,7 @@ set -o nounset
7 7
 set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/common.sh"
11 11
 
12 12
 # Go to the top of the tree.
13 13
 cd "${OS_ROOT}"
... ...
@@ -3,7 +3,7 @@
3 3
 set -e
4 4
 
5 5
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
6
-source "${OS_ROOT}/hack/lib/init.sh"
6
+source "${OS_ROOT}/hack/common.sh"
7 7
 
8 8
 GRUNT_SCHEME=${GRUNT_SCHEME:-https}
9 9
 GRUNT_PORT=${GRUNT_PORT:-9000}
... ...
@@ -6,7 +6,7 @@ set -o pipefail
6 6
 
7 7
 STARTTIME=$(date +%s)
8 8
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
9
-source "${OS_ROOT}/hack/lib/init.sh"
9
+source "${OS_ROOT}/hack/common.sh"
10 10
 
11 11
 # Go to the top of the tree.
12 12
 cd "${OS_ROOT}"
... ...
@@ -10,7 +10,12 @@ set -o pipefail
10 10
 STARTTIME=$(date +%s)
11 11
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
12 12
 cd "${OS_ROOT}"
13
-source "${OS_ROOT}/hack/lib/init.sh"
13
+source "${OS_ROOT}/hack/util.sh"
14
+source "${OS_ROOT}/hack/common.sh"
15
+source "${OS_ROOT}/hack/lib/log.sh"
16
+source "${OS_ROOT}/hack/lib/util/environment.sh"
17
+source "${OS_ROOT}/hack/cmd_util.sh"
18
+source "${OS_ROOT}/hack/lib/test/junit.sh"
14 19
 os::log::install_errexit
15 20
 os::util::environment::setup_time_vars
16 21
 
... ...
@@ -9,7 +9,9 @@ set -o pipefail
9 9
 
10 10
 STARTTIME=$(date +%s)
11 11
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
12
-source "${OS_ROOT}/hack/lib/init.sh"
12
+source "${OS_ROOT}/hack/util.sh"
13
+source "${OS_ROOT}/hack/lib/log.sh"
14
+source "${OS_ROOT}/hack/lib/util/environment.sh"
13 15
 
14 16
 echo "[INFO] Starting containerized end-to-end test"
15 17
 
... ...
@@ -19,7 +19,9 @@ if [[ "${TEST_END_TO_END:-}" != "direct" ]]; then
19 19
 	echo "++ Docker is not installed, running end-to-end against local binaries"
20 20
 fi
21 21
 
22
-source "${OS_ROOT}/hack/lib/init.sh"
22
+source "${OS_ROOT}/hack/util.sh"
23
+source "${OS_ROOT}/hack/lib/log.sh"
24
+source "${OS_ROOT}/hack/lib/util/environment.sh"
23 25
 os::log::install_errexit
24 26
 
25 27
 ensure_iptables_or_die
... ...
@@ -42,7 +42,9 @@ trap exit_trap EXIT
42 42
 
43 43
 start_time=$(date +%s)
44 44
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
45
-source "${OS_ROOT}/hack/lib/init.sh"
45
+source "${OS_ROOT}/hack/common.sh"
46
+source "${OS_ROOT}/hack/util.sh"
47
+source "${OS_ROOT}/hack/lib/util/environment.sh"
46 48
 cd "${OS_ROOT}"
47 49
 os::log::install_errexit
48 50
 os::build::setup_env
... ...
@@ -6,7 +6,11 @@ set -o pipefail
6 6
 
7 7
 STARTTIME=$(date +%s)
8 8
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
9
-source "${OS_ROOT}/hack/lib/init.sh"
9
+source "${OS_ROOT}/hack/common.sh"
10
+source "${OS_ROOT}/hack/util.sh"
11
+source "${OS_ROOT}/hack/text.sh"
12
+source "${OS_ROOT}/hack/lib/log.sh"
13
+source "${OS_ROOT}/hack/lib/util/environment.sh"
10 14
 os::log::install_errexit
11 15
 
12 16
 # Go to the top of the tree.
... ...
@@ -25,7 +25,9 @@ trap exit_trap EXIT
25 25
 
26 26
 start_time=$(date +%s)
27 27
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
28
-source "${OS_ROOT}/hack/lib/init.sh"
28
+source "${OS_ROOT}/hack/common.sh"
29
+source "${OS_ROOT}/hack/util.sh"
30
+source "${OS_ROOT}/hack/lib/util/environment.sh"
29 31
 os::log::install_errexit
30 32
 os::util::environment::setup_tmpdir_vars "test-lib"
31 33
 
... ...
@@ -25,7 +25,9 @@ trap exit_trap EXIT
25 25
 
26 26
 start_time=$(date +%s)
27 27
 OS_ROOT="$( dirname "${BASH_SOURCE}" )"/../../..
28
-source "${OS_ROOT}/hack/lib/init.sh"
28
+source "${OS_ROOT}/hack/lib/log.sh"
29
+source "${OS_ROOT}/hack/lib/test/junit.sh"
30
+source "${OS_ROOT}/hack/cmd_util.sh"
29 31
 os::log::install_errexit
30 32
 
31 33
 # envars used to track these interactions are not propagated out of the subshells used to run these commands
... ...
@@ -9,7 +9,9 @@ set -o pipefail
9 9
 STARTTIME=$(date +%s)
10 10
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
11 11
 cd "${OS_ROOT}"
12
-source "${OS_ROOT}/hack/lib/init.sh"
12
+source "${OS_ROOT}/hack/util.sh"
13
+source "${OS_ROOT}/hack/cmd_util.sh"
14
+source "${OS_ROOT}/hack/lib/test/junit.sh"
13 15
 os::log::install_errexit
14 16
 
15 17
 os::test::junit::declare_suite_start 'tools'
... ...
@@ -7,7 +7,9 @@ set -o pipefail
7 7
 # set -x
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/util.sh"
11
+source "${OS_ROOT}/hack/cmd_util.sh"
12
+source "${OS_ROOT}/hack/lib/test/junit.sh"
11 13
 os::log::install_errexit
12 14
 trap os::test::junit::reconcile_output EXIT
13 15
 
... ...
@@ -9,7 +9,6 @@ function os::text::reset() {
9 9
 		tput sgr0
10 10
 	fi
11 11
 }
12
-readonly -f os::text::reset
13 12
 
14 13
 # os::text::bold sets the terminal output to bold text if it is called in a TTY
15 14
 function os::text::bold() {
... ...
@@ -17,7 +16,6 @@ function os::text::bold() {
17 17
 		tput bold
18 18
 	fi
19 19
 }
20
-readonly -f os::text::bold
21 20
 
22 21
 # os::text::red sets the terminal output to red text if it is called in a TTY
23 22
 function os::text::red() {
... ...
@@ -25,7 +23,6 @@ function os::text::red() {
25 25
 		tput setaf 1
26 26
 	fi
27 27
 }
28
-readonly -f os::text::red
29 28
 
30 29
 # os::text::green sets the terminal output to green text if it is called in a TTY
31 30
 function os::text::green() {
... ...
@@ -33,7 +30,6 @@ function os::text::green() {
33 33
 		tput setaf 2
34 34
 	fi
35 35
 }
36
-readonly -f os::text::green
37 36
 
38 37
 # os::text::blue sets the terminal output to blue text if it is called in a TTY
39 38
 function os::text::blue() {
... ...
@@ -41,7 +37,6 @@ function os::text::blue() {
41 41
 		tput setaf 4
42 42
 	fi
43 43
 }
44
-readonly -f os::text::blue
45 44
 
46 45
 # os::text::yellow sets the terminal output to yellow text if it is called in a TTY
47 46
 function os::text::yellow() {
... ...
@@ -49,7 +44,6 @@ function os::text::yellow() {
49 49
 		tput setaf 11
50 50
 	fi
51 51
 }
52
-readonly -f os::text::yellow
53 52
 
54 53
 # os::text::clear_last_line clears the text from the last line of output to the
55 54
 # terminal and leaves the cursor on that line to allow for overwriting that text
... ...
@@ -60,7 +54,6 @@ function os::text::clear_last_line() {
60 60
 		tput el
61 61
 	fi
62 62
 }
63
-readonly -f os::text::clear_last_line
64 63
 
65 64
 # os::text::print_bold prints all input in bold text
66 65
 function os::text::print_bold() {
... ...
@@ -68,7 +61,6 @@ function os::text::print_bold() {
68 68
 	echo "${*}"
69 69
 	os::text::reset
70 70
 }
71
-readonly -f os::text::print_bold
72 71
 
73 72
 # os::text::print_red prints all input in red text
74 73
 function os::text::print_red() {
... ...
@@ -76,7 +68,6 @@ function os::text::print_red() {
76 76
 	echo "${*}"
77 77
 	os::text::reset
78 78
 }
79
-readonly -f os::text::print_red
80 79
 
81 80
 # os::text::print_red_bold prints all input in bold red text
82 81
 function os::text::print_red_bold() {
... ...
@@ -85,7 +76,6 @@ function os::text::print_red_bold() {
85 85
 	echo "${*}"
86 86
 	os::text::reset
87 87
 }
88
-readonly -f os::text::print_red_bold
89 88
 
90 89
 # os::text::print_green prints all input in green text
91 90
 function os::text::print_green() {
... ...
@@ -93,7 +83,6 @@ function os::text::print_green() {
93 93
 	echo "${*}"
94 94
 	os::text::reset
95 95
 }
96
-readonly -f os::text::print_green
97 96
 
98 97
 # os::text::print_green_bold prints all input in bold green text
99 98
 function os::text::print_green_bold() {
... ...
@@ -102,7 +91,6 @@ function os::text::print_green_bold() {
102 102
 	echo "${*}"
103 103
 	os::text::reset
104 104
 }
105
-readonly -f os::text::print_green_bold
106 105
 
107 106
 # os::text::print_blue prints all input in blue text
108 107
 function os::text::print_blue() {
... ...
@@ -110,7 +98,6 @@ function os::text::print_blue() {
110 110
 	echo "${*}"
111 111
 	os::text::reset
112 112
 }
113
-readonly -f os::text::print_blue
114 113
 
115 114
 # os::text::print_blue_bold prints all input in bold blue text
116 115
 function os::text::print_blue_bold() {
... ...
@@ -119,7 +106,6 @@ function os::text::print_blue_bold() {
119 119
 	echo "${*}"
120 120
 	os::text::reset
121 121
 }
122
-readonly -f os::text::print_blue_bold
123 122
 
124 123
 # os::text::print_yellow prints all input in yellow text
125 124
 function os::text::print_yellow() {
... ...
@@ -127,7 +113,6 @@ function os::text::print_yellow() {
127 127
 	echo "${*}"
128 128
 	os::text::reset
129 129
 }
130
-readonly -f os::text::print_yellow
131 130
 
132 131
 # os::text::print_yellow_bold prints all input in bold yellow text
133 132
 function os::text::print_yellow_bold() {
... ...
@@ -135,5 +120,4 @@ function os::text::print_yellow_bold() {
135 135
 	os::text::bold
136 136
 	echo "${*}"
137 137
 	os::text::reset
138
-}
139
-readonly -f os::text::print_yellow_bold
140 138
\ No newline at end of file
139
+}
141 140
\ No newline at end of file
... ...
@@ -7,7 +7,7 @@ set -o nounset
7 7
 set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/common.sh"
11 11
 
12 12
 platform="$(os::build::host_platform)"
13 13
 if [[ "${platform}" != "linux/amd64" ]]; then
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 # Go to the top of the tree.
11 11
 cd "${OS_ROOT}"
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 # Go to the top of the tree.
11 11
 cd "${OS_ROOT}"
... ...
@@ -7,7 +7,7 @@ set -o nounset
7 7
 set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/common.sh"
11 11
 
12 12
 "${OS_ROOT}/hack/build-go.sh" tools/gendocs
13 13
 
... ...
@@ -14,7 +14,8 @@ set -o pipefail
14 14
 
15 15
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
16 16
 cd "${OS_ROOT}"
17
-source "${OS_ROOT}/hack/lib/init.sh"
17
+source "${OS_ROOT}/hack/util.sh"
18
+source "${OS_ROOT}/hack/common.sh"
18 19
 os::log::install_errexit
19 20
 
20 21
 # read in envar options
... ...
@@ -7,7 +7,8 @@ set -o nounset
7 7
 set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/util.sh"
11
+source "${OS_ROOT}/hack/lib/util/environment.sh"
11 12
 os::log::install_errexit
12 13
 
13 14
 function cleanup()
... ...
@@ -30,7 +30,7 @@
30 30
 # Returns:
31 31
 #  - export ADMIN_KUBECONFIG
32 32
 #  - export CLUSTER_ADMIN_CONTEXT
33
-function configure_os_server() {
33
+function configure_os_server {
34 34
 	# find the same IP that openshift start will bind to.	This allows access from pods that have to talk back to master
35 35
 	if [[ -z "${ALL_IP_ADDRESSES-}" ]]; then
36 36
 		ALL_IP_ADDRESSES="$(openshift start --print-ip)"
... ...
@@ -95,7 +95,7 @@ function configure_os_server() {
95 95
 	${sudo} chmod -R a+rwX "${ADMIN_KUBECONFIG}"
96 96
 	echo "[INFO] To debug: export KUBECONFIG=$ADMIN_KUBECONFIG"
97 97
 }
98
-readonly -f configure_os_server
98
+
99 99
 
100 100
 # start_os_server starts the OpenShift server, exports the PID of the OpenShift server and waits until openshift server endpoints are available
101 101
 # It is advised to use this function after a successful run of 'configure_os_server'
... ...
@@ -120,7 +120,7 @@ readonly -f configure_os_server
120 120
 #  None
121 121
 # Returns:
122 122
 #  - export OS_PID
123
-function start_os_server() {
123
+function start_os_server {
124 124
 	local sudo="${USE_SUDO:+sudo}"
125 125
 
126 126
 	local use_latest_images
... ...
@@ -163,7 +163,6 @@ function start_os_server() {
163 163
 	echo "[INFO] OpenShift server health checks done at: "
164 164
 	date
165 165
 }
166
-readonly -f start_os_server
167 166
 
168 167
 # start_os_master starts the OpenShift master, exports the PID of the OpenShift master and waits until OpenShift master endpoints are available
169 168
 # It is advised to use this function after a successful run of 'configure_os_server'
... ...
@@ -183,7 +182,7 @@ readonly -f start_os_server
183 183
 #  None
184 184
 # Returns:
185 185
 #  - export OS_PID
186
-function start_os_master() {
186
+function start_os_master {
187 187
 	local sudo="${USE_SUDO:+sudo}"
188 188
 
189 189
 	echo "[INFO] `openshift version`"
... ...
@@ -214,11 +213,9 @@ function start_os_master() {
214 214
 	echo "[INFO] OpenShift server health checks done at: "
215 215
 	date
216 216
 }
217
-readonly -f start_os_master
218
-
219 217
 # ensure_iptables_or_die tests if the testing machine has iptables available
220 218
 # and in PATH. Also test whether current user has sudo privileges.
221
-function ensure_iptables_or_die() {
219
+function ensure_iptables_or_die {
222 220
 	if [[ -z "$(which iptables)" ]]; then
223 221
 		echo "IPTables not found - the end-to-end test requires a system with iptables for Kubernetes services."
224 222
 		exit 1
... ...
@@ -237,10 +234,9 @@ function ensure_iptables_or_die() {
237 237
 
238 238
 	set -e
239 239
 }
240
-readonly -f ensure_iptables_or_die
241 240
 
242 241
 # tryuntil loops, retrying an action until it succeeds or times out after 90 seconds.
243
-function tryuntil() {
242
+function tryuntil {
244 243
 	timeout=$(($(date +%s) + 90))
245 244
 	echo "++ Retrying until success or timeout: ${@}"
246 245
 	while [ 1 ]; do
... ...
@@ -258,7 +254,6 @@ function tryuntil() {
258 258
 		fi
259 259
 	done
260 260
 }
261
-readonly -f tryuntil
262 261
 
263 262
 # wait_for_command executes a command and waits for it to
264 263
 # complete or times out after max_wait.
... ...
@@ -267,7 +262,7 @@ readonly -f tryuntil
267 267
 # $2 - Optional maximum time to wait in ms before giving up (Default: 10000ms)
268 268
 # $3 - Optional alternate command to determine if the wait should
269 269
 #		exit before the max_wait
270
-function wait_for_command() {
270
+function wait_for_command {
271 271
 	STARTTIME=$(date +%s)
272 272
 	cmd=$1
273 273
 	msg="Waiting for command to finish: '${cmd}'..."
... ...
@@ -303,7 +298,6 @@ function wait_for_command() {
303 303
 	set -e
304 304
 	return 1
305 305
 }
306
-readonly -f wait_for_command
307 306
 
308 307
 # wait_for_url_timed attempts to access a url in order to
309 308
 # determine if it is available to service requests.
... ...
@@ -311,7 +305,7 @@ readonly -f wait_for_command
311 311
 # $1 - The URL to check
312 312
 # $2 - Optional prefix to use when echoing a successful result
313 313
 # $3 - Optional maximum time to wait before giving up (Default: 10s)
314
-function wait_for_url_timed() {
314
+function wait_for_url_timed {
315 315
 	STARTTIME=$(date +%s)
316 316
 	url=$1
317 317
 	prefix=${2:-}
... ...
@@ -334,14 +328,13 @@ function wait_for_url_timed() {
334 334
 	set -e
335 335
 	return 1
336 336
 }
337
-readonly -f wait_for_url_timed
338 337
 
339 338
 # wait_for_file returns 0 if a file exists, 1 if it does not exist
340 339
 #
341 340
 # $1 - The file to check for existence
342 341
 # $2 - Optional time to sleep between attempts (Default: 0.2s)
343 342
 # $3 - Optional number of attemps to make (Default: 10)
344
-function wait_for_file() {
343
+function wait_for_file {
345 344
 	file=$1
346 345
 	wait=${2:-0.2}
347 346
 	times=${3:-10}
... ...
@@ -354,7 +347,6 @@ function wait_for_file() {
354 354
 	echo "ERROR: gave up waiting for file ${file}"
355 355
 	return 1
356 356
 }
357
-readonly -f wait_for_file
358 357
 
359 358
 # wait_for_url attempts to access a url in order to
360 359
 # determine if it is available to service requests.
... ...
@@ -363,7 +355,7 @@ readonly -f wait_for_file
363 363
 # $2 - Optional prefix to use when echoing a successful result
364 364
 # $3 - Optional time to sleep between attempts (Default: 0.2s)
365 365
 # $4 - Optional number of attemps to make (Default: 10)
366
-function wait_for_url() {
366
+function wait_for_url {
367 367
 	url=$1
368 368
 	prefix=${2:-}
369 369
 	wait=${3:-0.2}
... ...
@@ -387,7 +379,6 @@ function wait_for_url() {
387 387
 	set -e
388 388
 	return 1
389 389
 }
390
-readonly -f wait_for_url
391 390
 
392 391
 # set_curl_args tries to export CURL_ARGS for a program to use.
393 392
 # will do a wait for the files to exist when using curl with
... ...
@@ -396,7 +387,7 @@ readonly -f wait_for_url
396 396
 #
397 397
 # $1 - Optional time to sleep between attempts (Default: 0.2s)
398 398
 # $2 - Optional number of attemps to make (Default: 10)
399
-function set_curl_args() {
399
+function set_curl_args {
400 400
 	wait=${1:-0.2}
401 401
 	times=${2:-10}
402 402
 
... ...
@@ -424,13 +415,12 @@ function set_curl_args() {
424 424
 	fi
425 425
 	export CURL_ARGS="${clientcert_args}"
426 426
 }
427
-readonly -f set_curl_args
428 427
 
429 428
 # Search for a regular expression in a HTTP response.
430 429
 #
431 430
 # $1 - a valid URL (e.g.: http://127.0.0.1:8080)
432 431
 # $2 - a regular expression or text
433
-function validate_response() {
432
+function validate_response {
434 433
 	url=$1
435 434
 	expected_response=$2
436 435
 	wait=${3:-0.2}
... ...
@@ -452,14 +442,14 @@ function validate_response() {
452 452
 	set -e
453 453
 	return 1
454 454
 }
455
-readonly -f validate_response
455
+
456 456
 
457 457
 # reset_tmp_dir will try to delete the testing directory.
458 458
 # If it fails will unmount all the mounts associated with
459 459
 # the test.
460 460
 #
461 461
 # $1 expression for which the mounts should be checked
462
-function reset_tmp_dir() {
462
+reset_tmp_dir() {
463 463
 	local sudo="${USE_SUDO:+sudo}"
464 464
 
465 465
 	set +e
... ...
@@ -473,11 +463,11 @@ function reset_tmp_dir() {
473 473
 	mkdir -p ${BASETMPDIR} ${LOG_DIR} ${ARTIFACT_DIR} ${FAKE_HOME_DIR} ${VOLUME_DIR}
474 474
 	set -e
475 475
 }
476
-readonly -f reset_tmp_dir
477 476
 
478 477
 # kill_all_processes function will kill all
479 478
 # all processes created by the test script.
480
-function kill_all_processes() {
479
+function kill_all_processes()
480
+{
481 481
 	local sudo="${USE_SUDO:+sudo}"
482 482
 
483 483
 	pids=($(jobs -pr))
... ...
@@ -486,16 +476,16 @@ function kill_all_processes() {
486 486
 		$sudo kill ${i} &> /dev/null
487 487
 	done
488 488
 }
489
-readonly -f kill_all_processes
490 489
 
491 490
 # time_now return the time since the epoch in millis
492
-function time_now() {
491
+function time_now()
492
+{
493 493
 	echo $(date +%s000)
494 494
 }
495
-readonly -f time_now
496 495
 
497 496
 # dump_container_logs writes container logs to $LOG_DIR
498
-function dump_container_logs() {
497
+function dump_container_logs()
498
+{
499 499
 	if ! docker version >/dev/null 2>&1; then
500 500
 		return
501 501
 	fi
... ...
@@ -514,14 +504,12 @@ function dump_container_logs() {
514 514
 		docker logs "$container" >&"${LOG_DIR}/container-${container_name}.log"
515 515
 	done
516 516
 }
517
-readonly -f dump_container_logs
518 517
 
519 518
 # delete_empty_logs deletes empty logs
520 519
 function delete_empty_logs() {
521 520
 	# Clean up zero byte log files
522 521
 	find "${ARTIFACT_DIR}" "${LOG_DIR}" -type f -name '*.log' \( -empty \) -delete
523 522
 }
524
-readonly -f delete_empty_logs
525 523
 
526 524
 # truncate_large_logs truncates large logs so we only download the last 20MB
527 525
 function truncate_large_logs() {
... ...
@@ -534,20 +522,18 @@ function truncate_large_logs() {
534 534
 		rm "${file}.tmp"
535 535
 	done
536 536
 }
537
-readonly -f truncate_large_logs
538 537
 
539 538
 ######
540 539
 # start of common functions for extended test group's run.sh scripts
541 540
 ######
542 541
 
543 542
 # exit run if ginkgo not installed
544
-function ensure_ginkgo_or_die() {
543
+function ensure_ginkgo_or_die {
545 544
 	which ginkgo &>/dev/null || (echo 'Run: "go get github.com/onsi/ginkgo/ginkgo"' && exit 1)
546 545
 }
547
-readonly -f ensure_ginkgo_or_die
548 546
 
549 547
 # cleanup_openshift saves container logs, saves resources, and kills all processes and containers
550
-function cleanup_openshift() {
548
+function cleanup_openshift {
551 549
 	ADMIN_KUBECONFIG="${ADMIN_KUBECONFIG:-${BASETMPDIR}/openshift.local.config/master/admin.kubeconfig}"
552 550
 	LOG_DIR="${LOG_DIR:-${BASETMPDIR}/logs}"
553 551
 	ARTIFACT_DIR="${ARTIFACT_DIR:-${LOG_DIR}}"
... ...
@@ -600,10 +586,9 @@ function cleanup_openshift() {
600 600
 	echo "[INFO] Cleanup complete"
601 601
 	set -e
602 602
 }
603
-readonly -f cleanup_openshift
604 603
 
605 604
 # create a .gitconfig for test-cmd secrets
606
-function create_gitconfig() {
605
+function create_gitconfig {
607 606
 	USERNAME=sample-user
608 607
 	PASSWORD=password
609 608
 	BASETMPDIR="${BASETMPDIR:-"/tmp"}"
... ...
@@ -614,7 +599,7 @@ function create_gitconfig() {
614 614
 	echo ${GITCONFIG_DIR}/.gitconfig
615 615
 }
616 616
 
617
-function create_valid_file() {
617
+function create_valid_file {
618 618
 	BASETMPDIR="${BASETMPDIR:-"/tmp"}"
619 619
 	FILE_DIR=$(mktemp -d ${BASETMPDIR}/test-file.XXXX)
620 620
 	touch ${FILE_DIR}/${1}
... ...
@@ -622,7 +607,7 @@ function create_valid_file() {
622 622
 }
623 623
 
624 624
 # install the router for the extended tests
625
-function install_router() {
625
+function install_router {
626 626
 	echo "[INFO] Installing the router"
627 627
 	oadm policy add-scc-to-user privileged -z router --config="${ADMIN_KUBECONFIG}"
628 628
         # Create a TLS certificate for the router
... ...
@@ -645,21 +630,20 @@ function install_router() {
645 645
             echo "[INFO] Changing the router DC to drop SYN packets during a reload"
646 646
             oc set env dc/router -c router DROP_SYN_DURING_RESTART=true
647 647
         fi
648
+
648 649
 }
649
-readonly -f create_gitconfig
650 650
 
651 651
 # install registry for the extended tests
652
-function install_registry() {
652
+function install_registry {
653 653
 	# The --mount-host option is provided to reuse local storage.
654 654
 	echo "[INFO] Installing the registry"
655 655
 	openshift admin registry --config="${ADMIN_KUBECONFIG}" --images="${USE_IMAGES}"
656 656
 }
657
-readonly -f install_registry
658 657
 
659
-function wait_for_registry() {
658
+function wait_for_registry {
660 659
 	wait_for_command '[[ "$(oc get endpoints docker-registry --output-version=v1 --template="{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}" --config=${ADMIN_KUBECONFIG} || echo "0")" != "0" ]]' $((5*TIME_MIN))
661 660
 }
662
-readonly -f wait_for_registry
661
+
663 662
 
664 663
 # Wait for builds to start
665 664
 # $1 namespace
... ...
@@ -669,7 +653,6 @@ function os::build:wait_for_start() {
669 669
 	BUILD_ID=`oc get -n $1 builds  --output-version=v1 --template="{{with index .items 0}}{{.metadata.name}}{{end}}"`
670 670
 	echo "[INFO] Build ${BUILD_ID} started"
671 671
 }
672
-readonly -f os::build:wait_for_start
673 672
 
674 673
 # Wait for builds to complete
675 674
 # $1 namespace
... ...
@@ -683,7 +666,6 @@ function os::build:wait_for_end() {
683 683
 	oc build-logs -n $1 $BUILD_ID > $LOG_DIR/$1build.log
684 684
 	set -e
685 685
 }
686
-readonly -f os::build:wait_for_end
687 686
 
688 687
 # enable-selinux/disable-selinux use the shared control variable
689 688
 # SELINUX_DISABLED to determine whether to re-enable selinux after it
... ...
@@ -692,23 +674,21 @@ readonly -f os::build:wait_for_end
692 692
 # environment where it is not already enabled.
693 693
 SELINUX_DISABLED=0
694 694
 
695
-function enable-selinux() {
695
+function enable-selinux {
696 696
   if [ "${SELINUX_DISABLED}" = "1" ]; then
697 697
     os::log::info "Re-enabling selinux enforcement"
698 698
     sudo setenforce 1
699 699
     SELINUX_DISABLED=0
700 700
   fi
701 701
 }
702
-readonly -f enable-selinux
703 702
 
704
-function disable-selinux() {
703
+function disable-selinux {
705 704
   if selinuxenabled && [ "$(getenforce)" = "Enforcing" ]; then
706 705
     os::log::info "Temporarily disabling selinux enforcement"
707 706
     sudo setenforce 0
708 707
     SELINUX_DISABLED=1
709 708
   fi
710 709
 }
711
-readonly -f disable-selinux
712 710
 
713 711
 ######
714 712
 # end of common functions for extended test group's run.sh scripts
... ...
@@ -716,7 +696,7 @@ readonly -f disable-selinux
716 716
 
717 717
 # Handler for when we exit automatically on an error.
718 718
 # Borrowed from https://gist.github.com/ahendrix/7030300
719
-function os::log::errexit() {
719
+os::log::errexit() {
720 720
 	local err="${PIPESTATUS[@]}"
721 721
 
722 722
 	# If the shell we are in doesn't have errexit set (common in subshells) then
... ...
@@ -727,9 +707,8 @@ function os::log::errexit() {
727 727
 	local code="${1:-1}"
728 728
 	os::log::error_exit "'${BASH_COMMAND}' exited with status $err" "${1:-1}" 1
729 729
 }
730
-readonly -f os::log::errexit
731 730
 
732
-function os::log::install_errexit() {
731
+os::log::install_errexit() {
733 732
 	# trap ERR to provide an error handler whenever a command exits nonzero this
734 733
 	# is a more verbose version of set -o errexit
735 734
 	trap 'os::log::errexit' ERR
... ...
@@ -738,13 +717,12 @@ function os::log::install_errexit() {
738 738
 	# expansions and subshells
739 739
 	set -o errtrace
740 740
 }
741
-readonly -f os::log::install_errexit
742 741
 
743 742
 # Print out the stack trace
744 743
 #
745 744
 # Args:
746 745
 #	 $1 The number of stack frames to skip when printing.
747
-function os::log::stack() {
746
+os::log::stack() {
748 747
 	local stack_skip=${1:-0}
749 748
 	stack_skip=$((stack_skip + 1))
750 749
 	if [[ ${#FUNCNAME[@]} -gt $stack_skip ]]; then
... ...
@@ -760,14 +738,13 @@ function os::log::stack() {
760 760
 	done
761 761
 	fi
762 762
 }
763
-readonly -f os::log::stack
764 763
 
765 764
 # Log an error and exit.
766 765
 # Args:
767 766
 #	 $1 Message to log with the error
768 767
 #	 $2 The error code to return
769 768
 #	 $3 The number of stack frames to skip when printing.
770
-function os::log::error_exit() {
769
+os::log::error_exit() {
771 770
 	local message="${1:-}"
772 771
 	local code="${2:-1}"
773 772
 	local stack_skip="${3:-0}"
... ...
@@ -785,32 +762,27 @@ function os::log::error_exit() {
785 785
 	echo "Exiting with status ${code}" >&2
786 786
 	exit "${code}"
787 787
 }
788
-readonly -f os::log::error_exit
789 788
 
790
-function os::log::with-severity() {
789
+os::log::with-severity() {
791 790
   local msg=$1
792 791
   local severity=$2
793 792
 
794 793
   echo "[$2] ${1}"
795 794
 }
796
-readonly -f os::log::with-severity
797 795
 
798
-function os::log::info() {
796
+os::log::info() {
799 797
   os::log::with-severity "${1}" "INFO"
800 798
 }
801
-readonly -f os::log::info
802 799
 
803
-function os::log::warn() {
800
+os::log::warn() {
804 801
   os::log::with-severity "${1}" "WARNING"
805 802
 }
806
-readonly -f os::log::warn
807 803
 
808
-function os::log::error() {
804
+os::log::error() {
809 805
   os::log::with-severity "${1}" "ERROR"
810 806
 }
811
-readonly -f os::log::error
812 807
 
813
-function find_files() {
808
+find_files() {
814 809
 	find . -not \( \
815 810
 		\( \
816 811
 		-wholename './_output' \
... ...
@@ -825,34 +797,30 @@ function find_files() {
825 825
 		\) -prune \
826 826
 	\) -name '*.go' | sort -u
827 827
 }
828
-readonly -f find_files
829 828
 
830 829
 # Asks golang what it thinks the host platform is.  The go tool chain does some
831 830
 # slightly different things when the target platform matches the host platform.
832
-function os::util::host_platform() {
831
+os::util::host_platform() {
833 832
   echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)"
834 833
 }
835
-readonly -f os::util::host_platform
836 834
 
837
-function os::util::sed() {
835
+os::util::sed() {
838 836
   if [[ "$(go env GOHOSTOS)" == "darwin" ]]; then
839 837
   	sed -i '' "$@"
840 838
   else
841 839
   	sed -i'' "$@"
842 840
   fi
843 841
 }
844
-readonly -f os::util::sed
845 842
 
846
-function os::util::base64decode() {
843
+os::util::base64decode() {
847 844
   if [[ "$(go env GOHOSTOS)" == "darwin" ]]; then
848 845
   	base64 -D $@
849 846
   else
850 847
   	base64 -d $@
851 848
   fi
852 849
 }
853
-readonly -f os::util::base64decode
854 850
 
855
-function os::util::get_object_assert() {
851
+os::util::get_object_assert() {
856 852
   local object=$1
857 853
   local request=$2
858 854
   local expected=$3
... ...
@@ -870,4 +838,3 @@ function os::util::get_object_assert() {
870 870
       return 1
871 871
   fi
872 872
 }
873
-readonly -f os::util::get_object_assert
874 873
\ No newline at end of file
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 cd "${OS_ROOT}"
11 11
 
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 cd "${OS_ROOT}"
11 11
 
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 cd "${OS_ROOT}"
11 11
 
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 cd "${OS_ROOT}"
11 11
 
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 cd "${OS_ROOT}"
11 11
 
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 cd "${OS_ROOT}"
11 11
 
... ...
@@ -14,7 +14,8 @@ if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.4|go1.5') && -z "${FORCE_VERIF
14 14
 fi
15 15
 
16 16
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
17
-source "${OS_ROOT}/hack/lib/init.sh"
17
+source "${OS_ROOT}/hack/common.sh"
18
+source "${OS_ROOT}/hack/util.sh"
18 19
 
19 20
 cd "${OS_ROOT}"
20 21
 
... ...
@@ -17,7 +17,8 @@ if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.4') && -z "${FORCE_VERIFY-}"
17 17
 fi
18 18
 
19 19
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
20
-source "${OS_ROOT}/hack/lib/init.sh"
20
+source "${OS_ROOT}/hack/common.sh"
21
+source "${OS_ROOT}/hack/util.sh"
21 22
 
22 23
 cd "${OS_ROOT}"
23 24
 
... ...
@@ -11,7 +11,8 @@ if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.[4-5]') && -z "${FORCE_VERIFY-
11 11
 fi
12 12
 
13 13
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
14
-source "${OS_ROOT}/hack/lib/init.sh"
14
+source "${OS_ROOT}/hack/common.sh"
15
+source "${OS_ROOT}/hack/util.sh"
15 16
 
16 17
 cd "${OS_ROOT}"
17 18
 mkdir -p _output/govet
... ...
@@ -14,7 +14,7 @@
14 14
 #
15 15
 
16 16
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
17
-source "${OS_ROOT}/hack/lib/init.sh"
17
+source "${OS_ROOT}/hack/common.sh"
18 18
 
19 19
 cd "${OS_ROOT}"
20 20
 
... ...
@@ -7,7 +7,7 @@ set -o nounset
7 7
 set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/util.sh"
11 11
 
12 12
 os::log::install_errexit
13 13
 
... ...
@@ -5,7 +5,7 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9 9
 
10 10
 "${OS_ROOT}/hack/build-go.sh" tools/rebasehelpers/commitchecker
11 11
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,10 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9
+source "${OS_ROOT}/hack/util.sh"
10
+source "${OS_ROOT}/hack/cmd_util.sh"
11
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 12
 os::log::install_errexit
10 13
 trap os::test::junit::reconcile_output EXIT
11 14
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,8 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
9 10
 os::log::install_errexit
10 11
 trap os::test::junit::reconcile_output EXIT
11 12
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/common.sh"
9
+source "${OS_ROOT}/hack/util.sh"
10
+source "${OS_ROOT}/hack/cmd_util.sh"
9 11
 os::log::install_errexit
10 12
 
11 13
 # Cleanup cluster resources created by this test
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -5,7 +5,8 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
9 10
 os::log::install_errexit
10 11
 trap os::test::junit::reconcile_output EXIT
11 12
 
... ...
@@ -5,7 +5,9 @@ set -o nounset
5 5
 set -o pipefail
6 6
 
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
8
-source "${OS_ROOT}/hack/lib/init.sh"
8
+source "${OS_ROOT}/hack/util.sh"
9
+source "${OS_ROOT}/hack/cmd_util.sh"
10
+source "${OS_ROOT}/hack/lib/test/junit.sh"
9 11
 os::log::install_errexit
10 12
 trap os::test::junit::reconcile_output EXIT
11 13
 
... ...
@@ -8,9 +8,14 @@ set -o nounset
8 8
 set -o pipefail
9 9
 
10 10
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
11
-source "${OS_ROOT}/hack/lib/init.sh"
11
+source "${OS_ROOT}/hack/util.sh"
12
+source "${OS_ROOT}/hack/cmd_util.sh"
12 13
 os::log::install_errexit
14
+
15
+source "${OS_ROOT}/hack/lib/util/environment.sh"
13 16
 os::util::environment::setup_time_vars
17
+
18
+source "${OS_ROOT}/hack/lib/test/junit.sh"
14 19
 trap os::test::junit::reconcile_output EXIT
15 20
 
16 21
 TEST_ASSETS="${TEST_ASSETS:-false}"
... ...
@@ -7,7 +7,8 @@ set -o nounset
7 7
 set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
10
-source "${OS_ROOT}/hack/lib/init.sh"
10
+source "${OS_ROOT}/hack/util.sh"
11
+source "${OS_ROOT}/hack/common.sh"
11 12
 cd "${OS_ROOT}"
12 13
 
13 14
 test_scripts=`find test/extended -maxdepth 1 -name "*.sh" -not  \( -name "all.sh" \)`
... ...
@@ -8,7 +8,10 @@ set -o pipefail
8 8
 
9 9
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
10 10
 cd "${OS_ROOT}"
11
-source "${OS_ROOT}/hack/lib/init.sh"
11
+source "${OS_ROOT}/hack/util.sh"
12
+source "${OS_ROOT}/hack/lib/log.sh"
13
+source "${OS_ROOT}/hack/lib/util/environment.sh"
14
+source "${OS_ROOT}/hack/cmd_util.sh"
12 15
 os::log::install_errexit
13 16
 
14 17
 os::util::environment::setup_all_server_vars "test-extended-alternate-certs/"
... ...
@@ -10,7 +10,10 @@ set -o pipefail
10 10
 
11 11
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
12 12
 cd "${OS_ROOT}"
13
-source "${OS_ROOT}/hack/lib/init.sh"
13
+source "${OS_ROOT}/hack/util.sh"
14
+source "${OS_ROOT}/hack/lib/log.sh"
15
+source "${OS_ROOT}/hack/lib/util/environment.sh"
16
+source "${OS_ROOT}/hack/cmd_util.sh"
14 17
 os::log::install_errexit
15 18
 
16 19
 os::util::environment::setup_all_server_vars "test-extended-alternate-launches/"
... ...
@@ -10,8 +10,14 @@ set -o nounset
10 10
 set -o pipefail
11 11
 
12 12
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
13
-source "${OS_ROOT}/hack/lib/init.sh"
13
+source "${OS_ROOT}/hack/util.sh"
14
+source "${OS_ROOT}/hack/cmd_util.sh"
15
+source "${OS_ROOT}/hack/common.sh"
16
+source "${OS_ROOT}/hack/lib/log.sh"
17
+source "${OS_ROOT}/hack/cmd_util.sh"
14 18
 os::log::install_errexit
19
+
20
+source "${OS_ROOT}/hack/lib/util/environment.sh"
15 21
 os::util::environment::setup_time_vars
16 22
 
17 23
 cd "${OS_ROOT}"
... ...
@@ -9,8 +9,12 @@ set -o nounset
9 9
 set -o pipefail
10 10
 
11 11
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
12
-source "${OS_ROOT}/hack/lib/init.sh"
12
+source "${OS_ROOT}/hack/util.sh"
13
+source "${OS_ROOT}/hack/common.sh"
14
+source "${OS_ROOT}/hack/lib/log.sh"
13 15
 os::log::install_errexit
16
+
17
+source "${OS_ROOT}/hack/lib/util/environment.sh"
14 18
 os::util::environment::setup_time_vars
15 19
 
16 20
 cd "${OS_ROOT}"
... ...
@@ -16,7 +16,10 @@ fi
16 16
 export SHELLOPTS
17 17
 
18 18
 OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
19
-source "${OS_ROOT}/hack/lib/init.sh"
19
+source "${OS_ROOT}/hack/util.sh"
20
+source "${OS_ROOT}/hack/common.sh"
21
+source "${OS_ROOT}/hack/lib/log.sh"
22
+source "${OS_ROOT}/hack/lib/util/environment.sh"
20 23
 os::log::install_errexit
21 24
 
22 25
 NETWORKING_DEBUG=${NETWORKING_DEBUG:-false}
... ...
@@ -1,4 +1,4 @@
1
-  #!/bin/bash
1
+#!/bin/bash
2 2
 #
3 3
 # This abstracts starting up an extended server.
4 4
 
... ...
@@ -21,7 +21,9 @@ function os::test::extended::focus {
21 21
 #   and then tests are executed.  Tests that depend on fine grained setup should
22 22
 #   be done in other contexts.
23 23
 function os::test::extended::setup {
24
-  source "${OS_ROOT}/hack/lib/init.sh"
24
+  source "${OS_ROOT}/hack/util.sh"
25
+  source "${OS_ROOT}/hack/common.sh"
26
+  source "${OS_ROOT}/hack/lib/log.sh"
25 27
   os::log::install_errexit
26 28
 
27 29
   # build binaries