14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
- KUBE_ROOT=$( dirname " ${BASH_SOURCE} " ) /../..
17
+ KUBE_ROOT=$( dirname " ${BASH_SOURCE[0] } " ) /../..
18
18
source " ${KUBE_ROOT} /hack/lib/init.sh"
19
19
20
20
focus=${FOCUS:- " " }
@@ -26,7 +26,7 @@ skip=${SKIP-"\[Flaky\]|\[Slow\]|\[Serial\]"}
26
26
# Currently, parallelism only affects when REMOTE=true. For local test,
27
27
# ginkgo default parallelism (cores - 1) is used.
28
28
parallelism=${PARALLELISM:- 8}
29
- artifacts=${ARTIFACTS:- " /tmp/_artifacts/` date +%y%m%dT%H%M%S` " }
29
+ artifacts=" ${ARTIFACTS:- " /tmp/_artifacts/$( date +%y%m%dT%H%M%S) " } "
30
30
remote=${REMOTE:- " false" }
31
31
runtime=${RUNTIME:- " docker" }
32
32
container_runtime_endpoint=${CONTAINER_RUNTIME_ENDPOINT:- " " }
@@ -38,7 +38,7 @@ extra_envs=${EXTRA_ENVS:-}
38
38
39
39
# Parse the flags to pass to ginkgo
40
40
ginkgoflags=" "
41
- if [[ ${parallelism} > 1 ]]; then
41
+ if [[ ${parallelism} -gt 1 ]]; then
42
42
ginkgoflags=" ${ginkgoflags} -nodes=${parallelism} "
43
43
fi
44
44
57
57
# Setup the directory to copy test artifacts (logs, junit.xml, etc) from remote host to local host
58
58
if [ ! -d " ${artifacts} " ]; then
59
59
echo " Creating artifacts directory at ${artifacts} "
60
- mkdir -p ${artifacts}
60
+ mkdir -p " ${artifacts} "
61
61
fi
62
62
echo " Test artifacts will be written to ${artifacts} "
63
63
64
64
if [[ ${runtime} == " remote" ]] ; then
65
- if [[ ! -z ${container_runtime_endpoint} ]] ; then
65
+ if [[ -n ${container_runtime_endpoint} ]] ; then
66
66
test_args=" --container-runtime-endpoint=${container_runtime_endpoint} ${test_args} "
67
67
fi
68
- if [[ ! -z ${image_service_endpoint} ]] ; then
68
+ if [[ -n ${image_service_endpoint} ]] ; then
69
69
test_args=" --image-service-endpoint=${image_service_endpoint} ${test_args} "
70
70
fi
71
71
fi
72
72
73
73
74
- if [ ${remote} = true ] ; then
74
+ if [ " ${remote} " = true ] ; then
75
75
# The following options are only valid in remote run.
76
76
images=${IMAGES:- " " }
77
77
hosts=${HOSTS:- " " }
@@ -85,8 +85,8 @@ if [ ${remote} = true ] ; then
85
85
gubernator=${GUBERNATOR:- " false" }
86
86
image_config_file=${IMAGE_CONFIG_FILE:- " " }
87
87
if [[ ${hosts} == " " && ${images} == " " && ${image_config_file} == " " ]]; then
88
- image_project=${IMAGE_PROJECT:- " cos-cloud" }
89
- gci_image=$( gcloud compute images list --project ${image_project} \
88
+ image_project=" ${IMAGE_PROJECT:- " cos-cloud" } "
89
+ gci_image=$( gcloud compute images list --project " ${image_project} " \
90
90
--no-standard-images --filter=" name ~ 'cos-beta.*'" --format=" table[no-heading](name)" )
91
91
images=${gci_image}
92
92
metadata=" user-data<${KUBE_ROOT} /test/e2e_node/jenkins/gci-init.yaml,gci-update-strategy=update_disabled"
@@ -116,7 +116,7 @@ if [ ${remote} = true ] ; then
116
116
IFS=' ,' read -ra IM <<< " ${images}"
117
117
images=" "
118
118
for i in " ${IM[@]} " ; do
119
- if [[ $( gcloud compute instances list " ${instance_prefix} -${i} " | grep ${i} ) ]] ; then
119
+ if gcloud compute instances list " ${instance_prefix} -${i} " | grep " ${i} " ; then
120
120
if [[ " ${hosts} " != " " ]]; then
121
121
hosts=" ${hosts} ,"
122
122
fi
0 commit comments