-
Notifications
You must be signed in to change notification settings - Fork 397
/
.travis.yml
46 lines (46 loc) · 2.83 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
language: c
compiler:
- clang
- gcc
install:
- sudo apt-get update
- DEBIAN_FRONTEND=noninteractive sudo apt-get install -y apache2-utils cdbs dh-autoreconf devscripts libev-dev libpcre2-dev libudns-dev lintian rpm valgrind
- mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
- ./autogen.sh
script:
- echo "Running unit and functional tests"
- ./configure
- make all check CFLAGS=-Werror
- bash -c "cd tests && sudo ./transparent_proxy_test"
- echo "Checking for memory leaks"
- bash -c "cd tests && ./bad_dns_request_test valgrind --leak-check=full --error-exitcode=1"
- bash -c "cd tests && ./bad_request_test valgrind --leak-check=full --error-exitcode=1"
- bash -c "cd tests && ./connection_reset_test valgrind --leak-check=full --error-exitcode=1"
- bash -c "cd tests && ./functional_test valgrind --leak-check=full --error-exitcode=1"
- bash -c "cd tests && ./hostname_test valgrind --leak-check=full --error-exitcode=1"
- bash -c "cd tests && ./slow_client_test valgrind --leak-check=full --error-exitcode=1"
- bash -c "cd tests && ./wildcard_test valgrind --leak-check=full --error-exitcode=1"
- bash -c "cd tests && ./bind_source_test valgrind --leak-check=full --error-exitcode=1"
- bash -c "cd tests && ./reload_test valgrind --leak-check=full --error-exitcode=1"
- bash -c "cd tests && ./proxy_header_test valgrind --leak-check=full --error-exitcode=1"
- echo "Testing Debian package build"
- dpkg-buildpackage -us -uc
- echo "Testing RPM package build"
- make dist
- rpmbuild --define "_sourcedir `pwd`" -ba --nodeps redhat/sniproxy.spec
- echo "Testing Debian package installation, configuration, and usage"
- lintian --suppress-tags debian-changelog-file-contains-invalid-email-address ../sniproxy_*_`dpkg --print-architecture`.deb
- sudo dpkg -i ../sniproxy_*_`dpkg --print-architecture`.deb
- sudo perl -pi -e 's/ENABLED=0/ENABLED=1/' /etc/default/sniproxy
- echo -e "user daemon\n\npidfile /var/run/sniproxy.pid\n\nerror_log {\n syslog daemon\n priority notice\n}\n\nlisten 80 {\n proto http\n}\n\ntable {\n localhost *\n}" | sudo tee /etc/sniproxy.conf
- sudo service sniproxy start
- sleep 1; test -e /var/run/sniproxy.pid && ps -up `cat /var/run/sniproxy.pid`
- echo "Testing config reload functionality"
- echo -e "user daemon\n\npidfile /var/run/sniproxy.pid\n\nerror_log {\n syslog daemon\n priority notice\n}\n\nlisten 80 {\n proto http\n}\n\nlisten 81 {\n proto http\n}\n\ntable {\n localhost *\n}" | sudo tee /etc/sniproxy.conf
- sudo kill -HUP `cat /var/run/sniproxy.pid`
- sudo netstat -lptn | egrep ':::81.+/sniproxy'
- sudo service sniproxy stop
- sudo apt-get remove sniproxy
- echo "Rebuilding without DNS and rerunning unit tests"
- ./configure --disable-dns
- make clean all check CFLAGS="-Werror -Wno-error=unused-function -Wno-error=unused-parameter"