.travis.yml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. language: python
  2. # The default python version on Travis is 2.7
  3. # But we add this line to show the python version in the Travis UI
  4. python: "2.7"
  5. os:
  6. - linux
  7. ## We also use macOS for some networks
  8. ## We don't use the build matrix cross-product, because it makes too many jobs
  9. ## Instead, we list each job under matrix: include:
  10. env:
  11. global:
  12. ## Turn off tor's sandbox in chutney, until we fix sandbox errors that are
  13. ## triggered by Ubuntu Xenial and Bionic. See #32722.
  14. - CHUTNEY_TOR_SANDBOX="0"
  15. matrix:
  16. ## This matrix entry is required, but it doesn't actually create any jobs
  17. ## by itself. All jobs are created by matrix: include: entries
  18. ##
  19. ## The TOR env var should be kept in sync with the Linux tor version in
  20. ## the addons section below
  21. ## We use the basic-min network by default, to reduce load and increase
  22. ## reliability
  23. - TOR="master-nightly" NETWORK_FLAVOUR="basic-min"
  24. matrix:
  25. # include creates Linux, python 2.7, tor master builds by default
  26. # we use tor master to catch tor issues before stable releases
  27. # the key(s) in each item override these defaults
  28. include:
  29. ## Test different network flavours
  30. ## We're using the networks from tor master's "make test-network-all"
  31. ##
  32. ## We need to use macOS to test IPv6 networks, because Travis Linux doesn't
  33. ## support IPv6. But macOS is tricky:
  34. ## - We use the default python version on macOS, which is currently 2.7.
  35. ## (But we don't show the version, because Travis might change it
  36. ## without us noticing.)
  37. ## - We use language: c, because language: python fails on Travis macOS.
  38. ## - We get the tor version in the homebrew cache on the macOS image.
  39. ## The latest tor version in homebrew is on this page:
  40. ## https://formulae.brew.sh/formula/tor
  41. ## The Travis version might be slightly older.
  42. - env: TOR="master-nightly" NETWORK_FLAVOUR="bridges-min"
  43. - env: TOR="master-nightly" NETWORK_FLAVOUR="hs-v2-min"
  44. - env: TOR="master-nightly" NETWORK_FLAVOUR="hs-v3-min"
  45. - env: TOR="master-nightly" NETWORK_FLAVOUR="single-onion-v23"
  46. - env: TOR="stable-release" NETWORK_FLAVOUR="bridges+ipv6-min"
  47. os: osx
  48. language: c
  49. python:
  50. ## The IPv6 exit test doesn't actually require IPv6, see #30182.
  51. ## But we'll keep this test, because it does test IPv6 exit config.
  52. - env: TOR="master-nightly" NETWORK_FLAVOUR="ipv6-exit-min"
  53. - env: TOR="stable-release" NETWORK_FLAVOUR="hs-v23-ipv6-md"
  54. os: osx
  55. language: c
  56. python:
  57. ## v3 onion service IPv6 tests
  58. - env: TOR="stable-release" NETWORK_FLAVOUR="single-onion-v23-ipv6-md"
  59. os: osx
  60. language: c
  61. python:
  62. ## Test all supported and available tor versions on Linux
  63. ## If the deb.torproject.org repositories are removed, we will fall back to
  64. ## Ubuntu security's tor version (currently 0.2.9.14). We might want to
  65. ## automatically fail the job if we can't get a newer tor, see #29741.
  66. ##
  67. ## The current tor versions in Ubuntu are on this page:
  68. ## https://packages.ubuntu.com/search?keywords=tor&searchon=names&exact=1
  69. ##
  70. ## We run 0.2.9 on Xenial, because Bionic has an OpenSSL version mismatch
  71. - dist: xenial
  72. addons:
  73. apt:
  74. sources:
  75. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.2.9.x-xenial main'
  76. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  77. packages:
  78. - shellcheck
  79. - tor
  80. env: TOR="0.2.9-nightly" NETWORK_FLAVOUR="basic-min"
  81. - addons:
  82. apt:
  83. sources:
  84. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.3.5.x-bionic main'
  85. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  86. packages:
  87. - shellcheck
  88. - tor
  89. env: TOR="0.3.5-nightly" NETWORK_FLAVOUR="basic-min"
  90. - addons:
  91. apt:
  92. sources:
  93. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.4.0.x-bionic main'
  94. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  95. packages:
  96. - shellcheck
  97. - tor
  98. env: TOR="0.4.0-nightly" NETWORK_FLAVOUR="basic-min"
  99. ## The current stable release is 0.4.1
  100. - addons:
  101. apt:
  102. sources:
  103. - sourceline: 'deb https://deb.torproject.org/torproject.org bionic main'
  104. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  105. packages:
  106. - shellcheck
  107. - tor
  108. env: TOR="stable-release" NETWORK_FLAVOUR="basic-min"
  109. ## We also have 0.4.1 and 0.4.2 nightlies
  110. - addons:
  111. apt:
  112. sources:
  113. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.4.1.x-bionic main'
  114. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  115. packages:
  116. - shellcheck
  117. - tor
  118. env: TOR="0.4.1-nightly" NETWORK_FLAVOUR="basic-min"
  119. - addons:
  120. apt:
  121. sources:
  122. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.4.2.x-bionic main'
  123. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  124. packages:
  125. - shellcheck
  126. - tor
  127. env: TOR="0.4.2-nightly" NETWORK_FLAVOUR="basic-min"
  128. ## Test all supported python releases
  129. ## Pre-installed in macOS
  130. - os: osx
  131. language: c
  132. python:
  133. ## python 3 is already installed, under this name
  134. env: PYTHON="python3" TOR="stable-release"
  135. ## Pre-installed in Travis Bionic:
  136. ## https://docs.travis-ci.com/user/reference/bionic/#python-support
  137. ## End of Life: 1 January 2020
  138. ## https://www.python.org/dev/peps/pep-0373/#update
  139. - python: "2.7"
  140. ## End of Life: December 2021
  141. ## https://www.python.org/dev/peps/pep-0494/#lifespan
  142. - python: "3.6"
  143. ## End of Life: June 2023
  144. ## https://www.python.org/dev/peps/pep-0537/#lifespan
  145. - python: "3.7"
  146. ## Extra Installs
  147. ## End of Life: October 2024
  148. ## https://www.python.org/dev/peps/pep-0569/#lifespan
  149. - python: "3.8"
  150. ## Python 3.9
  151. ## Travis Dev Package: ????
  152. ## (Add 3.9-dev)
  153. ## Stable: 10 October 2020
  154. ## (Switch from 3.9-dev to 3.9, and check for {3.10,4.0}-dev)
  155. ## End of Life: October 2025
  156. ## https://www.python.org/dev/peps/pep-0596/#lifespan
  157. #- python: "3.9-dev"
  158. - python: "nightly"
  159. ## PyPy versions
  160. ## PyPy isn't packaged for Travis Bionic yet
  161. ## Tor master doesn't work on Travis Xenial, because it only has
  162. ## OpenSSL 1.1.0
  163. ## Pypy 2
  164. ## End of Life: "forever"
  165. ## http://doc.pypy.org/en/latest/faq.html#how-long-will-pypy-support-python2
  166. ## But chutney can decide not to support python 2 after 1 Jan 2020.
  167. - python: "pypy"
  168. dist: xenial
  169. addons:
  170. apt:
  171. sources:
  172. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.4.2.x-xenial main'
  173. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  174. packages:
  175. - shellcheck
  176. - tor
  177. env: TOR="0.4.2-nightly" NETWORK_FLAVOUR="basic-min"
  178. ## PyPy does not have documented end of life dates
  179. - python: "pypy3"
  180. dist: xenial
  181. addons:
  182. apt:
  183. sources:
  184. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.4.2.x-xenial main'
  185. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  186. packages:
  187. - shellcheck
  188. - tor
  189. env: TOR="0.4.2-nightly" NETWORK_FLAVOUR="basic-min"
  190. ## Uncomment to allow the build to report success (with non-required
  191. ## sub-builds continuing to run) if all required sub-builds have
  192. ## succeeded. This is somewhat buggy currently: it can cause
  193. ## duplicate notifications and prematurely report success if a
  194. ## single sub-build has succeeded. See
  195. ## https://github.com/travis-ci/travis-ci/issues/1696
  196. #fast_finish: true
  197. ## These builds fail in Travis at the moment
  198. #allow_failures:
  199. # - env: TOR="master-nightly" NETWORK_FLAVOUR="basic-min"
  200. ## (Linux only) Use the Ubuntu Bionic Linux Image
  201. dist: bionic
  202. ## (macOS only) Use a recent macOS image
  203. ## See https://docs.travis-ci.com/user/reference/osx#os-x-version
  204. ## Default is Xcode 9.4 on macOS 10.13 as of October 2019
  205. ## Recent is Xcode 11.2 on macOS 10.14 as of October 2019
  206. osx_image: xcode11.2
  207. ## Download our dependencies
  208. addons:
  209. ## (Linux only)
  210. apt:
  211. sources:
  212. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-master-bionic main'
  213. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  214. packages:
  215. - shellcheck
  216. - tor
  217. ## (macOS only)
  218. homebrew:
  219. packages:
  220. - shellcheck
  221. - tor
  222. # See ticket #30928 for more information. This key should be removed at
  223. # some point to speed up builds.
  224. update: true
  225. before_install:
  226. ## Set pipefail: we may use pipes in future
  227. - set -o pipefail || echo "pipefail failed"
  228. install:
  229. ## Chutney has no dependencies, apart from tor
  230. ## List installed package versions
  231. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then dpkg-query --show; fi
  232. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list --versions; fi
  233. ## Use the default spelling for python, unless it is overridden
  234. - export PYTHON=${PYTHON:-python}
  235. - $PYTHON --version
  236. - if command -v shellcheck ; then shellcheck --version; fi
  237. - tor --version
  238. ## List the permissions on chutney and chutney/net
  239. - ls -al . net
  240. script:
  241. ## Basic tests
  242. - if command -v shellcheck ; then tests/shellcheck-tests.sh; fi
  243. - tests/unit-tests.sh
  244. ## Quick smoke test
  245. - tools/test-network.sh --dry-run
  246. ## Now, allow one failure for each test (--allow-failures 1)
  247. - export CHUTNEY_ALLOW_FAILURES=1
  248. ## Different data directory
  249. - tools/test-network.sh --net-dir "$(mktemp -d)"
  250. ## IP address handling
  251. - tools/test-network.sh --ipv4 "127.0.0.1" --ipv6 "[::1]"
  252. ## Offline mode
  253. - tools/test-network.sh --offline
  254. ## --data fails on python3, and on some tor versions
  255. ## We'll fix this issue in #30071
  256. #- FIVE_MEGABYTES=$((5*1024*1024))
  257. #- tools/test-network.sh --data "$FIVE_MEGABYTES" --connections 2 --rounds 2 --hs-multi-client 1 --start-time 130 --bootstrap-time 70 --stop-time 10
  258. after_failure:
  259. ## List the permissions on chutney and chutney/net
  260. - ls -al . net
  261. ## List the contents of net/nodes
  262. - ls -lR net/nodes/
  263. ## Dump the config
  264. - cat net/nodes/000a*/torrc
  265. ## Dump the important directory documents
  266. #- cat net/nodes/000a*/cached-certs
  267. - cat net/nodes/000a*/cached-consensus
  268. - cat net/nodes/000a*/cached-descriptors*
  269. #- cat net/nodes/000a*/cached-extrainfo*
  270. - cat net/nodes/000a*/cached-microdesc-consensus
  271. - cat net/nodes/000a*/cached-microdescs*
  272. #- cat net/nodes/000a*/key-pinning-journal
  273. #- cat net/nodes/000a*/router-stability
  274. #- cat net/nodes/00*a*/sr-state
  275. #- cat net/nodes/00*a*/state
  276. - for f in net/nodes/00*a*/v3-status-votes ; do echo "$f"; cat "$f"; done
  277. - for f in net/nodes/00*a*/unparseable-descs/* ; do echo "$f"; cat "$f"; done
  278. ## And repeat the warnings at the end
  279. - tools/test-network.sh --only-warnings
  280. notifications:
  281. irc:
  282. channels:
  283. - "irc.oftc.net#tor-ci"
  284. template:
  285. - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
  286. - "Build #%{build_number} %{result}. Details: %{build_url}"
  287. on_success: change
  288. on_failure: change
  289. email:
  290. on_success: never
  291. on_failure: change