/*
Authors:
Yassir Elley <yelley@redhat.com>
Copyright (C) 2014 Red Hat
SSSD tests: GPO unit tests
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <talloc.h>
#include <tevent.h>
#include <errno.h>
#include <popt.h>
#include <unistd.h>
#include <ifaddrs.h>
/* In order to access opaque types */
#include "tests/cmocka/common_mock.h"
struct ad_gpo_test_ctx {
};
{
struct ad_gpo_test_ctx);
return 0;
}
{
return 0;
}
struct som_list_result {
const int result;
const int num_soms;
const char **som_dns;
};
/*
* Test parsing target dn into som components
*/
struct som_list_result *expected)
{
int i;
int num_soms;
&num_soms,
&som_list);
goto done;
}
bool equal = true;
equal = false;
}
assert_int_equal(equal, true);
}
if (som_list) {
}
done:
}
{
"OU=Sales OU,DC=foo,DC=com",
"DC=foo,DC=com"};
.num_soms = 3,
};
test_populate_som_list("CN=F21-Client,OU=West OU,OU=Sales OU,DC=foo,DC=com",
&expected);
}
{
};
}
struct gplink_list_result {
const int result;
const int num_gplinks;
const char **gpo_dns;
bool *enforced;
};
/*
* Test parsing raw_gplink_value into gplink components
*/
bool allow_enforced_only,
struct gplink_list_result *expected)
{
int i;
NULL,
goto done;
}
for (i=0; i<expected->num_gplinks; i++){
bool equal = true;
equal = false;
}
equal = false;
assert_int_equal(equal, true);
}
if (gplink_list) {
}
done:
}
{
bool enforced[] = {false, true};
.num_gplinks = 2,
};
test_populate_gplink_list("[OU=Sales,DC=FOO,DC=COM;0][DC=FOO,DC=COM;2]",
false,
&expected);
}
{
bool enforced[] = {false};
.num_gplinks = 1,
};
test_populate_gplink_list("[OU=Sales,DC=FOO,DC=COM;0][DC=ignored;1]",
false,
&expected);
}
{
bool enforced[] = {true};
.num_gplinks = 1,
};
test_populate_gplink_list("[OU=Sales,DC=FOO,DC=COM;0][DC=FOO,DC=COM;2]",
true,
&expected);
}
{
};
/* the GPLinkOptions value (after semicolon) must be between 0 and 3 */
}
/*
* Test sid-matching logic
*/
const char **group_sids,
int group_size,
struct dom_sid ace_dom_sid,
bool expected)
{
bool includes_client_sid;
&idmap_ctx);
}
{
/* ace_dom_sid represents "S-1-5-21-2-3-4" */
"S-1-5-21-2-3-5"};
ace_dom_sid, true);
}
{
/* ace_dom_sid represents "S-1-5-21-2-3-4" */
"S-1-5-21-2-3-6"};
ace_dom_sid, false);
}
{
int opt;
};
};
/* Set debug level to invalid value so we can deside if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
}