forked from dlundquist/sniproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
39 lines (39 loc) · 2.06 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
language: c
compiler:
- clang
- gcc
install:
- sudo apt-get update
- DEBIAN_FRONTEND=noninteractive sudo apt-get install -y libev-dev libpcre3-dev libudns-dev cdbs dh-autoreconf valgrind apache2-utils rpm
- mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
- ./autogen.sh
script:
- echo "Running unit tests"
- ./configure
- make all check
- 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"
- echo "Testing Debian package build"
- dpkg-buildpackage
- echo "Testing RPM package build"
- make dist
- rpmbuild --define "_sourcedir `pwd`" -ba --nodeps redhat/sniproxy.spec
- echo "Testing Debian package installation, configuration, and usage"
- 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`
- sudo service sniproxy stop
- sudo apt-get remove sniproxy
- echo "Rebuilding without DNS and rerunning unit tests"
- ./configure --disable-dns
- make clean all check