Changeset 988 for vendor/current/source4/param/tests
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source4/param/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/param/tests/loadparm.c
r740 r988 22 22 #include "param/param.h" 23 23 #include "torture/torture.h" 24 #include "torture/local/proto.h" 25 #include "libds/common/roles.h" 24 26 25 27 static bool test_create(struct torture_context *tctx) … … 143 145 struct loadparm_service *service = lpcfg_add_service(lp_ctx, lpcfg_default_service(lp_ctx), "foo"); 144 146 torture_assert(tctx, service == lpcfg_service(lp_ctx, "foo"), "invalid service"); 147 return true; 148 } 149 150 static bool test_server_role_default(struct torture_context *tctx) 151 { 152 struct loadparm_context *lp_ctx = loadparm_init(tctx); 153 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_STANDALONE, "ROLE should be standalone by default"); 154 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_USER, "security should be user"); 155 return true; 156 } 157 158 static bool test_server_role_dc_specified(struct torture_context *tctx) 159 { 160 struct loadparm_context *lp_ctx = loadparm_init(tctx); 161 torture_assert(tctx, lpcfg_set_option(lp_ctx, "server role=domain controller"), "lpcfg_set_option failed"); 162 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_ACTIVE_DIRECTORY_DC, "ROLE should be DC"); 163 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_USER, "security should be USER"); 164 return true; 165 } 166 167 static bool test_server_role_member_specified(struct torture_context *tctx) 168 { 169 struct loadparm_context *lp_ctx = loadparm_init(tctx); 170 torture_assert(tctx, lpcfg_set_option(lp_ctx, "server role=member"), "lpcfg_set_option failed"); 171 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_MEMBER, "ROLE should be member"); 172 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_ADS, "security should be ADS"); 173 return true; 174 } 175 176 static bool test_server_role_member_specified2(struct torture_context *tctx) 177 { 178 struct loadparm_context *lp_ctx = loadparm_init(tctx); 179 torture_assert(tctx, lpcfg_set_option(lp_ctx, "server role=member"), "lpcfg_set_option failed"); 180 torture_assert(tctx, lpcfg_set_option(lp_ctx, "security=domain"), "lpcfg_set_option failed"); 181 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_MEMBER, "ROLE should be member"); 182 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_DOMAIN, "security should be domain"); 183 return true; 184 } 185 186 static bool test_server_role_member_specified3(struct torture_context *tctx) 187 { 188 struct loadparm_context *lp_ctx = loadparm_init(tctx); 189 torture_assert(tctx, lpcfg_set_option(lp_ctx, "server role=member"), "lpcfg_set_option failed"); 190 torture_assert(tctx, lpcfg_set_option(lp_ctx, "security=ads"), "lpcfg_set_option failed"); 191 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_MEMBER, "ROLE should be member"); 192 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_ADS, "security should be ads"); 193 return true; 194 } 195 196 static bool test_server_role_standalone_specified(struct torture_context *tctx) 197 { 198 struct loadparm_context *lp_ctx = loadparm_init(tctx); 199 torture_assert(tctx, lpcfg_set_option(lp_ctx, "server role=standalone"), "lpcfg_set_option failed"); 200 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_STANDALONE, "ROLE should be standalone"); 201 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_USER, "security should be USER"); 202 return true; 203 } 204 205 static bool test_server_role_dc_domain_logons(struct torture_context *tctx) 206 { 207 struct loadparm_context *lp_ctx = loadparm_init(tctx); 208 torture_assert(tctx, lpcfg_set_option(lp_ctx, "domain logons=true"), "lpcfg_set_option failed"); 209 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_PDC, "ROLE should be PDC"); 210 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_USER, "security should be user"); 211 return true; 212 } 213 214 static bool test_server_role_dc_domain_logons_and_not_master(struct torture_context *tctx) 215 { 216 struct loadparm_context *lp_ctx = loadparm_init(tctx); 217 torture_assert(tctx, lpcfg_set_option(lp_ctx, "domain logons=true"), "lpcfg_set_option failed"); 218 torture_assert(tctx, lpcfg_set_option(lp_ctx, "domain master=false"), "lpcfg_set_option failed"); 219 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_BDC, "ROLE should be BDC"); 220 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_USER, "security should be user"); 221 return true; 222 } 223 224 static bool test_server_role_security_ads(struct torture_context *tctx) 225 { 226 struct loadparm_context *lp_ctx = loadparm_init(tctx); 227 torture_assert(tctx, lpcfg_set_option(lp_ctx, "security=ads"), "lpcfg_set_option failed"); 228 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_MEMBER, "ROLE should be MEMBER"); 229 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_ADS, "security should be ads"); 230 return true; 231 } 232 233 static bool test_server_role_security_domain(struct torture_context *tctx) 234 { 235 struct loadparm_context *lp_ctx = loadparm_init(tctx); 236 torture_assert(tctx, lpcfg_set_option(lp_ctx, "security=domain"), "lpcfg_set_option failed"); 237 torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_MEMBER, "ROLE should be MEMBER"); 238 torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_DOMAIN, "security should be domain"); 145 239 return true; 146 240 } … … 163 257 torture_suite_add_simple_test(suite, "do_global_parameter_var", test_do_global_parameter_var); 164 258 torture_suite_add_simple_test(suite, "do_global_parameter", test_do_global_parameter); 259 torture_suite_add_simple_test(suite, "test_server_role_default", test_server_role_default); 260 torture_suite_add_simple_test(suite, "test_server_role_dc_specified", test_server_role_dc_specified); 261 torture_suite_add_simple_test(suite, "test_server_role_member_specified", test_server_role_member_specified); 262 torture_suite_add_simple_test(suite, "test_server_role_member_specified2", test_server_role_member_specified2); 263 torture_suite_add_simple_test(suite, "test_server_role_member_specified3", test_server_role_member_specified3); 264 torture_suite_add_simple_test(suite, "test_server_role_standalone_specified", test_server_role_standalone_specified); 265 torture_suite_add_simple_test(suite, "test_server_role_dc_domain_logons", test_server_role_dc_domain_logons); 266 torture_suite_add_simple_test(suite, "test_server_role_dc_domain_logons_and_not_master", test_server_role_dc_domain_logons_and_not_master); 267 torture_suite_add_simple_test(suite, "test_server_role_security_ads", test_server_role_security_ads); 268 torture_suite_add_simple_test(suite, "test_server_role_security_domain", test_server_role_security_domain); 165 269 166 270 return suite; -
vendor/current/source4/param/tests/share.c
r740 r988 24 24 #include "param/param.h" 25 25 #include "torture/torture.h" 26 #include "torture/local/proto.h" 26 27 27 28 static bool test_list_empty(struct torture_context *tctx,
Note:
See TracChangeset
for help on using the changeset viewer.