terule-tests.h File Reference


Detailed Description

Declarations for libapol terule query tests.

Author:
Jeremy A. Mowery jmowery@tresys.com

Jason Tang jtang@tresys.com

Copyright (C) 2007 Tresys Technology, LLC

This library 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.

This library 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 this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file terule-tests.h.

#include <CUnit/CUnit.h>

Go to the source code of this file.


Functions

int terule_init ()
int terule_cleanup ()

Variables

CU_TestInfo terule_tests []

Function Documentation

int terule_init  ) 
 

Definition at line 94 of file terule-tests.c.

References apol_policy_create_from_policy_path(), apol_policy_get_qpol(), apol_policy_path_create(), apol_policy_path_destroy(), apol_policy_path_t, APOL_POLICY_PATH_TYPE_MONOLITHIC, BIN_POLICY, bp, qpol_policy_build_syn_rule_table(), SOURCE_POLICY, and sp.

00095 {
00096         apol_policy_path_t *ppath = apol_policy_path_create(APOL_POLICY_PATH_TYPE_MONOLITHIC, BIN_POLICY, NULL);
00097         if (ppath == NULL) {
00098                 return 1;
00099         }
00100 
00101         if ((bp = apol_policy_create_from_policy_path(ppath, 0, NULL, NULL)) == NULL) {
00102                 apol_policy_path_destroy(&ppath);
00103                 return 1;
00104         }
00105         apol_policy_path_destroy(&ppath);
00106 
00107         ppath = apol_policy_path_create(APOL_POLICY_PATH_TYPE_MONOLITHIC, SOURCE_POLICY, NULL);
00108         if (ppath == NULL) {
00109                 return 1;
00110         }
00111 
00112         if ((sp = apol_policy_create_from_policy_path(ppath, 0, NULL, NULL)) == NULL) {
00113                 apol_policy_path_destroy(&ppath);
00114                 return 1;
00115         }
00116         apol_policy_path_destroy(&ppath);
00117 
00118         if (qpol_policy_build_syn_rule_table(apol_policy_get_qpol(sp)) != 0) {
00119                 return 1;
00120         }
00121 
00122         return 0;
00123 }

int terule_cleanup  ) 
 

Definition at line 125 of file terule-tests.c.

References apol_policy_destroy(), bp, and sp.

00126 {
00127         apol_policy_destroy(&bp);
00128         apol_policy_destroy(&sp);
00129         return 0;
00130 }


Variable Documentation

CU_TestInfo terule_tests[]
 

Definition at line 88 of file terule-tests.c.

Referenced by main().