Index: third_party/grpc/tools/dockerfile/grpc_interop_php/build_interop.sh |
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py b/third_party/grpc/tools/dockerfile/grpc_interop_php/build_interop.sh |
old mode 100644 |
new mode 100755 |
similarity index 69% |
copy from third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py |
copy to third_party/grpc/tools/dockerfile/grpc_interop_php/build_interop.sh |
index 1b02d66267e294ce83977dac64f075981705647c..2bffbd89384d94d080d13f7b414da15deba4e898 |
--- a/third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py |
+++ b/third_party/grpc/tools/dockerfile/grpc_interop_php/build_interop.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 |
@@ -26,28 +27,28 @@ |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+# |
+# Builds PHP interop server and client in a base image. |
+set -ex |
+ |
+mkdir -p /var/local/git |
+git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc |
+# copy service account keys if available |
+cp -r /var/local/jenkins/service_account $HOME || true |
-import logging |
-_GOODBYE_MESSAGE = u'Goodbye' |
+cd /var/local/git/grpc |
+rvm --default use ruby-2.1 |
+make install-certs |
-def web_socket_do_extra_handshake(request): |
- pass # Always accept. |
+# gRPC core and protobuf need to be installed |
+make install |
+(cd src/php/ext/grpc && phpize && ./configure && make) |
-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) |
+(cd third_party/protobuf && make install) |
+(cd src/php && composer install) |
-def web_socket_passive_closing_handshake(request): |
- return request.ws_close_code, request.ws_close_reason |
+(cd src/php && protoc-gen-php -i tests/interop/ -o tests/interop/ tests/interop/test.proto) |