2004-12-31 13:49:35 +03:00
/*
Unix SMB / CIFS implementation .
test suite for dssetup rpc operations
Copyright ( C ) Andrew Tridgell 2004
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2004-12-31 13:49:35 +03:00
( 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
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2004-12-31 13:49:35 +03:00
*/
# include "includes.h"
2006-03-15 02:35:30 +03:00
# include "librpc/gen_ndr/ndr_dssetup_c.h"
2010-04-14 00:06:51 +04:00
# include "torture/rpc/torture_rpc.h"
2004-12-31 13:49:35 +03:00
2007-09-02 21:27:40 +04:00
bool test_DsRoleGetPrimaryDomainInformation_ext ( struct torture_context * tctx ,
struct dcerpc_pipe * p ,
NTSTATUS ext_status )
2004-12-31 13:49:35 +03:00
{
2005-01-02 19:11:59 +03:00
struct dssetup_DsRoleGetPrimaryDomainInformation r ;
2004-12-31 13:49:35 +03:00
NTSTATUS status ;
2005-01-01 04:32:01 +03:00
int i ;
2010-03-17 14:06:05 +03:00
struct dcerpc_binding_handle * b = p - > binding_handle ;
2004-12-31 13:49:35 +03:00
2005-01-02 19:11:59 +03:00
for ( i = DS_ROLE_BASIC_INFORMATION ; i < = DS_ROLE_OP_STATUS ; i + + ) {
2005-01-01 04:32:01 +03:00
r . in . level = i ;
2007-09-02 07:14:32 +04:00
torture_comment ( tctx , " dcerpc_dssetup_DsRoleGetPrimaryDomainInformation level %d \n " , i ) ;
2004-12-31 13:49:35 +03:00
2010-03-17 14:06:05 +03:00
status = dcerpc_dssetup_DsRoleGetPrimaryDomainInformation_r ( b , tctx , & r ) ;
2007-09-02 21:27:40 +04:00
torture_assert_ntstatus_equal ( tctx , ext_status , status , " DsRoleGetPrimaryDomainInformation failed " ) ;
if ( NT_STATUS_IS_OK ( ext_status ) ) {
torture_assert_werr_ok ( tctx , r . out . result , " DsRoleGetPrimaryDomainInformation failed " ) ;
}
2004-12-31 13:49:35 +03:00
}
2007-09-02 07:14:32 +04:00
return true ;
2004-12-31 13:49:35 +03:00
}
2007-09-02 21:27:40 +04:00
bool test_DsRoleGetPrimaryDomainInformation ( struct torture_context * tctx ,
struct dcerpc_pipe * p )
{
return test_DsRoleGetPrimaryDomainInformation_ext ( tctx , p , NT_STATUS_OK ) ;
}
2007-09-02 07:14:32 +04:00
struct torture_suite * torture_rpc_dssetup ( TALLOC_CTX * mem_ctx )
2004-12-31 13:49:35 +03:00
{
2010-12-11 05:26:31 +03:00
struct torture_suite * suite = torture_suite_create ( mem_ctx , " dssetup " ) ;
2007-09-02 07:14:32 +04:00
struct torture_rpc_tcase * tcase = torture_suite_add_rpc_iface_tcase ( suite , " dssetup " , & ndr_table_dssetup ) ;
2004-12-31 13:49:35 +03:00
2007-09-02 07:14:32 +04:00
torture_rpc_tcase_add_test ( tcase , " DsRoleGetPrimaryDomainInformation " , test_DsRoleGetPrimaryDomainInformation ) ;
2004-12-31 13:49:35 +03:00
2007-09-02 07:14:32 +04:00
return suite ;
2004-12-31 13:49:35 +03:00
}