소스 검색

Travis: Activate IPv6 only for Linux

bel2125 7 년 전
부모
커밋
db2e34b4fb
1개의 변경된 파일6개의 추가작업 그리고 8개의 파일을 삭제
  1. 6 8
      .travis.yml

+ 6 - 8
.travis.yml

@@ -51,6 +51,12 @@ install:
     fi
     fi
 
 
 before_script:
 before_script:
+  # Add an IPv6 config - see the corresponding Travis issue
+  # https://github.com/travis-ci/travis-ci/issues/8361
+  - if [ "${ENABLE_IPV6}" == "YES" -a "${TRAVIS_OS_NAME}" == "linux" ]; then 
+      echo "Activating IPv6 on Travis";
+      sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
+    fi
   # Check some settings of the build server (operating system, IPv6 availability, directory)
   # Check some settings of the build server (operating system, IPv6 availability, directory)
   - uname -a
   - uname -a
   - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
   - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
@@ -58,14 +64,6 @@ before_script:
       cat /etc/network/interfaces;
       cat /etc/network/interfaces;
     fi
     fi
   - ifconfig
   - ifconfig
-  # Add an IPv6 config and restart network
-  # https://askubuntu.com/questions/103171/editing-network-interfaces-without-system-rebooting
-  # For some failed tests already done, see
-  # https://github.com/travis-ci/travis-ci/issues/8361#issuecomment-345074513
-  - if [[ "${ENABLE_IPV6}" == "YES" ]]; then 
-      echo "IPv6 on Travis may fail";
-      sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
-    fi
   - pwd
   - pwd
   - ls -la
   - ls -la
   - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
   - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then