diff --git a/.travis/apisix_cli_test/test_ci_only.sh b/.travis/apisix_cli_test/test_ci_only.sh index 6b064a04..521c2e9d 100755 --- a/.travis/apisix_cli_test/test_ci_only.sh +++ b/.travis/apisix_cli_test/test_ci_only.sh @@ -39,3 +39,24 @@ if ! echo "$out" | grep 'etcd cluster version 3.3.0 is less than the required ve fi echo "passed: properly handle the error when connecting to old etcd" + +# It is forbidden to run apisix under the "/root" directory. +git checkout conf/config.yaml + +mkdir /root/apisix + +cp -r ./* /root/apisix +cd /root/apisix +make init + +out=$(make run 2>&1 || true) +if ! echo "$out" | grep "Error: It is forbidden to run APISIX in the /root directory"; then + echo "failed: should echo It is forbidden to run APISIX in the /root directory" + exit 1 +fi + +cd - + +echo "passed: successfully prohibit APISIX from running in the /root directory" + +rm -rf /root/apisix diff --git a/.travis/apisix_cli_test/test_main.sh b/.travis/apisix_cli_test/test_main.sh index 2c3f3c2e..b32b0b30 100755 --- a/.travis/apisix_cli_test/test_main.sh +++ b/.travis/apisix_cli_test/test_main.sh @@ -863,27 +863,6 @@ fi echo "pass: uninitialized variable not found during writing access log (port_admin set)" -# It is forbidden to run apisix under the "/root" directory. -git checkout conf/config.yaml - -mkdir /root/apisix - -cp -r ./* /root/apisix -cd /root/apisix -make init - -out=$(make run 2>&1 || true) -if ! echo "$out" | grep "Error: It is forbidden to run APISIX in the /root directory"; then - echo "failed: should echo It is forbidden to run APISIX in the /root directory" - exit 1 -fi - -cd - - -echo "passed: successfully prohibit APISIX from running in the /root directory" - -rm -rf /root/apisix - # check etcd while enable auth git checkout conf/config.yaml