summaryrefslogtreecommitdiffstats
path: root/trunk/tests
diff options
context:
space:
mode:
authorFederico Lucifredi <flucifredi@acm.org>2006-12-19 19:11:45 +0000
committerFederico Lucifredi <flucifredi@acm.org>2006-12-19 19:11:45 +0000
commit6386804f93ee272fcff73459a9cfe0b847101609 (patch)
tree26fa54c9fdaeb608560ccaa249f153e04e6e5798 /trunk/tests
parent16ed6d63c6c231cb5e606421ae3a245b2948185f (diff)
Branching for wide-area publishing work
git-svn-id: file:///home/lennart/svn/public/avahi/branches/federico@1344 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'trunk/tests')
-rw-r--r--trunk/tests/Makefile.am55
-rwxr-xr-xtrunk/tests/c-plus-plus-test-gen.py68
-rw-r--r--trunk/tests/c-plus-plus-test.cc84
-rwxr-xr-xtrunk/tests/fuzz-mdns.py8
4 files changed, 215 insertions, 0 deletions
diff --git a/trunk/tests/Makefile.am b/trunk/tests/Makefile.am
new file mode 100644
index 0000000..c91cea4
--- /dev/null
+++ b/trunk/tests/Makefile.am
@@ -0,0 +1,55 @@
+# $Id$
+#
+# This file is part of avahi.
+#
+# avahi is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# avahi is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with avahi; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+
+AM_CFLAGS= \
+ -I$(top_srcdir)
+
+if HAVE_GLIB
+if HAVE_DBUS
+if HAVE_NETLINK
+
+if ENABLE_TESTS
+noinst_PROGRAMS = c-plus-plus-test
+endif
+
+c_plus_plus_test_SOURCES = c-plus-plus-test.cc
+
+c_plus_plus_test_CXXFLAGS = \
+ $(AM_CFLAGS) \
+ $(GLIB20_CFLAGS) \
+ $(DBUS_CFLAGS)
+
+c_plus_plus_test_LDADD = \
+ $(AM_LDADD) \
+ ../avahi-common/libavahi-common.la \
+ ../avahi-core/libavahi-core.la \
+ ../avahi-client/libavahi-client.la \
+ ../avahi-glib/libavahi-glib.la \
+ $(GLIB20_LIBS) \
+ $(DBUS_LIBS)
+
+endif
+endif
+endif
+
+EXTRA_DIST=c-plus-plus-test-gen.py
+
+gen:
+ python ./c-plus-plus-test-gen.py avahi-common avahi-core avahi-client avahi-glib > c-plus-plus-test.cc
+
diff --git a/trunk/tests/c-plus-plus-test-gen.py b/trunk/tests/c-plus-plus-test-gen.py
new file mode 100755
index 0000000..46d6762
--- /dev/null
+++ b/trunk/tests/c-plus-plus-test-gen.py
@@ -0,0 +1,68 @@
+#!/usr/bin/python
+
+# $Id$
+#
+# This file is part of avahi.
+#
+# avahi is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# avahi is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with avahi; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+
+import os, sys
+
+def print_includes(dir):
+
+ files = os.listdir("../%s" % dir)
+ files = filter(lambda fn: fn.endswith(".h") and not fn.startswith("."), files)
+ files.sort()
+
+ for f in files:
+ print "#include <%s/%s>" % (dir, f)
+
+
+print """/* $Id$ */
+
+/***
+ This file is part of avahi.
+
+ avahi is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ avahi is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+ Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with avahi; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+"""
+
+for f in sys.argv[1:]:
+ print_includes(f)
+
+print """
+int main(int argc, char*argv[]) {
+ return 0;
+}
+"""
diff --git a/trunk/tests/c-plus-plus-test.cc b/trunk/tests/c-plus-plus-test.cc
new file mode 100644
index 0000000..947aa44
--- /dev/null
+++ b/trunk/tests/c-plus-plus-test.cc
@@ -0,0 +1,84 @@
+/* $Id$ */
+
+/***
+ This file is part of avahi.
+
+ avahi is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ avahi is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+ Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with avahi; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <avahi-common/address.h>
+#include <avahi-common/alternative.h>
+#include <avahi-common/cdecl.h>
+#include <avahi-common/dbus-watch-glue.h>
+#include <avahi-common/dbus.h>
+#include <avahi-common/defs.h>
+#include <avahi-common/domain.h>
+#include <avahi-common/error.h>
+#include <avahi-common/gccmacro.h>
+#include <avahi-common/llist.h>
+#include <avahi-common/malloc.h>
+#include <avahi-common/rlist.h>
+#include <avahi-common/simple-watch.h>
+#include <avahi-common/strlst.h>
+#include <avahi-common/timeval.h>
+#include <avahi-common/watch.h>
+#include <avahi-core/addr-util.h>
+#include <avahi-core/announce.h>
+#include <avahi-core/browse.h>
+#include <avahi-core/cache.h>
+#include <avahi-core/core.h>
+#include <avahi-core/dns-srv-rr.h>
+#include <avahi-core/dns.h>
+#include <avahi-core/domain-util.h>
+#include <avahi-core/fdutil.h>
+#include <avahi-core/hashmap.h>
+#include <avahi-core/iface-linux.h>
+#include <avahi-core/iface.h>
+#include <avahi-core/internal.h>
+#include <avahi-core/log.h>
+#include <avahi-core/lookup.h>
+#include <avahi-core/multicast-lookup.h>
+#include <avahi-core/netlink.h>
+#include <avahi-core/prioq.h>
+#include <avahi-core/probe-sched.h>
+#include <avahi-core/publish.h>
+#include <avahi-core/querier.h>
+#include <avahi-core/query-sched.h>
+#include <avahi-core/response-sched.h>
+#include <avahi-core/rr-util.h>
+#include <avahi-core/rr.h>
+#include <avahi-core/rrlist.h>
+#include <avahi-core/socket.h>
+#include <avahi-core/timeeventq.h>
+#include <avahi-core/util.h>
+#include <avahi-core/wide-area.h>
+#include <avahi-client/client.h>
+#include <avahi-client/internal.h>
+#include <avahi-client/lookup.h>
+#include <avahi-client/publish.h>
+#include <avahi-client/xdg-config.h>
+#include <avahi-glib/glib-malloc.h>
+#include <avahi-glib/glib-watch.h>
+
+int main(int argc, char*argv[]) {
+ return 0;
+}
+
diff --git a/trunk/tests/fuzz-mdns.py b/trunk/tests/fuzz-mdns.py
new file mode 100755
index 0000000..aeea295
--- /dev/null
+++ b/trunk/tests/fuzz-mdns.py
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+
+from scapy import *
+
+
+sendp(Ether(type=0x800, dst="ff:ff:ff:ff:ff:ff")/IP(dst="224.0.0.251")/fuzz(UDP(dport = 5353, sport = 5353)/DNS(qd = fuzz(DNSQR()))),loop=1, iface="realtek0")
+
+