10 #include "include/config.h"
11 #include "librpc/gen_ndr/ndr_samr.h"
12 #include "source3/rpc_server/srv_pipe.h"
13 #include "librpc/gen_ndr/srv_samr.h"
15 static int setup_samr(void **state
)
22 static int teardown(void **state
)
24 unsetenv("UNITTEST_DUMMY_MODULE_LOADED");
29 static int teardown_samr(void **state
)
38 static void test_is_known_pipename(void **state
)
40 struct ndr_syntax_id syntax_id
= ndr_table_samr
.syntax_id
;
43 is_pipename_ok
= is_known_pipename("samr", &syntax_id
);
44 assert_true(is_pipename_ok
);
47 static void test_is_known_pipename_slash(void **state
)
49 struct ndr_syntax_id syntax_id
= ndr_table_samr
.syntax_id
;
51 char dummy_module_path
[4096] = {0};
52 const char *module_env
;
54 snprintf(dummy_module_path
,
55 sizeof(dummy_module_path
),
56 "%s/bin/modules/rpc/test_dummy_module.so",
59 is_pipename_ok
= is_known_pipename(dummy_module_path
, &syntax_id
);
60 assert_false(is_pipename_ok
);
62 module_env
= getenv("UNITTEST_DUMMY_MODULE_LOADED");
63 assert_null(module_env
);
67 const struct CMUnitTest tests
[] = {
68 cmocka_unit_test_setup_teardown(test_is_known_pipename
,
71 cmocka_unit_test_teardown(test_is_known_pipename_slash
,
75 cmocka_set_message_output(CM_OUTPUT_SUBUNIT
);
76 return cmocka_run_group_tests(tests
, NULL
, NULL
);