diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-16 19:31:53 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-16 19:31:53 +0300 |
commit | c8865a0d524f3d545836bd4581329089a357661e (patch) | |
tree | 4fc437a07086c4304e7ec2446be2a504a3dbd507 /tests | |
parent | 50e703a9a92e755f928699b705612cd4153ffb9f (diff) | |
download | grecs-c8865a0d524f3d545836bd4581329089a357661e.tar.gz grecs-c8865a0d524f3d545836bd4581329089a357661e.tar.bz2 |
Add bind testsuite.
* README.submodule: Update URL.
* src/bind-lex.l (grecs_bind_new_source): Scan include path.
* src/grecs.h (grecs_find_include_file): new proto.
* src/preproc.c (try_file): Rename to grecs_find_include_file. Change
signature and return type. All uses updated.
* tests/Makefile.am (EXTRA_DIST): Add new configs.
(TESTSUITE_AT): Add parser-bind.at.
* tests/gcffmt.c: Add -I (-include) option.
* tests/testsuite.at: Include parser-bind.at.
* tests/bind.conf: New file.
* tests/bind.dlz: New file.
* tests/bind.ext.conf: New file.
* tests/bind.int.conf: New file.
* tests/bind.keys: New file.
* tests/parser-bind.at: New file.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 15 | ||||
-rw-r--r-- | tests/bind.conf | 126 | ||||
-rw-r--r-- | tests/bind.dlz | 33 | ||||
-rw-r--r-- | tests/bind.ext.conf | 25 | ||||
-rw-r--r-- | tests/bind.int.conf | 17 | ||||
-rw-r--r-- | tests/bind.keys | 11 | ||||
-rw-r--r-- | tests/gcffmt.c | 8 | ||||
-rw-r--r-- | tests/parser-bind.at | 95 | ||||
-rw-r--r-- | tests/testsuite.at | 1 |
9 files changed, 328 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index f5d1f6f..1b47712 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am | |||
@@ -15,5 +15,17 @@ | |||
15 | # along with Grecs. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with Grecs. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 gcf1.conf meta1.conf git.conf | 17 | EXTRA_DIST = \ |
18 | $(TESTSUITE_AT)\ | ||
19 | testsuite\ | ||
20 | package.m4\ | ||
21 | gcf1.conf\ | ||
22 | bind.conf\ | ||
23 | bind.keys\ | ||
24 | bind.int.conf\ | ||
25 | bind.ext.conf\ | ||
26 | bind.dlz\ | ||
27 | meta1.conf\ | ||
28 | git.conf | ||
29 | |||
18 | DISTCLEANFILES = atconfig $(check_SCRIPTS) | 30 | DISTCLEANFILES = atconfig $(check_SCRIPTS) |
19 | MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) | 31 | MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) |
@@ -52,4 +64,5 @@ TESTSUITE_AT = \ | |||
52 | enum.at\ | 64 | enum.at\ |
53 | join.at\ | 65 | join.at\ |
66 | parser-bind.at\ | ||
54 | parser-git.at\ | 67 | parser-git.at\ |
55 | parser-meta1.at\ | 68 | parser-meta1.at\ |
diff --git a/tests/bind.conf b/tests/bind.conf new file mode 100644 index 0000000..2579a58 --- /dev/null +++ b/tests/bind.conf | |||
@@ -0,0 +1,126 @@ | |||
1 | # Sample Bind configuration file for Grecs testsuite. | ||
2 | # Nothing to copyright, really:) | ||
3 | |||
4 | acl upd-dyn-vpn { | ||
5 | key vpn.; | ||
6 | 10.11.0.1; | ||
7 | 10.10.0.1; | ||
8 | }; | ||
9 | |||
10 | acl foo-acl { | ||
11 | key foo.; | ||
12 | }; | ||
13 | |||
14 | options { | ||
15 | version "Grecs testsuite"; | ||
16 | coresize 0; | ||
17 | directory "/etc/namedb"; | ||
18 | pid-file "/var/log/bind/named.pid"; | ||
19 | allow-transfer { | ||
20 | foo-acl; | ||
21 | }; | ||
22 | allow-query { | ||
23 | any; | ||
24 | }; | ||
25 | serial-query-rate 5; | ||
26 | max-journal-size 5m; | ||
27 | check-names master warn; | ||
28 | check-names slave warn; | ||
29 | check-names response ignore; | ||
30 | }; | ||
31 | |||
32 | logging { | ||
33 | channel default_channel { | ||
34 | file "/var/log/bind/named.log" versions 9 size 524288; | ||
35 | print-time yes; | ||
36 | print-severity yes; | ||
37 | }; | ||
38 | channel debug_channel { | ||
39 | file "/var/log/bind/named.run" versions 9 size 524288; | ||
40 | print-time yes; | ||
41 | print-severity yes; | ||
42 | severity dynamic; | ||
43 | }; | ||
44 | channel security_channel { | ||
45 | file "/var/log/bind/security" versions 9 size 524288; | ||
46 | print-time yes; | ||
47 | print-severity yes; | ||
48 | }; | ||
49 | channel xfer_in_channel { | ||
50 | file "/var/log/bind/named-xfer.in" versions 9 size 524288; | ||
51 | print-time yes; | ||
52 | }; | ||
53 | channel xfer_out_channel { | ||
54 | file "/var/log/bind/named-xfer.out" versions 9 size 524288; | ||
55 | print-time yes; | ||
56 | }; | ||
57 | channel lamers_channel { | ||
58 | file "/var/log/bind/lamers.log" versions 5 size 524288; | ||
59 | print-time yes; | ||
60 | print-category yes; | ||
61 | }; | ||
62 | channel update_channel { | ||
63 | file "/var/log/bind/update.log" versions 9 size 524288; | ||
64 | print-time yes; | ||
65 | print-category yes; | ||
66 | severity debug 5; | ||
67 | }; | ||
68 | channel notify_channel { | ||
69 | file "/var/log/bind/notify.log" versions 9 size 524288; | ||
70 | print-time yes; | ||
71 | print-category yes; | ||
72 | }; | ||
73 | channel query_channel { | ||
74 | file "/var/log/bind/query.log" versions 9 size 524288; | ||
75 | print-time yes; | ||
76 | }; | ||
77 | category security { | ||
78 | security_channel; | ||
79 | }; | ||
80 | category queries { | ||
81 | # query_channel; | ||
82 | null; | ||
83 | }; | ||
84 | category default { | ||
85 | default_channel; | ||
86 | debug_channel; | ||
87 | }; | ||
88 | category xfer-in { | ||
89 | xfer_in_channel; | ||
90 | }; | ||
91 | category xfer-out { | ||
92 | xfer_out_channel; | ||
93 | }; | ||
94 | category delegation-only { | ||
95 | lamers_channel; | ||
96 | }; | ||
97 | category lame-servers { | ||
98 | lamers_channel; | ||
99 | }; | ||
100 | category update { | ||
101 | update_channel; | ||
102 | }; | ||
103 | category notify { | ||
104 | notify_channel; | ||
105 | }; | ||
106 | }; | ||
107 | |||
108 | include "bind.keys"; | ||
109 | |||
110 | controls { | ||
111 | inet 127.0.0.1 port 953 | ||
112 | allow { 127.0.0.1; } keys { "rndc-key"; }; | ||
113 | }; | ||
114 | |||
115 | view "internal" { | ||
116 | match-clients { | ||
117 | 10.0.0.0/8; | ||
118 | }; | ||
119 | include "bind.int.conf"; | ||
120 | }; | ||
121 | |||
122 | view "external" { | ||
123 | include "bind.ext.conf"; | ||
124 | include "bind.dlz"; | ||
125 | }; | ||
126 | # Finis coronat opus | ||
diff --git a/tests/bind.dlz b/tests/bind.dlz new file mode 100644 index 0000000..ffbbfc9 --- /dev/null +++ b/tests/bind.dlz | |||
@@ -0,0 +1,33 @@ | |||
1 | # Sample Bind configuration include file (3) for Grecs testsuite. | ||
2 | # This is a typical (?) DLZ configuraton for BIND. | ||
3 | # | ||
4 | dlz "DLZ" { | ||
5 | database "mysql | ||
6 | {host=localhost socket=/var/run/mysql/mysql.sock dbname=Foo user=bind ssl=false} | ||
7 | {select r.zone from dns_soa r, dns_acl a where r.zone = '%zone%' | ||
8 | and a.network <= inet_aton('%client%') and inet_aton('%client%') <= | ||
9 | a.bcast | ||
10 | and a.view = r.view } | ||
11 | {select r.ttl, r.type, r.mx_priority, | ||
12 | case when r.type='TXT' then concat('\"', r.data, '\"') else r.data end | ||
13 | from dns_records r, dns_acl a, | ||
14 | where r.zone = '%zone%' and r.host = '%record%' | ||
15 | and not (r.type = 'SOA' or r.type = 'NS') | ||
16 | and a.network <= inet_aton('%client%') and inet_aton('%client%') <= | ||
17 | a.bcast | ||
18 | and a.view = r.view } | ||
19 | {select r.ttl, r.type, r.data, r.resp_person, r.serial, | ||
20 | r.refresh, r.retry, r.expire, r.minimum | ||
21 | from dns_soa r, dns_acl a where r.zone = '%zone%' | ||
22 | and (r.type = 'SOA' or r.type='NS') | ||
23 | and a.network <= inet_aton('%client%') and | ||
24 | inet_aton('%client%') <= a.bcast | ||
25 | and a.view = r.view } | ||
26 | {select r.ttl, r.type, r.host, r.mx_priority, case when r.type='TXT' then | ||
27 | concat('\"', r.data, '\"') else r.data end | ||
28 | from dns_records r, dns_acl a where r.zone = '%zone%' | ||
29 | and a.network <= inet_aton('%client%') and | ||
30 | inet_aton('%client%') <= a.bcast | ||
31 | and a.view = r.view } | ||
32 | {select zone from dns_xfr where zone = '%zone%' and client = '%client%'}"; | ||
33 | }; | ||
diff --git a/tests/bind.ext.conf b/tests/bind.ext.conf new file mode 100644 index 0000000..b18e8f6 --- /dev/null +++ b/tests/bind.ext.conf | |||
@@ -0,0 +1,25 @@ | |||
1 | # Sample Bind configuration include file (2) for Grecs testsuite. | ||
2 | |||
3 | zone "." { | ||
4 | type hint; | ||
5 | file "named.root"; | ||
6 | }; | ||
7 | |||
8 | zone "com" { | ||
9 | type delegation-only; | ||
10 | }; | ||
11 | |||
12 | zone "net" { | ||
13 | type delegation-only; | ||
14 | }; | ||
15 | |||
16 | zone "0.0.127.IN-ADDR.ARPA" { | ||
17 | type master; | ||
18 | file "local.p"; | ||
19 | }; | ||
20 | |||
21 | zone "foo.example.net" { | ||
22 | type master; | ||
23 | file "foo.p"; | ||
24 | }; | ||
25 | \ No newline at end of file | ||
diff --git a/tests/bind.int.conf b/tests/bind.int.conf new file mode 100644 index 0000000..faba329 --- /dev/null +++ b/tests/bind.int.conf | |||
@@ -0,0 +1,17 @@ | |||
1 | # Sample Bind configuration include file (2) for Grecs testsuite. | ||
2 | |||
3 | zone "int" { | ||
4 | type master; | ||
5 | file "int.p"; | ||
6 | allow-update { | ||
7 | upd-dyn-vpn; | ||
8 | }; | ||
9 | allow-query { |