OpenDNSSEC-enforcer 2.1.10
test_zone.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Jerry Lundström <lundstrom.jerry@gmail.com>
3 * Copyright (c) 2014 .SE (The Internet Infrastructure Foundation).
4 * Copyright (c) 2014 OpenDNSSEC AB (svb)
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
29
30#include "CUnit/Basic.h"
31
32#include "../db_configuration.h"
33#include "../db_connection.h"
34#include "../zone_db.h"
35
36#include <string.h>
37
38static db_configuration_list_t* configuration_list = NULL;
39static db_configuration_t* configuration = NULL;
40static db_connection_t* connection = NULL;
41
42static zone_db_t* object = NULL;
43static zone_list_db_t* object_list = NULL;
44static db_value_t id = DB_VALUE_EMPTY;
45static db_clause_list_t* clause_list = NULL;
46
47static int db_sqlite = 0;
48static int db_mysql = 0;
49
50#if defined(ENFORCER_DATABASE_SQLITE3)
51int test_zone_init_suite_sqlite(void) {
52 if (configuration_list) {
53 return 1;
54 }
55 if (configuration) {
56 return 1;
57 }
58 if (connection) {
59 return 1;
60 }
61
62 /*
63 * Setup the configuration for the connection
64 */
65 if (!(configuration_list = db_configuration_list_new())) {
66 return 1;
67 }
68 if (!(configuration = db_configuration_new())
69 || db_configuration_set_name(configuration, "backend")
70 || db_configuration_set_value(configuration, "sqlite")
71 || db_configuration_list_add(configuration_list, configuration))
72 {
73 db_configuration_free(configuration);
74 configuration = NULL;
75 db_configuration_list_free(configuration_list);
76 configuration_list = NULL;
77 return 1;
78 }
79 configuration = NULL;
80 if (!(configuration = db_configuration_new())
81 || db_configuration_set_name(configuration, "file")
82 || db_configuration_set_value(configuration, "test.db")
83 || db_configuration_list_add(configuration_list, configuration))
84 {
85 db_configuration_free(configuration);
86 configuration = NULL;
87 db_configuration_list_free(configuration_list);
88 configuration_list = NULL;
89 return 1;
90 }
91 configuration = NULL;
92
93 /*
94 * Connect to the database
95 */
96 if (!(connection = db_connection_new())
97 || db_connection_set_configuration_list(connection, configuration_list))
98 {
99 db_connection_free(connection);
100 connection = NULL;
101 db_configuration_list_free(configuration_list);
102 configuration_list = NULL;
103 return 1;
104 }
105 configuration_list = NULL;
106
107 if (db_connection_setup(connection)
108 || db_connection_connect(connection))
109 {
110 db_connection_free(connection);
111 connection = NULL;
112 return 1;
113 }
114
115 db_sqlite = 1;
116 db_mysql = 0;
117
118 return 0;
119}
120#endif
121
122#if defined(ENFORCER_DATABASE_MYSQL)
123int test_zone_init_suite_mysql(void) {
124 if (configuration_list) {
125 return 1;
126 }
127 if (configuration) {
128 return 1;
129 }
130 if (connection) {
131 return 1;
132 }
133
134 /*
135 * Setup the configuration for the connection
136 */
137 if (!(configuration_list = db_configuration_list_new())) {
138 return 1;
139 }
140 if (!(configuration = db_configuration_new())
141 || db_configuration_set_name(configuration, "backend")
142 || db_configuration_set_value(configuration, "mysql")
143 || db_configuration_list_add(configuration_list, configuration))
144 {
145 db_configuration_free(configuration);
146 configuration = NULL;
147 db_configuration_list_free(configuration_list);
148 configuration_list = NULL;
149 return 1;
150 }
151 configuration = NULL;
152 if (!(configuration = db_configuration_new())
153 || db_configuration_set_name(configuration, "host")
154 || db_configuration_set_value(configuration, ENFORCER_DB_HOST)
155 || db_configuration_list_add(configuration_list, configuration))
156 {
157 db_configuration_free(configuration);
158 configuration = NULL;
159 db_configuration_list_free(configuration_list);
160 configuration_list = NULL;
161 return 1;
162 }
163 configuration = NULL;
164 if (!(configuration = db_configuration_new())
165 || db_configuration_set_name(configuration, "port")
166 || db_configuration_set_value(configuration, ENFORCER_DB_PORT_TEXT)
167 || db_configuration_list_add(configuration_list, configuration))
168 {
169 db_configuration_free(configuration);
170 configuration = NULL;
171 db_configuration_list_free(configuration_list);
172 configuration_list = NULL;
173 return 1;
174 }
175 configuration = NULL;
176 if (!(configuration = db_configuration_new())
177 || db_configuration_set_name(configuration, "user")
178 || db_configuration_set_value(configuration, ENFORCER_DB_USERNAME)
179 || db_configuration_list_add(configuration_list, configuration))
180 {
181 db_configuration_free(configuration);
182 configuration = NULL;
183 db_configuration_list_free(configuration_list);
184 configuration_list = NULL;
185 return 1;
186 }
187 configuration = NULL;
188 if (!(configuration = db_configuration_new())
189 || db_configuration_set_name(configuration, "pass")
190 || db_configuration_set_value(configuration, ENFORCER_DB_PASSWORD)
191 || db_configuration_list_add(configuration_list, configuration))
192 {
193 db_configuration_free(configuration);
194 configuration = NULL;
195 db_configuration_list_free(configuration_list);
196 configuration_list = NULL;
197 return 1;
198 }
199 configuration = NULL;
200 if (!(configuration = db_configuration_new())
201 || db_configuration_set_name(configuration, "db")
202 || db_configuration_set_value(configuration, ENFORCER_DB_DATABASE)
203 || db_configuration_list_add(configuration_list, configuration))
204 {
205 db_configuration_free(configuration);
206 configuration = NULL;
207 db_configuration_list_free(configuration_list);
208 configuration_list = NULL;
209 return 1;
210 }
211 configuration = NULL;
212
213 /*
214 * Connect to the database
215 */
216 if (!(connection = db_connection_new())
217 || db_connection_set_configuration_list(connection, configuration_list))
218 {
219 db_connection_free(connection);
220 connection = NULL;
221 db_configuration_list_free(configuration_list);
222 configuration_list = NULL;
223 return 1;
224 }
225 configuration_list = NULL;
226
227 if (db_connection_setup(connection)
228 || db_connection_connect(connection))
229 {
230 db_connection_free(connection);
231 connection = NULL;
232 return 1;
233 }
234
235 db_sqlite = 0;
236 db_mysql = 1;
237
238 return 0;
239}
240#endif
241
242static int test_zone_clean_suite(void) {
243 db_connection_free(connection);
244 connection = NULL;
245 db_configuration_free(configuration);
246 configuration = NULL;
247 db_configuration_list_free(configuration_list);
248 configuration_list = NULL;
249 db_value_reset(&id);
250 db_clause_list_free(clause_list);
251 clause_list = NULL;
252 return 0;
253}
254
255static void test_zone_new(void) {
256 CU_ASSERT_PTR_NOT_NULL_FATAL((object = zone_db_new(connection)));
257 CU_ASSERT_PTR_NOT_NULL_FATAL((object_list = zone_list_db_new(connection)));
258}
259
260static void test_zone_set(void) {
262 if (db_sqlite) {
263 CU_ASSERT(!db_value_from_int32(&policy_id, 1));
264 }
265 if (db_mysql) {
266 CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
267 }
268 CU_ASSERT(!zone_db_set_policy_id(object, &policy_id));
269 CU_ASSERT(!zone_db_set_name(object, "name 1"));
270 CU_ASSERT(!zone_db_set_signconf_needs_writing(object, 1));
271 CU_ASSERT(!zone_db_set_signconf_path(object, "signconf_path 1"));
272 CU_ASSERT(!zone_db_set_next_change(object, 1));
273 CU_ASSERT(!zone_db_set_ttl_end_ds(object, 1));
274 CU_ASSERT(!zone_db_set_ttl_end_dk(object, 1));
275 CU_ASSERT(!zone_db_set_ttl_end_rs(object, 1));
276 CU_ASSERT(!zone_db_set_roll_ksk_now(object, 1));
277 CU_ASSERT(!zone_db_set_roll_zsk_now(object, 1));
278 CU_ASSERT(!zone_db_set_roll_csk_now(object, 1));
279 CU_ASSERT(!zone_db_set_input_adapter_type(object, "input_adapter_type 1"));
280 CU_ASSERT(!zone_db_set_input_adapter_uri(object, "input_adapter_uri 1"));
281 CU_ASSERT(!zone_db_set_output_adapter_type(object, "output_adapter_type 1"));
282 CU_ASSERT(!zone_db_set_output_adapter_uri(object, "output_adapter_uri 1"));
283 CU_ASSERT(!zone_db_set_next_ksk_roll(object, 1));
284 CU_ASSERT(!zone_db_set_next_zsk_roll(object, 1));
285 CU_ASSERT(!zone_db_set_next_csk_roll(object, 1));
287}
288
289static void test_zone_get(void) {
290 int ret;
292 if (db_sqlite) {
293 CU_ASSERT(!db_value_from_int32(&policy_id, 1));
294 }
295 if (db_mysql) {
296 CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
297 }
298 CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
299 CU_ASSERT(!ret);
300 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
301 CU_ASSERT(!strcmp(zone_db_name(object), "name 1"));
302 CU_ASSERT(zone_db_signconf_needs_writing(object) == 1);
303 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
304 CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 1"));
305 CU_ASSERT(zone_db_next_change(object) == 1);
306 CU_ASSERT(zone_db_ttl_end_ds(object) == 1);
307 CU_ASSERT(zone_db_ttl_end_dk(object) == 1);
308 CU_ASSERT(zone_db_ttl_end_rs(object) == 1);
309 CU_ASSERT(zone_db_roll_ksk_now(object) == 1);
310 CU_ASSERT(zone_db_roll_zsk_now(object) == 1);
311 CU_ASSERT(zone_db_roll_csk_now(object) == 1);
312 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
313 CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 1"));
314 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
315 CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 1"));
316 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
317 CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 1"));
318 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
319 CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 1"));
320 CU_ASSERT(zone_db_next_ksk_roll(object) == 1);
321 CU_ASSERT(zone_db_next_zsk_roll(object) == 1);
322 CU_ASSERT(zone_db_next_csk_roll(object) == 1);
324}
325
326static void test_zone_create(void) {
327 CU_ASSERT_FATAL(!zone_db_create(object));
328}
329
330static void test_zone_clauses(void) {
331 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
332 CU_ASSERT_PTR_NOT_NULL(zone_db_policy_id_clause(clause_list, zone_db_policy_id(object)));
333 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
334 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
335 db_clause_list_free(clause_list);
336 clause_list = NULL;
337
338 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
339 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
340 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
341 db_clause_list_free(clause_list);
342 clause_list = NULL;
343
344 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
345 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
346 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
347 db_clause_list_free(clause_list);
348 clause_list = NULL;
349
350 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
351 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
352 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
353 db_clause_list_free(clause_list);
354 clause_list = NULL;
355
356 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
357 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
358 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
359 db_clause_list_free(clause_list);
360 clause_list = NULL;
361
362 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
363 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
364 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
365 db_clause_list_free(clause_list);
366 clause_list = NULL;
367
368 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
369 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
370 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
371 db_clause_list_free(clause_list);
372 clause_list = NULL;
373
374 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
375 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
376 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
377 db_clause_list_free(clause_list);
378 clause_list = NULL;
379
380 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
381 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
382 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
383 db_clause_list_free(clause_list);
384 clause_list = NULL;
385
386 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
387 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
388 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
389 db_clause_list_free(clause_list);
390 clause_list = NULL;
391
392 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
393 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
394 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
395 db_clause_list_free(clause_list);
396 clause_list = NULL;
397
398 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
399 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
400 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
401 db_clause_list_free(clause_list);
402 clause_list = NULL;
403
404 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
405 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
406 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
407 db_clause_list_free(clause_list);
408 clause_list = NULL;
409
410 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
411 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
412 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
413 db_clause_list_free(clause_list);
414 clause_list = NULL;
415
416 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
417 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
418 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
419 db_clause_list_free(clause_list);
420 clause_list = NULL;
421
422 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
423 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
424 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
425 db_clause_list_free(clause_list);
426 clause_list = NULL;
427
428 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
429 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
430 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
431 db_clause_list_free(clause_list);
432 clause_list = NULL;
433
434 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
435 CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
436 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
437 db_clause_list_free(clause_list);
438 clause_list = NULL;
439}
440
441static void test_zone_count(void) {
442 size_t count;
443
444 CU_ASSERT(!zone_db_count(object, NULL, &count));
445 CU_ASSERT(count == 1);
446
447 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
448 CU_ASSERT_PTR_NOT_NULL(zone_db_policy_id_clause(clause_list, zone_db_policy_id(object)));
449 CU_ASSERT(!zone_db_count(object, clause_list, &count));
450 CU_ASSERT(count == 1);
451 db_clause_list_free(clause_list);
452 clause_list = NULL;
453
454 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
455 CU_ASSERT(!zone_db_count(object, clause_list, &count));
456 CU_ASSERT(count == 1);
457 db_clause_list_free(clause_list);
458 clause_list = NULL;
459
460 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
461 CU_ASSERT(!zone_db_count(object, clause_list, &count));
462 CU_ASSERT(count == 1);
463 db_clause_list_free(clause_list);
464 clause_list = NULL;
465
466 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
467 CU_ASSERT(!zone_db_count(object, clause_list, &count));
468 CU_ASSERT(count == 1);
469 db_clause_list_free(clause_list);
470 clause_list = NULL;
471
472 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
473 CU_ASSERT(!zone_db_count(object, clause_list, &count));
474 CU_ASSERT(count == 1);
475 db_clause_list_free(clause_list);
476 clause_list = NULL;
477
478 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
479 CU_ASSERT(!zone_db_count(object, clause_list, &count));
480 CU_ASSERT(count == 1);
481 db_clause_list_free(clause_list);
482 clause_list = NULL;
483
484 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
485 CU_ASSERT(!zone_db_count(object, clause_list, &count));
486 CU_ASSERT(count == 1);
487 db_clause_list_free(clause_list);
488 clause_list = NULL;
489
490 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
491 CU_ASSERT(!zone_db_count(object, clause_list, &count));
492 CU_ASSERT(count == 1);
493 db_clause_list_free(clause_list);
494 clause_list = NULL;
495
496 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
497 CU_ASSERT(!zone_db_count(object, clause_list, &count));
498 CU_ASSERT(count == 1);
499 db_clause_list_free(clause_list);
500 clause_list = NULL;
501
502 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
503 CU_ASSERT(!zone_db_count(object, clause_list, &count));
504 CU_ASSERT(count == 1);
505 db_clause_list_free(clause_list);
506 clause_list = NULL;
507
508 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
509 CU_ASSERT(!zone_db_count(object, clause_list, &count));
510 CU_ASSERT(count == 1);
511 db_clause_list_free(clause_list);
512 clause_list = NULL;
513
514 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
515 CU_ASSERT(!zone_db_count(object, clause_list, &count));
516 CU_ASSERT(count == 1);
517 db_clause_list_free(clause_list);
518 clause_list = NULL;
519
520 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
521 CU_ASSERT(!zone_db_count(object, clause_list, &count));
522 CU_ASSERT(count == 1);
523 db_clause_list_free(clause_list);
524 clause_list = NULL;
525
526 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
527 CU_ASSERT(!zone_db_count(object, clause_list, &count));
528 CU_ASSERT(count == 1);
529 db_clause_list_free(clause_list);
530 clause_list = NULL;
531
532 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
533 CU_ASSERT(!zone_db_count(object, clause_list, &count));
534 CU_ASSERT(count == 1);
535 db_clause_list_free(clause_list);
536 clause_list = NULL;
537
538 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
539 CU_ASSERT(!zone_db_count(object, clause_list, &count));
540 CU_ASSERT(count == 1);
541 db_clause_list_free(clause_list);
542 clause_list = NULL;
543
544 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
545 CU_ASSERT(!zone_db_count(object, clause_list, &count));
546 CU_ASSERT(count == 1);
547 db_clause_list_free(clause_list);
548 clause_list = NULL;
549
550 CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
551 CU_ASSERT(!zone_db_count(object, clause_list, &count));
552 CU_ASSERT(count == 1);
553 db_clause_list_free(clause_list);
554 clause_list = NULL;
555}
556
557static void test_zone_list(void) {
558 const zone_db_t* item;
559 zone_db_t* item2;
560 zone_list_db_t* new_list;
561
562 CU_ASSERT_FATAL(!zone_list_db_get(object_list));
563 CU_ASSERT_PTR_NOT_NULL_FATAL((item = zone_list_db_next(object_list)));
564 CU_ASSERT_FATAL(!db_value_copy(&id, zone_db_id(item)));
565 CU_ASSERT_PTR_NOT_NULL_FATAL((item = zone_list_db_begin(object_list)));
566
567 CU_ASSERT_FATAL(!zone_list_db_get(object_list));
568 CU_ASSERT_PTR_NOT_NULL_FATAL((item2 = zone_list_db_get_next(object_list)));
569 zone_db_free(item2);
570 CU_PASS("zone_db_free");
571
572 CU_ASSERT_PTR_NOT_NULL((new_list = zone_list_db_new_get(connection)));
573 CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(new_list));
574 zone_list_db_free(new_list);
575}
576
577static void test_zone_list_store(void) {
578 zone_list_db_t* new_list;
579
580 CU_ASSERT_PTR_NOT_NULL((new_list = zone_list_db_new(connection)));
581 CU_ASSERT_FATAL(!zone_list_db_object_store(new_list));
582 CU_ASSERT_FATAL(!zone_list_db_get(new_list));
583
584 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_list_db_next(new_list));
585 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_list_db_begin(new_list));
586
587 CU_PASS("zone_db_free");
588
589 zone_list_db_free(new_list);
590}
591
592static void test_zone_list_associated(void) {
593 zone_list_db_t* new_list;
594
595 CU_ASSERT_PTR_NOT_NULL((new_list = zone_list_db_new(connection)));
596 CU_ASSERT_FATAL(!zone_list_db_get(new_list));
597
598 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_list_db_next(new_list));
599 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_list_db_begin(new_list));
600
601 CU_PASS("zone_db_free");
602
603 zone_list_db_free(new_list);
604}
605
606static void test_zone_read(void) {
607 CU_ASSERT_FATAL(!zone_db_get_by_id(object, &id));
608}
609
610static void test_zone_verify(void) {
611 int ret;
613 if (db_sqlite) {
614 CU_ASSERT(!db_value_from_int32(&policy_id, 1));
615 }
616 if (db_mysql) {
617 CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
618 }
619 CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
620 CU_ASSERT(!ret);
621 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
622 CU_ASSERT(!strcmp(zone_db_name(object), "name 1"));
623 CU_ASSERT(zone_db_signconf_needs_writing(object) == 1);
624 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
625 CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 1"));
626 CU_ASSERT(zone_db_next_change(object) == 1);
627 CU_ASSERT(zone_db_ttl_end_ds(object) == 1);
628 CU_ASSERT(zone_db_ttl_end_dk(object) == 1);
629 CU_ASSERT(zone_db_ttl_end_rs(object) == 1);
630 CU_ASSERT(zone_db_roll_ksk_now(object) == 1);
631 CU_ASSERT(zone_db_roll_zsk_now(object) == 1);
632 CU_ASSERT(zone_db_roll_csk_now(object) == 1);
633 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
634 CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 1"));
635 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
636 CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 1"));
637 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
638 CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 1"));
639 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
640 CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 1"));
641 CU_ASSERT(zone_db_next_ksk_roll(object) == 1);
642 CU_ASSERT(zone_db_next_zsk_roll(object) == 1);
643 CU_ASSERT(zone_db_next_csk_roll(object) == 1);
645}
646
647static void test_zone_read_by_name(void) {
648 CU_ASSERT_FATAL(!zone_db_get_by_name(object, "name 1"));
649}
650
651static void test_zone_verify_name(void) {
652 int ret;
654 if (db_sqlite) {
655 CU_ASSERT(!db_value_from_int32(&policy_id, 1));
656 }
657 if (db_mysql) {
658 CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
659 }
660 CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
661 CU_ASSERT(!ret);
662 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
663 CU_ASSERT(!strcmp(zone_db_name(object), "name 1"));
664 CU_ASSERT(zone_db_signconf_needs_writing(object) == 1);
665 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
666 CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 1"));
667 CU_ASSERT(zone_db_next_change(object) == 1);
668 CU_ASSERT(zone_db_ttl_end_ds(object) == 1);
669 CU_ASSERT(zone_db_ttl_end_dk(object) == 1);
670 CU_ASSERT(zone_db_ttl_end_rs(object) == 1);
671 CU_ASSERT(zone_db_roll_ksk_now(object) == 1);
672 CU_ASSERT(zone_db_roll_zsk_now(object) == 1);
673 CU_ASSERT(zone_db_roll_csk_now(object) == 1);
674 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
675 CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 1"));
676 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
677 CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 1"));
678 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
679 CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 1"));
680 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
681 CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 1"));
682 CU_ASSERT(zone_db_next_ksk_roll(object) == 1);
683 CU_ASSERT(zone_db_next_zsk_roll(object) == 1);
684 CU_ASSERT(zone_db_next_csk_roll(object) == 1);
686}
687
688static void test_zone_change(void) {
690 if (db_sqlite) {
691 CU_ASSERT(!db_value_from_int32(&policy_id, 1));
692 }
693 if (db_mysql) {
694 CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
695 }
696 CU_ASSERT(!zone_db_set_policy_id(object, &policy_id));
697 CU_ASSERT(!zone_db_set_name(object, "name 2"));
698 CU_ASSERT(!zone_db_set_signconf_needs_writing(object, 2));
699 CU_ASSERT(!zone_db_set_signconf_path(object, "signconf_path 2"));
700 CU_ASSERT(!zone_db_set_next_change(object, 2));
701 CU_ASSERT(!zone_db_set_ttl_end_ds(object, 2));
702 CU_ASSERT(!zone_db_set_ttl_end_dk(object, 2));
703 CU_ASSERT(!zone_db_set_ttl_end_rs(object, 2));
704 CU_ASSERT(!zone_db_set_roll_ksk_now(object, 2));
705 CU_ASSERT(!zone_db_set_roll_zsk_now(object, 2));
706 CU_ASSERT(!zone_db_set_roll_csk_now(object, 2));
707 CU_ASSERT(!zone_db_set_input_adapter_type(object, "input_adapter_type 2"));
708 CU_ASSERT(!zone_db_set_input_adapter_uri(object, "input_adapter_uri 2"));
709 CU_ASSERT(!zone_db_set_output_adapter_type(object, "output_adapter_type 2"));
710 CU_ASSERT(!zone_db_set_output_adapter_uri(object, "output_adapter_uri 2"));
711 CU_ASSERT(!zone_db_set_next_ksk_roll(object, 2));
712 CU_ASSERT(!zone_db_set_next_zsk_roll(object, 2));
713 CU_ASSERT(!zone_db_set_next_csk_roll(object, 2));
715}
716
717static void test_zone_update(void) {
718 CU_ASSERT_FATAL(!zone_db_update(object));
719}
720
721static void test_zone_read2(void) {
722 CU_ASSERT_FATAL(!zone_db_get_by_id(object, &id));
723}
724
725static void test_zone_verify2(void) {
726 int ret;
728 if (db_sqlite) {
729 CU_ASSERT(!db_value_from_int32(&policy_id, 1));
730 }
731 if (db_mysql) {
732 CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
733 }
734 CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
735 CU_ASSERT(!ret);
736 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
737 CU_ASSERT(!strcmp(zone_db_name(object), "name 2"));
738 CU_ASSERT(zone_db_signconf_needs_writing(object) == 2);
739 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
740 CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 2"));
741 CU_ASSERT(zone_db_next_change(object) == 2);
742 CU_ASSERT(zone_db_ttl_end_ds(object) == 2);
743 CU_ASSERT(zone_db_ttl_end_dk(object) == 2);
744 CU_ASSERT(zone_db_ttl_end_rs(object) == 2);
745 CU_ASSERT(zone_db_roll_ksk_now(object) == 2);
746 CU_ASSERT(zone_db_roll_zsk_now(object) == 2);
747 CU_ASSERT(zone_db_roll_csk_now(object) == 2);
748 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
749 CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 2"));
750 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
751 CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 2"));
752 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
753 CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 2"));
754 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
755 CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 2"));
756 CU_ASSERT(zone_db_next_ksk_roll(object) == 2);
757 CU_ASSERT(zone_db_next_zsk_roll(object) == 2);
758 CU_ASSERT(zone_db_next_csk_roll(object) == 2);
760}
761
762static void test_zone_read_by_name2(void) {
763 CU_ASSERT_FATAL(!zone_db_get_by_name(object, "name 2"));
764}
765
766static void test_zone_verify_name2(void) {
767 int ret;
769 if (db_sqlite) {
770 CU_ASSERT(!db_value_from_int32(&policy_id, 1));
771 }
772 if (db_mysql) {
773 CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
774 }
775 CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
776 CU_ASSERT(!ret);
777 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
778 CU_ASSERT(!strcmp(zone_db_name(object), "name 2"));
779 CU_ASSERT(zone_db_signconf_needs_writing(object) == 2);
780 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
781 CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 2"));
782 CU_ASSERT(zone_db_next_change(object) == 2);
783 CU_ASSERT(zone_db_ttl_end_ds(object) == 2);
784 CU_ASSERT(zone_db_ttl_end_dk(object) == 2);
785 CU_ASSERT(zone_db_ttl_end_rs(object) == 2);
786 CU_ASSERT(zone_db_roll_ksk_now(object) == 2);
787 CU_ASSERT(zone_db_roll_zsk_now(object) == 2);
788 CU_ASSERT(zone_db_roll_csk_now(object) == 2);
789 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
790 CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 2"));
791 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
792 CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 2"));
793 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
794 CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 2"));
795 CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
796 CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 2"));
797 CU_ASSERT(zone_db_next_ksk_roll(object) == 2);
798 CU_ASSERT(zone_db_next_zsk_roll(object) == 2);
799 CU_ASSERT(zone_db_next_csk_roll(object) == 2);
801}
802
803static void test_zone_delete(void) {
804 CU_ASSERT_FATAL(!zone_db_delete(object));
805}
806
807static void test_zone_list2(void) {
808 CU_ASSERT_FATAL(!zone_list_db_get(object_list));
809 CU_ASSERT_PTR_NULL(zone_list_db_next(object_list));
810}
811
812static void test_zone_end(void) {
813 if (object) {
814 zone_db_free(object);
815 CU_PASS("zone_db_free");
816 }
817 if (object_list) {
818 zone_list_db_free(object_list);
819 CU_PASS("zone_list_db_free");
820 }
821}
822
823static int test_zone_add_tests(CU_pSuite pSuite) {
824 if (!CU_add_test(pSuite, "new object", test_zone_new)
825 || !CU_add_test(pSuite, "set fields", test_zone_set)
826 || !CU_add_test(pSuite, "get fields", test_zone_get)
827 || !CU_add_test(pSuite, "create object", test_zone_create)
828 || !CU_add_test(pSuite, "object clauses", test_zone_clauses)
829 || !CU_add_test(pSuite, "object count", test_zone_count)
830 || !CU_add_test(pSuite, "list objects", test_zone_list)
831 || !CU_add_test(pSuite, "list objects (store)", test_zone_list_store)
832 || !CU_add_test(pSuite, "list objects (associated)", test_zone_list_associated)
833 || !CU_add_test(pSuite, "read object by id", test_zone_read)
834 || !CU_add_test(pSuite, "verify fields", test_zone_verify)
835 || !CU_add_test(pSuite, "read object by name", test_zone_read_by_name)
836 || !CU_add_test(pSuite, "verify fields (name)", test_zone_verify_name)
837 || !CU_add_test(pSuite, "change object", test_zone_change)
838 || !CU_add_test(pSuite, "update object", test_zone_update)
839 || !CU_add_test(pSuite, "reread object by id", test_zone_read2)
840 || !CU_add_test(pSuite, "verify fields after update", test_zone_verify2)
841 || !CU_add_test(pSuite, "reread object by name", test_zone_read_by_name2)
842 || !CU_add_test(pSuite, "verify fields after update (name)", test_zone_verify_name2)
843 || !CU_add_test(pSuite, "delete object", test_zone_delete)
844 || !CU_add_test(pSuite, "list objects to verify delete", test_zone_list2)
845 || !CU_add_test(pSuite, "end test", test_zone_end))
846 {
847 return CU_get_error();
848 }
849 return 0;
850}
851
853 CU_pSuite pSuite = NULL;
854 int ret;
855
856#if defined(ENFORCER_DATABASE_SQLITE3)
857 pSuite = CU_add_suite("Test of zone (SQLite)", test_zone_init_suite_sqlite, test_zone_clean_suite);
858 if (!pSuite) {
859 return CU_get_error();
860 }
861 ret = test_zone_add_tests(pSuite);
862 if (ret) {
863 return ret;
864 }
865#endif
866#if defined(ENFORCER_DATABASE_MYSQL)
867 pSuite = CU_add_suite("Test of zone (MySQL)", test_zone_init_suite_mysql, test_zone_clean_suite);
868 if (!pSuite) {
869 return CU_get_error();
870 }
871 ret = test_zone_add_tests(pSuite);
872 if (ret) {
873 return ret;
874 }
875#endif
876 return 0;
877}
db_clause_list_t * db_clause_list_new(void)
Definition: db_clause.c:202
void db_clause_list_free(db_clause_list_t *clause_list)
Definition: db_clause.c:209
db_configuration_t * db_configuration_new(void)
db_configuration_list_t * db_configuration_list_new(void)
void db_configuration_free(db_configuration_t *configuration)
int db_configuration_set_name(db_configuration_t *configuration, const char *name)
int db_configuration_list_add(db_configuration_list_t *configuration_list, db_configuration_t *configuration)
int db_configuration_set_value(db_configuration_t *configuration, const char *value)
void db_configuration_list_free(db_configuration_list_t *configuration_list)
int db_connection_connect(const db_connection_t *connection)
Definition: db_connection.c:88
db_connection_t * db_connection_new(void)
Definition: db_connection.c:38
int db_connection_setup(db_connection_t *connection)
Definition: db_connection.c:66
void db_connection_free(db_connection_t *connection)
Definition: db_connection.c:45
int db_connection_set_configuration_list(db_connection_t *connection, const db_configuration_list_t *configuration_list)
Definition: db_connection.c:54
int db_value_from_int32(db_value_t *value, db_type_int32_t from_int32)
Definition: db_value.c:479
int db_value_copy(db_value_t *value, const db_value_t *from_value)
Definition: db_value.c:77
int db_value_cmp(const db_value_t *value_a, const db_value_t *value_b, int *result)
Definition: db_value.c:102
void db_value_reset(db_value_t *value)
Definition: db_value.c:60
int db_value_from_uint64(db_value_t *value, db_type_uint64_t from_uint64)
Definition: db_value.c:518
#define DB_VALUE_EMPTY
Definition: db_value.h:60
const db_value_t * policy_id(const policy_t *policy)
Definition: policy.c:805
int test_zone_add_suite(void)
Definition: test_zone.c:852
zone_list_db_t * zone_list_db_new_get(const db_connection_t *connection)
Definition: zone_db.c:2402
unsigned int zone_db_roll_zsk_now(const zone_db_t *zone)
Definition: zone_db.c:846
int zone_db_set_input_adapter_type(zone_db_t *zone, const char *input_adapter_type_text)
Definition: zone_db.c:1061
int zone_db_set_ttl_end_dk(zone_db_t *zone, unsigned int ttl_end_dk)
Definition: zone_db.c:1011
int zone_list_db_object_store(zone_list_db_t *zone_list)
Definition: zone_db.c:1979
void zone_db_free(zone_db_t *zone)
Definition: zone_db.c:325
int zone_db_set_next_ksk_roll(zone_db_t *zone, unsigned int next_ksk_roll)
Definition: zone_db.c:1149
unsigned int zone_db_ttl_end_rs(const zone_db_t *zone)
Definition: zone_db.c:830
int zone_db_set_signconf_needs_writing(zone_db_t *zone, unsigned int signconf_needs_writing)
Definition: zone_db.c:959
int zone_db_delete(zone_db_t *zone)
Definition: zone_db.c:1884
const char * zone_db_signconf_path(const zone_db_t *zone)
Definition: zone_db.c:798
unsigned int zone_db_ttl_end_ds(const zone_db_t *zone)
Definition: zone_db.c:814
const db_value_t * zone_db_policy_id(const zone_db_t *zone)
Definition: zone_db.c:736
int zone_db_set_output_adapter_type(zone_db_t *zone, const char *output_adapter_type_text)
Definition: zone_db.c:1105
int zone_db_set_roll_zsk_now(zone_db_t *zone, unsigned int roll_zsk_now)
Definition: zone_db.c:1041
int zone_db_set_roll_csk_now(zone_db_t *zone, unsigned int roll_csk_now)
Definition: zone_db.c:1051
int zone_db_set_policy_id(zone_db_t *zone, const db_value_t *policy_id)
Definition: zone_db.c:918
unsigned int zone_db_roll_ksk_now(const zone_db_t *zone)
Definition: zone_db.c:838
const char * zone_db_name(const zone_db_t *zone)
Definition: zone_db.c:782
const zone_db_t * zone_list_db_begin(zone_list_db_t *zone_list)
Definition: zone_db.c:2547
unsigned int zone_db_next_ksk_roll(const zone_db_t *zone)
Definition: zone_db.c:894
zone_db_t * zone_list_db_get_next(zone_list_db_t *zone_list)
Definition: zone_db.c:2669
zone_list_db_t * zone_list_db_new(const db_connection_t *connection)
Definition: zone_db.c:1946
unsigned int zone_db_next_csk_roll(const zone_db_t *zone)
Definition: zone_db.c:910
int zone_db_create(zone_db_t *zone)
Definition: zone_db.c:1206
int zone_list_db_get_by_clauses(zone_list_db_t *zone_list, const db_clause_list_t *clause_list)
Definition: zone_db.c:2419
int zone_db_set_ttl_end_ds(zone_db_t *zone, unsigned int ttl_end_ds)
Definition: zone_db.c:1001
int zone_db_count(zone_db_t *zone, db_clause_list_t *clause_list, size_t *count)
Definition: zone_db.c:1930
int zone_db_set_next_zsk_roll(zone_db_t *zone, unsigned int next_zsk_roll)
Definition: zone_db.c:1159
int zone_db_set_roll_ksk_now(zone_db_t *zone, unsigned int roll_ksk_now)
Definition: zone_db.c:1031
int zone_db_set_next_csk_roll(zone_db_t *zone, unsigned int next_csk_roll)
Definition: zone_db.c:1169
const char * zone_db_input_adapter_uri(const zone_db_t *zone)
Definition: zone_db.c:870
int zone_db_set_signconf_path(zone_db_t *zone, const char *signconf_path_text)
Definition: zone_db.c:969
int zone_db_update(zone_db_t *zone)
Definition: zone_db.c:1589
int zone_db_get_by_id(zone_db_t *zone, const db_value_t *id)
Definition: zone_db.c:1466
int zone_list_db_get(zone_list_db_t *zone_list)
Definition: zone_db.c:2363
unsigned int zone_db_ttl_end_dk(const zone_db_t *zone)
Definition: zone_db.c:822
zone_db_t * zone_db_new(const db_connection_t *connection)
Definition: zone_db.c:287
const db_value_t * zone_db_id(const zone_db_t *zone)
Definition: zone_db.c:728
db_clause_t * zone_db_policy_id_clause(db_clause_list_t *clause_list, const db_value_t *policy_id)
Definition: zone_db.c:1179
int zone_db_set_output_adapter_uri(zone_db_t *zone, const char *output_adapter_uri_text)
Definition: zone_db.c:1127
int zone_db_set_name(zone_db_t *zone, const char *name_text)
Definition: zone_db.c:937
const char * zone_db_output_adapter_type(const zone_db_t *zone)
Definition: zone_db.c:878
unsigned int zone_db_next_zsk_roll(const zone_db_t *zone)
Definition: zone_db.c:902
int zone_db_get_by_name(zone_db_t *zone, const char *name)
Definition: zone_db.c:1519
const char * zone_db_output_adapter_uri(const zone_db_t *zone)
Definition: zone_db.c:886
unsigned int zone_db_signconf_needs_writing(const zone_db_t *zone)
Definition: zone_db.c:790
unsigned int zone_db_roll_csk_now(const zone_db_t *zone)
Definition: zone_db.c:854
int zone_db_set_ttl_end_rs(zone_db_t *zone, unsigned int ttl_end_rs)
Definition: zone_db.c:1021
const zone_db_t * zone_list_db_next(zone_list_db_t *zone_list)
Definition: zone_db.c:2603
int zone_db_next_change(const zone_db_t *zone)
Definition: zone_db.c:806
int zone_db_set_next_change(zone_db_t *zone, int next_change)
Definition: zone_db.c:991
const char * zone_db_input_adapter_type(const zone_db_t *zone)
Definition: zone_db.c:862
void zone_list_db_free(zone_list_db_t *zone_list)
Definition: zone_db.c:1989
int zone_db_set_input_adapter_uri(zone_db_t *zone, const char *input_adapter_uri_text)
Definition: zone_db.c:1083