forked from ivre/ivre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
91 lines (82 loc) · 3.98 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
sudo: false
dist: trusty
env:
# PostgreSQL 10.1, 9.6.6, 9.5.10
- DB=postgres POSTGRES_VERSION=9.5.10
- DB=postgres POSTGRES_VERSION=9.6.6
- DB=postgres POSTGRES_VERSION=10.1
# MongoDB
## Previous releases
- DB=mongo MONGODB_VERSION=2.6.12
- DB=mongo MONGODB_VERSION=3.0.15
- DB=mongo MONGODB_VERSION=3.2.18
- DB=mongo MONGODB_VERSION=3.4.10
## Current stable
- DB=mongo MONGODB_VERSION=3.6.2
## Development release
- DB=mongo MONGODB_VERSION=3.7.1
language: python
python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
# PhantomJS is supposed to be installed
# (https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-PhantomJS),
# but we need tesseract
addons:
apt:
packages:
- tesseract-ocr
- tesseract-ocr-osd
- tesseract-ocr-eng
install:
- source ./.travis/install_${DB}.sh
- pip install $PIP_INSTALL_OPTIONS .
- PYVERS=`python -c 'import sys;print("%d%d" % sys.version_info[:2])'`; if [ -f "requirements-$DB-$PYVERS.txt" ]; then pip install $PIP_INSTALL_OPTIONS -r "requirements-$DB-$PYVERS.txt"; else pip install $PIP_INSTALL_OPTIONS -r "requirements-$DB.txt"; fi
- test "$TRAVIS_PYTHON_VERSION" = 2.6 && pip install unittest2 || true
- pip install $PIP_INSTALL_OPTIONS coverage codecov
# cleanup
- rm -rf ivre/
# We need MongoDB 2.6
# https://github.com/travis-ci/travis-ci/issues/2246
#services: mongodb
before_script:
# display version
- ivre version
# init DB
- ivre ipinfo --init < /dev/null
- ivre scancli --init < /dev/null
- ivre ipdata --init < /dev/null
- cat .travis/ivre.conf >> ~/.ivre.conf
- echo "NMAP_SHARE_PATH = '`pwd`/usr/local/nmap/share/nmap'" >> ~/.ivre.conf
# install p0f & Bro (.tar files)
# for some reason, wget on travis-ci won't accept letsencrypt certificate
- for archive in tools-travis-ivre bro-2.5.2_ubuntu-14.04 nmap-7.60_ubuntu-precise; do wget --no-check-certificate https://ivre.rocks/data/tests/${archive}.tar.bz2 -O - | tar jxf - ; done
- export PATH="`pwd`/tools/bin:`pwd`/usr/local/bro/bin:`pwd`/usr/local/nmap/bin:$PATH"
- export LD_LIBRARY_PATH="`pwd`/tools/lib:`pwd`/usr/local/bro/lib"
- export BROPATH=".:`pwd`/usr/local/bro/share/bro:`pwd`/usr/local/bro/share/bro/policy:`pwd`/usr/local/bro/share/bro/site"
- cp tools/etc/p0f/* tests/
# install IVRE's Nmap scripts.
- cp `python -c "import ivre.config; print(ivre.config.guess_prefix('nmap_scripts'))"`/*.nse `pwd`/usr/local/nmap/share/nmap/scripts/
- for patch in `python -c "import ivre.config; print(ivre.config.guess_prefix('nmap_scripts'))"`/patches/*; do (cd `pwd`/usr/local/nmap/share/nmap && patch -p0 < $patch); done
- nmap --script-updatedb
# get samples
- mkdir tests/samples
- cp tests/results-public-samples tests/samples/results
## Nmap Internet-wide Modbus scan (JSON format)
- wget --no-check-certificate -O tests/samples/Nmap-Modbus-IPv4.json.bz2 https://ivre.rocks/data/Nmap-Modbus-IPv4.json.bz2 # JSON files w/ Nmap scan results
## Masscan sample scans (XML format)
- for file in test-probe-ike-ipsec-nat-t-probe-U4500.xml.bz2 test-probe-ike-probe-U500.xml.bz2 test-T22.xml.bz2 ; do wget --no-check-certificate "https://ivre.rocks/data/tests/$file" -O "tests/samples/$file" ; done
## PCAP files from the Wireshark project
- wget -O tests/samples/http.pcap "https://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=get&target=http.cap"
- wget -O tests/samples/telnet-raw.pcap "https://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=get&target=telnet-raw.pcap"
- wget -O - "https://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=get&target=imap.cap.gz" | zcat > tests/samples/imap.pcap
- for file in telnet-raw.pcap nb6-startup.pcap nb6-http.pcap nb6-telephone.pcap nb6-hotspot.pcap ; do wget "https://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=get&target=$file" -O "tests/samples/$file" ; done
- export BRO_SAMPLES=`pwd`/usr/local/bro/testing
- ivre --version; echo; bro --version
script: cd tests/ && travis_wait 60 python tests.py --coverage
after_success:
- codecov