From 275eaa412ec6cf300de3a1e6faa6f0b0c3affc67 Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 00:52:35 +0530 Subject: [PATCH 01/11] Add etcd auth support --- conf/config.yaml | 3 ++- t/APISIX.pm | 9 +++++++ t/core/etcd-auth-fail.t | 56 ++++++++++++++++++++++++++++++++++++++ t/core/etcd.t | 59 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 t/core/etcd-auth-fail.t create mode 100644 t/core/etcd.t diff --git a/conf/config.yaml b/conf/config.yaml index 7cd178da47f4..fe7716d87afd 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -122,7 +122,8 @@ etcd: - "http://127.0.0.1:2379" # multiple etcd address prefix: "/apisix" # apisix configurations prefix timeout: 3 # 3 seconds - + # user: root # root username for etcd + # password: 5tHkHhYkjr6cQY # root password for etcd #eureka: # host: # it's possible to define multiple eureka hosts addresses of the same eureka cluster. # - "http://127.0.0.1:8761" diff --git a/t/APISIX.pm b/t/APISIX.pm index a973143c32d4..0b93fb28064f 100644 --- a/t/APISIX.pm +++ b/t/APISIX.pm @@ -79,6 +79,14 @@ $yaml_config =~ s/enable_heartbeat: true/enable_heartbeat: false/; $yaml_config =~ s/ # stream_proxy:/ stream_proxy:\n tcp:\n - 9100/; $yaml_config =~ s/admin_key:/disable_admin_key:/; +my $etcd_enable_auth = $ENV{"ETCD_ENABLE_AUTH"} || "false"; + +if ($etcd_enable_auth eq "true") { + $yaml_config =~ s/ # user:/ user:/; + $yaml_config =~ s/ # password:/ password:/; +} + + my $profile = $ENV{"APISIX_PROFILE"}; @@ -102,6 +110,7 @@ add_block_preprocessor(sub { my $main_config = $block->main_config // <<_EOC_; worker_rlimit_core 500M; +env ENABLE_ETCD_AUTH; env APISIX_PROFILE; _EOC_ diff --git a/t/core/etcd-auth-fail.t b/t/core/etcd-auth-fail.t new file mode 100644 index 000000000000..53d6187bb443 --- /dev/null +++ b/t/core/etcd-auth-fail.t @@ -0,0 +1,56 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +BEGIN { + $ENV{"ETCD_ENABLE_AUTH"} = "false" +} + +use t::APISIX 'no_plan'; + +repeat_each(1); +no_long_string(); +no_root_location(); +log_level("info"); + +# Authentication is enabled at etcd and credentials are set +system("etcdctl -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY"); +system("etcdctl -u root:5tHkHhYkjr6cQY auth enable"); +system('etcdctl -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); + +run_tests; + +# Authentication is disabled at etcd & guest access is granted +system("etcdctl -u root:5tHkHhYkjr6cQY auth disable"); +system('etcdctl -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); + + +__DATA__ + +=== TEST 1: Set and Get a value pass +--- config + location /t { + content_by_lua_block { + local core = require("apisix.core") + local key = "/test_key" + local val = "test_value" + local res, err = core.etcd.set(key, val) + ngx.say(err) + } + } +--- request +GET /t +--- response_body +insufficient credentials code: 401 diff --git a/t/core/etcd.t b/t/core/etcd.t new file mode 100644 index 000000000000..defca6001625 --- /dev/null +++ b/t/core/etcd.t @@ -0,0 +1,59 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +BEGIN { + $ENV{"ETCD_ENABLE_AUTH"} = "true" +} + +use t::APISIX 'no_plan'; + +repeat_each(1); +no_long_string(); +no_root_location(); +log_level("info"); + +# Authentication is enabled at etcd and credentials are set +system("etcdctl -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY"); +system("etcdctl -u root:5tHkHhYkjr6cQY auth enable"); +system('etcdctl -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); + +run_tests; + +# Authentication is disabled at etcd & guest access is granted +system("etcdctl -u root:5tHkHhYkjr6cQY auth disable"); +system('etcdctl -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); + +__DATA__ + +=== TEST 1: Set and Get a value pass with authentication +--- config + location /t { + content_by_lua_block { + local core = require("apisix.core") + local key = "/test_key" + local val = "test_value" + core.etcd.set(key, val) + local res, err = core.etcd.get(key) + ngx.say(res.body.node.value) + core.etcd.delete(val) + } + } +--- request +GET /t +--- response_body +test_value +--- no_error_log +[error] From 73325428cb147cb2fa13b1d1b93689b7807c325c Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 08:02:57 +0530 Subject: [PATCH 02/11] [BUILD] From ad3ffb3974774cfeffcda1f4b62b9ce0d4cf2142 Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 09:03:44 +0530 Subject: [PATCH 03/11] Added etcd endpoints --- t/core/etcd-auth-fail.t | 10 +++++----- t/core/etcd.t | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/t/core/etcd-auth-fail.t b/t/core/etcd-auth-fail.t index 53d6187bb443..7a8daabeb2de 100644 --- a/t/core/etcd-auth-fail.t +++ b/t/core/etcd-auth-fail.t @@ -26,15 +26,15 @@ no_root_location(); log_level("info"); # Authentication is enabled at etcd and credentials are set -system("etcdctl -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY"); -system("etcdctl -u root:5tHkHhYkjr6cQY auth enable"); -system('etcdctl -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY auth enable'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); run_tests; # Authentication is disabled at etcd & guest access is granted -system("etcdctl -u root:5tHkHhYkjr6cQY auth disable"); -system('etcdctl -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY auth disable'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); __DATA__ diff --git a/t/core/etcd.t b/t/core/etcd.t index defca6001625..62dea77e57f7 100644 --- a/t/core/etcd.t +++ b/t/core/etcd.t @@ -26,15 +26,15 @@ no_root_location(); log_level("info"); # Authentication is enabled at etcd and credentials are set -system("etcdctl -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY"); -system("etcdctl -u root:5tHkHhYkjr6cQY auth enable"); -system('etcdctl -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY auth enable'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); run_tests; # Authentication is disabled at etcd & guest access is granted -system("etcdctl -u root:5tHkHhYkjr6cQY auth disable"); -system('etcdctl -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY auth disable'); +system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); __DATA__ From 25931348e645fd9cd00666f0f6823a81dd3f0ddf Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 10:33:50 +0530 Subject: [PATCH 04/11] Updated travis xenial->bionic --- .travis.yml | 2 +- .travis/linux_openresty_runner.sh | 1 + .travis/linux_tengine_runner.sh | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d33d27cc2bce..ddc6b898c1b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: xenial +dist: bionic sudo: required matrix: diff --git a/.travis/linux_openresty_runner.sh b/.travis/linux_openresty_runner.sh index d56998342cda..fc1e50dc7a77 100755 --- a/.travis/linux_openresty_runner.sh +++ b/.travis/linux_openresty_runner.sh @@ -129,6 +129,7 @@ script() { export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH openresty -V sudo service etcd start + etcd --version ./build-cache/grpc_server_example & diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh index 472e86fed1ab..1b36bef039f5 100755 --- a/.travis/linux_tengine_runner.sh +++ b/.travis/linux_tengine_runner.sh @@ -272,6 +272,7 @@ script() { export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH openresty -V sudo service etcd start + etcd --version ./build-cache/grpc_server_example & From 3f99d7680e7be2a2009361445f672975e89c4855 Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 10:38:38 +0530 Subject: [PATCH 05/11] Fixed port number --- t/core/etcd-auth-fail.t | 10 +++++----- t/core/etcd.t | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/t/core/etcd-auth-fail.t b/t/core/etcd-auth-fail.t index 7a8daabeb2de..dfeaffee178f 100644 --- a/t/core/etcd-auth-fail.t +++ b/t/core/etcd-auth-fail.t @@ -26,15 +26,15 @@ no_root_location(); log_level("info"); # Authentication is enabled at etcd and credentials are set -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY'); -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY auth enable'); -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY auth enable'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); run_tests; # Authentication is disabled at etcd & guest access is granted -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY auth disable'); -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY auth disable'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); __DATA__ diff --git a/t/core/etcd.t b/t/core/etcd.t index 62dea77e57f7..3051a68ffbde 100644 --- a/t/core/etcd.t +++ b/t/core/etcd.t @@ -26,15 +26,15 @@ no_root_location(); log_level("info"); # Authentication is enabled at etcd and credentials are set -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY'); -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY auth enable'); -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY user add root:5tHkHhYkjr6cQY'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY auth enable'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY role revoke --path "/*" -rw guest'); run_tests; # Authentication is disabled at etcd & guest access is granted -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY auth disable'); -system('etcdctl --endpoints="http://127.0.0.1:2376" -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY auth disable'); +system('etcdctl --endpoints="http://127.0.0.1:2379" -u root:5tHkHhYkjr6cQY role grant --path "/*" -rw guest'); __DATA__ From 82dde2ea4ef3ef741f64aa24b9e7b4b309253408 Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 11:41:16 +0530 Subject: [PATCH 06/11] Wait for etcd to start --- .travis/linux_apisix_current_luarocks_runner.sh | 2 ++ .travis/linux_apisix_master_luarocks_runner.sh | 3 +++ .travis/linux_openresty_runner.sh | 2 ++ .travis/linux_tengine_runner.sh | 2 ++ 4 files changed, 9 insertions(+) diff --git a/.travis/linux_apisix_current_luarocks_runner.sh b/.travis/linux_apisix_current_luarocks_runner.sh index b67e115fa7f5..b82f49bef270 100755 --- a/.travis/linux_apisix_current_luarocks_runner.sh +++ b/.travis/linux_apisix_current_luarocks_runner.sh @@ -47,6 +47,8 @@ script() { export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH openresty -V sudo service etcd start + etcd --version + sleep 20 sudo rm -rf /usr/local/apisix diff --git a/.travis/linux_apisix_master_luarocks_runner.sh b/.travis/linux_apisix_master_luarocks_runner.sh index e65bdbd10327..597fa4a68b5e 100755 --- a/.travis/linux_apisix_master_luarocks_runner.sh +++ b/.travis/linux_apisix_master_luarocks_runner.sh @@ -48,6 +48,9 @@ script() { export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH openresty -V sudo service etcd start + etcd --version + sleep 20 + sudo service etcd status sudo rm -rf /usr/local/apisix diff --git a/.travis/linux_openresty_runner.sh b/.travis/linux_openresty_runner.sh index fc1e50dc7a77..6f52b36003bc 100755 --- a/.travis/linux_openresty_runner.sh +++ b/.travis/linux_openresty_runner.sh @@ -130,6 +130,8 @@ script() { openresty -V sudo service etcd start etcd --version + sleep 20 + sudo service etcd status ./build-cache/grpc_server_example & diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh index 1b36bef039f5..d03f6f9fa31d 100755 --- a/.travis/linux_tengine_runner.sh +++ b/.travis/linux_tengine_runner.sh @@ -273,6 +273,8 @@ script() { openresty -V sudo service etcd start etcd --version + sleep 20 + sudo service etcd status ./build-cache/grpc_server_example & From 3bebb61cb2eedcbb9d2f3c7c9ab1db22ec6de508 Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 12:39:40 +0530 Subject: [PATCH 07/11] Switch dist --- .travis.yml | 4 +++- .travis/linux_openresty_runner.sh | 3 ++- .travis/linux_tengine_runner.sh | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ddc6b898c1b0..8cd5191e9577 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ -dist: bionic +dist: xenial sudo: required matrix: include: - os: linux + dist: bionic services: - docker env: OSNAME=linux_openresty @@ -14,6 +15,7 @@ matrix: - $HOME/Library/Caches/Homebrew - /usr/local/Homebrew - os: linux + dist: bionic services: - docker env: OSNAME=linux_tengine diff --git a/.travis/linux_openresty_runner.sh b/.travis/linux_openresty_runner.sh index 6f52b36003bc..fa4a18de1708 100755 --- a/.travis/linux_openresty_runner.sh +++ b/.travis/linux_openresty_runner.sh @@ -131,7 +131,8 @@ script() { sudo service etcd start etcd --version sleep 20 - sudo service etcd status + sudo lsof -i -P | grep LISTEN | grep etcd + curl http://127.0.0.1:2379/version ./build-cache/grpc_server_example & diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh index d03f6f9fa31d..97082d88a2a7 100755 --- a/.travis/linux_tengine_runner.sh +++ b/.travis/linux_tengine_runner.sh @@ -274,7 +274,8 @@ script() { sudo service etcd start etcd --version sleep 20 - sudo service etcd status + sudo lsof -i -P | grep LISTEN | grep etcd + curl http://127.0.0.1:2379/version ./build-cache/grpc_server_example & From 21f1223276d9c57b193576e0458a297c53ed545f Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 13:08:48 +0530 Subject: [PATCH 08/11] Start etcd manually --- .travis/linux_openresty_runner.sh | 8 ++++---- .travis/linux_tengine_runner.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis/linux_openresty_runner.sh b/.travis/linux_openresty_runner.sh index fa4a18de1708..9c0c21b95863 100755 --- a/.travis/linux_openresty_runner.sh +++ b/.travis/linux_openresty_runner.sh @@ -128,11 +128,11 @@ script() { export_or_prefix export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH openresty -V - sudo service etcd start + sudo service etcd stop + mkdir -p ~/etcd-data + /usr/bin/etcd --listen-client-urls 'http://0.0.0.0:2379' --advertise-client-urls='http://0.0.0.0:2379' --data-dir ~/etcd-data > /dev/null 2>&1 & etcd --version - sleep 20 - sudo lsof -i -P | grep LISTEN | grep etcd - curl http://127.0.0.1:2379/version + sleep 5 ./build-cache/grpc_server_example & diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh index 97082d88a2a7..2efc7a1ca73d 100755 --- a/.travis/linux_tengine_runner.sh +++ b/.travis/linux_tengine_runner.sh @@ -271,11 +271,11 @@ script() { export_or_prefix export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH openresty -V - sudo service etcd start + sudo service etcd stop + mkdir -p ~/etcd-data + /usr/bin/etcd --listen-client-urls 'http://0.0.0.0:2379' --advertise-client-urls='http://0.0.0.0:2379' --data-dir ~/etcd-data > /dev/null 2>&1 & etcd --version - sleep 20 - sudo lsof -i -P | grep LISTEN | grep etcd - curl http://127.0.0.1:2379/version + sleep 5 ./build-cache/grpc_server_example & From 54858035314abbf4c3b944912665b24b363f8ee9 Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 14:12:40 +0530 Subject: [PATCH 09/11] Fix perl path for Bionic --- .travis/linux_openresty_runner.sh | 2 +- .travis/linux_tengine_runner.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/linux_openresty_runner.sh b/.travis/linux_openresty_runner.sh index 9c0c21b95863..86505cfce3c6 100755 --- a/.travis/linux_openresty_runner.sh +++ b/.travis/linux_openresty_runner.sh @@ -151,7 +151,7 @@ script() { sleep 1 make lint && make license-check || exit 1 - APISIX_ENABLE_LUACOV=1 prove -Itest-nginx/lib -r t + APISIX_ENABLE_LUACOV=1 PERL5LIB=.:$PERL5LIB prove -Itest-nginx/lib -r t } after_success() { diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh index 2efc7a1ca73d..fb9b6fd65724 100755 --- a/.travis/linux_tengine_runner.sh +++ b/.travis/linux_tengine_runner.sh @@ -288,7 +288,7 @@ script() { ./bin/apisix stop sleep 1 make lint && make license-check || exit 1 - APISIX_ENABLE_LUACOV=1 prove -Itest-nginx/lib -r t + APISIX_ENABLE_LUACOV=1 PERL5LIB=.:$PERL5LIB prove -Itest-nginx/lib -r t } after_success() { From ae258eaaab4896acf12e7e38d4ebf8b436a830f1 Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Thu, 25 Jun 2020 14:46:29 +0530 Subject: [PATCH 10/11] Make Bionic default OS --- .travis.yml | 4 +--- .travis/linux_apisix_current_luarocks_runner.sh | 5 ++++- .travis/linux_apisix_master_luarocks_runner.sh | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8cd5191e9577..ddc6b898c1b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ -dist: xenial +dist: bionic sudo: required matrix: include: - os: linux - dist: bionic services: - docker env: OSNAME=linux_openresty @@ -15,7 +14,6 @@ matrix: - $HOME/Library/Caches/Homebrew - /usr/local/Homebrew - os: linux - dist: bionic services: - docker env: OSNAME=linux_tengine diff --git a/.travis/linux_apisix_current_luarocks_runner.sh b/.travis/linux_apisix_current_luarocks_runner.sh index b82f49bef270..0264fc5ba826 100755 --- a/.travis/linux_apisix_current_luarocks_runner.sh +++ b/.travis/linux_apisix_current_luarocks_runner.sh @@ -47,8 +47,11 @@ script() { export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH openresty -V sudo service etcd start + sudo service etcd stop + mkdir -p ~/etcd-data + /usr/bin/etcd --listen-client-urls 'http://0.0.0.0:2379' --advertise-client-urls='http://0.0.0.0:2379' --data-dir ~/etcd-data > /dev/null 2>&1 & etcd --version - sleep 20 + sleep 5 sudo rm -rf /usr/local/apisix diff --git a/.travis/linux_apisix_master_luarocks_runner.sh b/.travis/linux_apisix_master_luarocks_runner.sh index 597fa4a68b5e..7705c97559ea 100755 --- a/.travis/linux_apisix_master_luarocks_runner.sh +++ b/.travis/linux_apisix_master_luarocks_runner.sh @@ -47,10 +47,11 @@ script() { export_or_prefix export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH openresty -V - sudo service etcd start + sudo service etcd stop + mkdir -p ~/etcd-data + /usr/bin/etcd --listen-client-urls 'http://0.0.0.0:2379' --advertise-client-urls='http://0.0.0.0:2379' --data-dir ~/etcd-data > /dev/null 2>&1 & etcd --version - sleep 20 - sudo service etcd status + sleep 5 sudo rm -rf /usr/local/apisix From 11d16428ae3512dff4f0dec875048a957c65afff Mon Sep 17 00:00:00 2001 From: Shenal Silva Date: Fri, 26 Jun 2020 06:59:15 +0530 Subject: [PATCH 11/11] Rename test case --- t/core/{etcd.t => etcd-auth.t} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename t/core/{etcd.t => etcd-auth.t} (100%) diff --git a/t/core/etcd.t b/t/core/etcd-auth.t similarity index 100% rename from t/core/etcd.t rename to t/core/etcd-auth.t