| Index: third_party/grpc/tools/gce/create_linux_worker.sh
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py b/third_party/grpc/tools/gce/create_linux_worker.sh
|
| old mode 100644
|
| new mode 100755
|
| similarity index 66%
|
| copy from third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py
|
| copy to third_party/grpc/tools/gce/create_linux_worker.sh
|
| index 1b02d66267e294ce83977dac64f075981705647c..2a9e77ab1738d516b193860d84b503538213432d
|
| --- a/third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py
|
| +++ b/third_party/grpc/tools/gce/create_linux_worker.sh
|
| @@ -1,4 +1,5 @@
|
| -# Copyright 2011, Google Inc.
|
| +#!/bin/bash
|
| +# Copyright 2015-2016, Google Inc.
|
| # All rights reserved.
|
| #
|
| # Redistribution and use in source and binary forms, with or without
|
| @@ -27,27 +28,33 @@
|
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| +# Creates a standard jenkins worker on GCE.
|
|
|
| -import logging
|
| -_GOODBYE_MESSAGE = u'Goodbye'
|
| +set -ex
|
|
|
| +cd $(dirname $0)
|
|
|
| -def web_socket_do_extra_handshake(request):
|
| - pass # Always accept.
|
| +CLOUD_PROJECT=grpc-testing
|
| +ZONE=us-central1-a
|
|
|
| +INSTANCE_NAME=grpc-jenkins-worker1
|
|
|
| -def web_socket_transfer_data(request):
|
| - while True:
|
| - line = request.ws_stream.receive_message()
|
| - if line is None:
|
| - return
|
| - if isinstance(line, unicode):
|
| - request.ws_stream.send_message(line, binary=False)
|
| - if line == _GOODBYE_MESSAGE:
|
| - return
|
| - else:
|
| - request.ws_stream.send_message(line, binary=True)
|
| +gcloud compute instances create $INSTANCE_NAME \
|
| + --project="$CLOUD_PROJECT" \
|
| + --zone "$ZONE" \
|
| + --machine-type n1-standard-8 \
|
| + --image ubuntu-14-04 \
|
| + --boot-disk-size 1000
|
|
|
| +echo 'Created GCE instance, waiting 60 seconds for it to come online.'
|
| +sleep 60
|
|
|
| -def web_socket_passive_closing_handshake(request):
|
| - return request.ws_close_code, request.ws_close_reason
|
| +gcloud compute copy-files \
|
| + --project="$CLOUD_PROJECT" \
|
| + --zone "$ZONE" \
|
| + jenkins_master.pub linux_worker_init.sh ${INSTANCE_NAME}:~
|
| +
|
| +gcloud compute ssh \
|
| + --project="$CLOUD_PROJECT" \
|
| + --zone "$ZONE" \
|
| + $INSTANCE_NAME --command "./linux_worker_init.sh"
|
|
|