Lines Matching defs:rules

190     struct hbac_rule **rules;
206 /* Create the rules to evaluate against */
207 rules = talloc_array(test_ctx, struct hbac_rule *, 2);
208 fail_if (rules == NULL);
210 get_allow_all_rule(rules, &rules[0]);
211 rules[0]->name = talloc_strdup(rules[0], "Allow All");
212 fail_if(rules[0]->name == NULL);
213 rules[1] = NULL;
216 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
220 /* Evaluate the rules */
221 result = hbac_evaluate(rules, eval_req, &info);
238 struct hbac_rule **rules;
254 /* Create the rules to evaluate against */
255 rules = talloc_array(test_ctx, struct hbac_rule *, 2);
256 fail_if (rules == NULL);
258 get_allow_all_rule(rules, &rules[0]);
261 rules[0]->name = talloc_strdup(rules[0], "Allow user");
262 fail_if(rules[0]->name == NULL);
263 rules[0]->users->category = HBAC_CATEGORY_NULL;
265 rules[0]->users->names = talloc_array(rules[0], const char *, 2);
266 fail_if(rules[0]->users->names == NULL);
268 rules[0]->users->names[0] = HBAC_TEST_USER;
269 rules[0]->users->names[1] = NULL;
271 rules[1] = NULL;
274 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
278 /* Evaluate the rules */
279 result = hbac_evaluate(rules, eval_req, &info);
290 rules[0]->users->names[0] = HBAC_TEST_INVALID_USER;
293 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
297 /* Evaluate the rules */
298 result = hbac_evaluate(rules, eval_req, &info);
316 struct hbac_rule **rules;
337 /* Create the rules to evaluate against */
338 rules = talloc_array(test_ctx, struct hbac_rule *, 2);
339 fail_if (rules == NULL);
341 get_allow_all_rule(rules, &rules[0]);
343 rules[0]->name = talloc_strdup(rules[0], "Allow user");
344 fail_if(rules[0]->name == NULL);
345 rules[0]->users->category = HBAC_CATEGORY_NULL;
348 rules[0]->users->names = talloc_array(rules[0], const char *, 2);
349 fail_if(rules[0]->users->names == NULL);
351 rules[0]->users->names[0] = (const char *) &user_utf8_upcase;
352 rules[0]->users->names[1] = NULL;
355 rules[0]->services->category = HBAC_CATEGORY_NULL;
357 rules[0]->services->names = talloc_array(rules[0], const char *, 2);
358 fail_if(rules[0]->services->names == NULL);
360 rules[0]->services->names[0] = (const char *) &service_utf8_upcase;
361 rules[0]->services->names[1] = NULL;
364 rules[0]->srchosts->category = HBAC_CATEGORY_NULL;
366 rules[0]->srchosts->names = talloc_array(rules[0], const char *, 2);
367 fail_if(rules[0]->services->names == NULL);
369 rules[0]->srchosts->names[0] = (const char *) &srchost_utf8_upcase;
370 rules[0]->srchosts->names[1] = NULL;
372 rules[1] = NULL;
375 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
379 /* Evaluate the rules */
380 result = hbac_evaluate(rules, eval_req, &info);
392 rules[0]->users->names[0] = (const char *) &user_utf8_lowcase_neg;
394 /* Evaluate the rules */
395 result = hbac_evaluate(rules, eval_req, &info);
408 rules[0]->users->names[0] = (const char *) &user_upcase_tr;
411 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
415 /* Evaluate the rules */
416 result = hbac_evaluate(rules, eval_req, &info);
434 struct hbac_rule **rules;
450 /* Create the rules to evaluate against */
451 rules = talloc_array(test_ctx, struct hbac_rule *, 2);
452 fail_if (rules == NULL);
454 get_allow_all_rule(rules, &rules[0]);
457 rules[0]->name = talloc_strdup(rules[0], "Allow group");
458 fail_if(rules[0]->name == NULL);
459 rules[0]->users->category = HBAC_CATEGORY_NULL;
461 rules[0]->users->names = NULL;
462 rules[0]->users->groups = talloc_array(rules[0], const char *, 2);
463 fail_if(rules[0]->users->groups == NULL);
465 rules[0]->users->groups[0] = HBAC_TEST_GROUP1;
466 rules[0]->users->groups[1] = NULL;
468 rules[1] = NULL;
471 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
475 /* Evaluate the rules */
476 result = hbac_evaluate(rules, eval_req, &info);
487 rules[0]->users->groups[0] = HBAC_TEST_INVALID_GROUP;
490 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
494 /* Evaluate the rules */
495 result = hbac_evaluate(rules, eval_req, &info);
513 struct hbac_rule **rules;
529 /* Create the rules to evaluate against */
530 rules = talloc_array(test_ctx, struct hbac_rule *, 2);
531 fail_if (rules == NULL);
533 get_allow_all_rule(rules, &rules[0]);
536 rules[0]->name = talloc_strdup(rules[0], "Allow service");
537 fail_if(rules[0]->name == NULL);
538 rules[0]->services->category = HBAC_CATEGORY_NULL;
540 rules[0]->services->names = talloc_array(rules[0], const char *, 2);
541 fail_if(rules[0]->services->names == NULL);
543 rules[0]->services->names[0] = HBAC_TEST_SERVICE;
544 rules[0]->services->names[1] = NULL;
546 rules[1] = NULL;
549 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
553 /* Evaluate the rules */
554 result = hbac_evaluate(rules, eval_req, &info);
565 rules[0]->services->names[0] = HBAC_TEST_INVALID_SERVICE;
568 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
572 /* Evaluate the rules */
573 result = hbac_evaluate(rules, eval_req, &info);
591 struct hbac_rule **rules;
607 /* Create the rules to evaluate against */
608 rules = talloc_array(test_ctx, struct hbac_rule *, 2);
609 fail_if (rules == NULL);
611 get_allow_all_rule(rules, &rules[0]);
614 rules[0]->name = talloc_strdup(rules[0], "Allow servicegroup");
615 fail_if(rules[0]->name == NULL);
616 rules[0]->services->category = HBAC_CATEGORY_NULL;
618 rules[0]->services->names = NULL;
619 rules[0]->services->groups = talloc_array(rules[0], const char *, 2);
620 fail_if(rules[0]->services->groups == NULL);
622 rules[0]->services->groups[0] = HBAC_TEST_SERVICEGROUP1;
623 rules[0]->services->groups[1] = NULL;
625 rules[1] = NULL;
628 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
632 /* Evaluate the rules */
633 result = hbac_evaluate(rules, eval_req, &info);
644 rules[0]->services->groups[0] = HBAC_TEST_INVALID_SERVICEGROUP;
647 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
651 /* Evaluate the rules */
652 result = hbac_evaluate(rules, eval_req, &info);
670 struct hbac_rule **rules;
686 /* Create the rules to evaluate against */
687 rules = talloc_array(test_ctx, struct hbac_rule *, 2);
688 fail_if (rules == NULL);
690 get_allow_all_rule(rules, &rules[0]);
693 rules[0]->name = talloc_strdup(rules[0], "Allow srchost");
694 fail_if(rules[0]->name == NULL);
695 rules[0]->srchosts->category = HBAC_CATEGORY_NULL;
697 rules[0]->srchosts->names = talloc_array(rules[0], const char *, 2);
698 fail_if(rules[0]->srchosts->names == NULL);
700 rules[0]->srchosts->names[0] = HBAC_TEST_SRCHOST;
701 rules[0]->srchosts->names[1] = NULL;
703 rules[1] = NULL;
706 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
710 /* Evaluate the rules */
711 result = hbac_evaluate(rules, eval_req, &info);
722 rules[0]->srchosts->names[0] = HBAC_TEST_INVALID_SRCHOST;
725 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
729 /* Evaluate the rules */
730 result = hbac_evaluate(rules, eval_req, &info);
748 struct hbac_rule **rules;
764 /* Create the rules to evaluate against */
765 rules = talloc_array(test_ctx, struct hbac_rule *, 2);
766 fail_if (rules == NULL);
768 get_allow_all_rule(rules, &rules[0]);
771 rules[0]->name = talloc_strdup(rules[0], "Allow srchostgroup");
772 fail_if(rules[0]->name == NULL);
773 rules[0]->srchosts->category = HBAC_CATEGORY_NULL;
775 rules[0]->srchosts->names = NULL;
776 rules[0]->srchosts->groups = talloc_array(rules[0], const char *, 2);
777 fail_if(rules[0]->srchosts->groups == NULL);
779 rules[0]->srchosts->groups[0] = HBAC_TEST_SRCHOSTGROUP1;
780 rules[0]->srchosts->groups[1] = NULL;
782 rules[1] = NULL;
785 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
789 /* Evaluate the rules */
790 result = hbac_evaluate(rules, eval_req, &info);
801 rules[0]->srchosts->groups[0] = HBAC_TEST_INVALID_SRCHOSTGROUP;
804 is_valid = hbac_rule_is_complete(rules[0], &missing_attrs);
808 /* Evaluate the rules */
809 result = hbac_evaluate(rules, eval_req, &info);