mcr / tcpdump

the TCPdump network dissector. now moved to:
https://github.com/the-tcpdump-group/tcpdump
Other
84 stars 2 forks source link

Add support for using Travis CI for testing #32

Closed msabramo closed 12 years ago

msabramo commented 12 years ago

Sample Travis CI build for my fork: https://travis-ci.org/#!/msabramo/tcpdump

To add support for Travis CI to your own GitHub repo, follow the instructions at http://about.travis-ci.org/docs/user/getting-started/ and then accept this pull request.

msabramo commented 12 years ago

Originally, I had a line in .travis.yml that created a symlink from /usr/lib/i386-linux-gnu/libcrypto.so to /usr/lib/libcrypto.so, but this is a pretty big hack. I replaced that with a line that patches configure.in to detect libcrypto.so using a simpler method that leverages built-in autotools functionality.

Having the patch be hosted on a web link that could go down is of course a risk, so it probably makes sense to provide that patch in this repo. It's kind of ugly to provide a patch for certain platforms, but making the change in configure.in and configure carries a small risk of breaking other platforms (though one would hope that autotools would have the best chance of handling things in a cross-platform way).

I'm a little undecided on how to proceed, but would take suggestions from other folks...

msabramo commented 12 years ago

The configure.in patch used in this PR works on Travis CI (which uses 32-bit Ubuntu Linux 12.04):

$ curl -sk http://patch-tracker.debian.org/patch/series/dl/tcpdump/4.3.0-1/40_openssl.diff | patch -p1
patching file configure.in
$ autoconf
$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu 
...

and on my 32-bit Ubuntu Linux 11 vm:

marca@ubuntu:~/dev/git-repos/tcpdump$ curl -sk http://patch-tracker.debian.org/patch/series/dl/tcpdump/4.3.0-1/40_openssl.diff | patch -p1
patching file configure.in
marca@ubuntu:~/dev/git-repos/tcpdump$ autoconf
marca@ubuntu:~/dev/git-repos/tcpdump$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
...
checking whether to use SSLeay libcrypto... yes, if available
checking for DES_cbc_encrypt in -lcrypto... yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tcpdump.1
config.status: creating config.h
config.status: executing default-1 commands
marca@ubuntu:~/dev/git-repos/tcpdump$ make
...
marca@ubuntu:~/dev/git-repos/tcpdump$ make check
(cd tests && ./TESTrun.sh)
reading from file lmp.pcap, link-type EN10MB (Ethernet)
lmp.sh: passed.
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
print-flags.sh: passed.
    bgp_vpn_attrset: passed.
    eapon1: passed.
    esp0: passed.
    esp1: passed.
    esp2: passed.
    esp3: passed.
    esp4: passed.
    esp5: passed.
    espudp1: passed.
    isakmp1: passed.
    isakmp2: passed.
    isakmp3: passed.
    isakmp4: passed.
    mpls-ldp-hello: passed.
    ospf-gmpls: passed.
    ikev2four: passed.
    ikev2fourv: passed.
    ikev2fourv4: passed.
    ikev2pI2: passed.
    dio01: passed.
    e1000g: passed.
    forces01: passed.
    forces01vvv: passed.
    forces01vvvv: passed.
    qinq: passed.
    qinqv: passed.
    sflow1: passed.
    babel1: passed.
    babel1v: passed.
    babel_auth: passed.
    pppoe: passed.
    icmpv6: passed.
    spb: passed.
    ripv1v2: passed.
    ripv2_auth: passed.

   0 tests failed
  37 tests passed

It also works on OS X 10.7.4:

marca@SCML-MarcA:~/dev/git-repos/tcpdump$ curl -sk http://patch-tracker.debian.org/patch/series/dl/tcpdump/4.3.0-1/40_openssl.diff | patch -p1
patching file configure.in
marca@SCML-MarcA:~/dev/git-repos/tcpdump$ autoconf
marca@SCML-MarcA:~/dev/git-repos/tcpdump$ ./configure
checking build system type... x86_64-apple-darwin11.4.0
checking host system type... x86_64-apple-darwin11.4.0
...
checking whether to use SSLeay libcrypto... yes, if available
checking for DES_cbc_encrypt in -lcrypto... yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tcpdump.1
config.status: creating config.h
config.status: executing default-1 commands
marca@SCML-MarcA:~/dev/git-repos/tcpdump$ make
...
marca@SCML-MarcA:~/dev/git-repos/tcpdump$ make check
(cd tests && ./TESTrun.sh)
reading from file lmp.pcap, link-type EN10MB (Ethernet)
lmp.sh: passed.
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
print-flags.sh: passed.
    bgp_vpn_attrset: passed.
    eapon1: passed.
    esp0: passed.
    esp1: passed.
    esp2: passed.
    esp3: passed.
    esp4: passed.
    esp5: passed.
    espudp1: passed.
    isakmp1: passed.
    isakmp2: passed.
    isakmp3: passed.
    isakmp4: passed.
    mpls-ldp-hello: passed.
    ospf-gmpls: passed.
    ikev2four: passed.
    ikev2fourv: passed.
    ikev2fourv4: passed.
    ikev2pI2: passed.
    dio01: passed.
    e1000g: passed.
    forces01: passed.
    forces01vvv: passed.
    forces01vvvv: passed.
    qinq: passed.
    qinqv: passed.
    sflow1: passed.
    babel1: passed.
    babel1v: passed.
    babel_auth: passed.
    pppoe: passed.
    icmpv6: passed.
    spb: passed.
    ripv1v2: passed.
    ripv2_auth: passed.

   0 tests failed
  37 tests passed

and Fedora 16:

[marca@fedora16 tcpdump]$ curl -sk http://patch-tracker.debian.org/patch/series/dl/tcpdump/4.3.0-1/40_openssl.diff | patch -p1
patching file configure.in
[marca@fedora16 tcpdump]$ autoconf
[marca@fedora16 tcpdump]$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
...
checking whether to use SSLeay libcrypto... yes, if available
checking for DES_cbc_encrypt in -lcrypto... yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tcpdump.1
config.status: creating config.h
config.status: executing default-1 commands
[marca@fedora16 tcpdump]$ make
...
[marca@fedora16 tcpdump]$ make check
(cd tests && ./TESTrun.sh)
reading from file lmp.pcap, link-type EN10MB (Ethernet)
lmp.sh: passed.
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
print-flags.sh: passed.
    bgp_vpn_attrset: passed.
    eapon1: passed.
    esp0: passed.
    esp1: passed.
    esp2: passed.
    esp3: passed.
    esp4: passed.
    esp5: passed.
    espudp1: passed.
    isakmp1: passed.
    isakmp2: passed.
    isakmp3: passed.
    isakmp4: passed.
    mpls-ldp-hello: passed.
    ospf-gmpls: passed.
    ikev2four: passed.
    ikev2fourv: passed.
    ikev2fourv4: passed.
    ikev2pI2: passed.
    dio01: passed.
    e1000g: passed.
    forces01: passed.
    forces01vvv: passed.
    forces01vvvv: passed.
    qinq: passed.
    qinqv: passed.
    sflow1: passed.
    babel1: passed.
    babel1v: passed.
    babel_auth: passed.
    pppoe: passed.
    icmpv6: passed.
    spb: passed.
    ripv1v2: passed.
    ripv2_auth: passed.

   0 tests failed
  37 tests passed
infrastation commented 12 years ago

I'd suggest trying to poll tcpdump-workers for more feedback.

msabramo commented 12 years ago

Result on FreeBSD 9 with amd64:

[marca@freebsd9 ~/dev/git-repos/tcpdump]$ curl -sk http://patch-tracker.debian.org/patch/series/dl/tcpdump/4.3.0-1/40_openssl.diff | patch -p1
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Simplify OpenSSL detection logic to make sure it gets enabled.
|
|--- a/configure.in
|+++ b/configure.in
--------------------------
Patching file configure.in using Plan A...
Hunk #1 succeeded at 1023.
done
[marca@freebsd9 ~/dev/git-repos/tcpdump]$ autoconf
[marca@freebsd9 ~/dev/git-repos/tcpdump]$ ./configure
checking build system type... x86_64-unknown-freebsd9.0
checking host system type... x86_64-unknown-freebsd9.0
...
checking whether to use SSLeay libcrypto... yes, if available
checking for DES_cbc_encrypt in -lcrypto... yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tcpdump.1
config.status: creating config.h
config.status: executing default-1 commands
[marca@freebsd9 ~/dev/git-repos/tcpdump]$ make
...
[marca@freebsd9 ~/dev/git-repos/tcpdump]$ make check
(cd tests && ./TESTrun.sh)
reading from file lmp.pcap, link-type EN10MB (Ethernet)
lmp.sh: passed.
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
print-flags.sh: passed.
    bgp_vpn_attrset: passed.
    eapon1: passed.
    esp0: passed.
    esp1: passed.
    esp2: passed.
    esp3: passed.
    esp4: passed.
    esp5: passed.
    espudp1: passed.
    isakmp1: passed.
    isakmp2: passed.
    isakmp3: passed.
    isakmp4: passed.
    mpls-ldp-hello: passed.
    ospf-gmpls: passed.
    ikev2four: passed.
    ikev2fourv: passed.
    ikev2fourv4: passed.
    ikev2pI2: passed.
    dio01: passed.
    e1000g: passed.
    forces01: passed.
    forces01vvv: passed.
    forces01vvvv: passed.
    qinq: passed.
    qinqv: passed.
    sflow1: passed.
    babel1: passed.
    babel1v: passed.
    babel_auth: passed.
    pppoe: passed.
    icmpv6: passed.
    spb: passed.
    ripv1v2: passed.
    ripv2_auth: passed.

   0 tests failed
  37 tests passed
msabramo commented 12 years ago

Fedora 17 64-bit:

[marca@fedora17 tcpdump]$ curl -sk http://patch-tracker.debian.org/patch/series/dl/tcpdump/4.3.0-1/40_openssl.diff | patch -p1
patching file configure.in
[marca@fedora17 tcpdump]$ autoconf
[marca@fedora17 tcpdump]$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
...
checking whether to use SSLeay libcrypto... yes, if available
checking for DES_cbc_encrypt in -lcrypto... yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tcpdump.1
config.status: creating config.h
config.status: executing default-1 commands
[marca@fedora17 tcpdump]$ make
...
[marca@fedora17 tcpdump]$ make check
(cd tests && ./TESTrun.sh)
reading from file lmp.pcap, link-type EN10MB (Ethernet)
lmp.sh: passed.
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
reading from file print-flags.pcap, link-type EN10MB (Ethernet)
print-flags.sh: passed.
    bgp_vpn_attrset: passed.
    eapon1: passed.
    esp0: passed.
    esp1: passed.
    esp2: passed.
    esp3: passed.
    esp4: passed.
    esp5: passed.
    espudp1: passed.
    isakmp1: passed.
    isakmp2: passed.
    isakmp3: passed.
    isakmp4: passed.
    mpls-ldp-hello: passed.
    ospf-gmpls: passed.
    ikev2four: passed.
    ikev2fourv: passed.
    ikev2fourv4: passed.
    ikev2pI2: passed.
    dio01: passed.
    e1000g: passed.
    forces01: passed.
    forces01vvv: passed.
    forces01vvvv: passed.
    qinq: passed.
    qinqv: passed.
    sflow1: passed.
    babel1: passed.
    babel1v: passed.
    babel_auth: passed.
    pppoe: passed.
    icmpv6: passed.
    spb: passed.
    ripv1v2: passed.
    ripv2_auth: passed.

   0 tests failed
  37 tests passed
msabramo commented 12 years ago

On Illumian

marca@illumos1:~/dev/git-repos/tcpdump$ uname -a
SunOS illumos1 5.11 4cece89cac3e i86pc i386 i86pc Solaris
marca@illumos1:~/dev/git-repos/tcpdump$ curl -sk http://patch-tracker.debian.org/patch/series/dl/tcpdump/4.3.0-1/40_openssl.diff | patch -p1
patching file configure.in
marca@illumos1:~/dev/git-repos/tcpdump$ autoconf
marca@illumos1:~/dev/git-repos/tcpdump$ ./configure
checking build system type... i386-pc-solaris2.11
checking host system type... i386-pc-solaris2.11
...
checking whether to use SSLeay libcrypto... yes, if available
checking for DES_cbc_encrypt in -lcrypto... yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for a BSD-compatible install... /usr/gnu/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tcpdump.1
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing default-1 commands
marca@illumos1:~/dev/git-repos/tcpdump$ make
gcc -O2 -DHAVE_CONFIG_H  -I./missing  -D_U_="__attribute__((unused))" -I. -I/usr/include  -I./missing -g -O2 -c ./addrtoname.c
gcc -O2 -DHAVE_CONFIG_H  -I./missing  -D_U_="__attribute__((unused))" -I. -I/usr/include  -I./missing -g -O2 -c ./af.c
gcc -O2 -DHAVE_CONFIG_H  -I./missing  -D_U_="__attribute__((unused))" -I. -I/usr/include  -I./missing -g -O2 -c ./checksum.c
/var/tmp//cc6Vayyo.s: Assembler messages:
/var/tmp//cc6Vayyo.s:49: Error: no such instruction: `cmovl.ne %ecx,%eax'
make: *** [checksum.o] Error 1

Whoa, OK something is seriously wrong with my gcc installation; this is not a tcpdump problem :-)

mcr commented 12 years ago

------- Blind-Carbon-Copy

From: Michael Richardson mcr@sandelman.ca To: tcpdump-workers@lists.tcpdump.org Subject: Re: [tcpdump] Add support for using Travis CI for testing (#32) In-Reply-To: mcr/tcpdump/pull/32/c9391130@github.com References: mcr/tcpdump/pull/32@github.com mcr/tcpdump/pull/32/c9391130@github.com X-Mailer: MH-E 8.3; nmh 1.3-dev; XEmacs 21.4 (patch 22) X-Face: $\n1pF)h^}$H>Hk{L"x@)JS7<%Az}5RyS@k9X%29-lHB$Ti.V>2bi.~ehC0;<'$9xN5Ub# z!G,pnR&p7Fz@^UXIn156S8.~^@MJ*mMsD7=QFeq%AL4m<nPbLgmtKK-5dC@#:k Date: Sun, 14 Oct 2012 12:16:18 -0400 Message-ID: 8293.1350231378@obiwan.sandelman.ca Sender: mcr@obiwan.sandelman.ca

Marc Abramowitz sent a github pull for .travis.yml for tcpdump. See: http://about.travis-ci.org/docs/user/getting-started/

Reading more... okay, so it's something that can work against github, and anyone can use it.... seems very useable.


] He who is tired of Weird Al is tired of life! | firewalls [ ] Michael Richardson, Sandelman Software Works, Ottawa, ON |net architect[ ] mcr@sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[ Kyoto Plus: watch the video http://www.youtube.com/watch?v=kzx1ycLXQSE then sign the petition.

------- End of Blind-Carbon-Copy