mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
s4-torture: verify #8373 and add ndr nbt tests for LOGON_PRIMARY_QUERY nbt_netlogon_requests.
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Tue May 29 15:49:10 CEST 2012 on sn-devel-104
This commit is contained in:
parent
9102ccf648
commit
c17f981745
@ -102,3 +102,4 @@ bench # don't run benchmarks in our selftest
|
||||
^samba4.drs.delete_object.python # flakey test
|
||||
^samba4.rpc.unixinfo # This contains a server-side getpwuid call which hangs the server when nss_winbindd is in use
|
||||
^samba.tests.dcerpc.unix # This contains a server-side getpwuid call which hangs the server when nss_winbindd is in use
|
||||
^samba.*.local.ndr.nbt_netlogon_packet # until bug #8373 is fixed
|
||||
|
@ -2,7 +2,7 @@
|
||||
Unix SMB/CIFS implementation.
|
||||
test suite for nbt ndr operations
|
||||
|
||||
Copyright (C) Guenther Deschner 2010,2011
|
||||
Copyright (C) Guenther Deschner 2010-2012
|
||||
|
||||
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
|
||||
@ -136,12 +136,42 @@ static bool nbt_netlogon_packet_check(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static const uint8_t nbt_netlogon_packet_logon_primary_query_data[] = {
|
||||
0x07, 0x00, 0x58, 0x50, 0x44, 0x41, 0x54, 0x45, 0x56, 0x2d, 0x50, 0x52,
|
||||
0x4f, 0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, 0x4f, 0x54, 0x5c,
|
||||
0x4e, 0x45, 0x54, 0x5c, 0x47, 0x45, 0x54, 0x44, 0x43, 0x38, 0x31, 0x37,
|
||||
0x00, 0x00, 0x58, 0x00, 0x50, 0x00, 0x44, 0x00, 0x41, 0x00, 0x54, 0x00,
|
||||
0x45, 0x00, 0x56, 0x00, 0x2d, 0x00, 0x50, 0x00, 0x52, 0x00, 0x4f, 0x00,
|
||||
0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
static bool nbt_netlogon_packet_logon_primary_query_check(struct torture_context *tctx,
|
||||
struct nbt_netlogon_packet *r)
|
||||
{
|
||||
torture_assert_int_equal(tctx, r->command, LOGON_PRIMARY_QUERY, "command");
|
||||
torture_assert_str_equal(tctx, r->req.pdc.computer_name, "XPDATEV-PRO", "computer_name");
|
||||
torture_assert_str_equal(tctx, r->req.pdc.mailslot_name, "\\MAILSLOT\\NET\\GETDC817", "mailslot_name");
|
||||
torture_assert_int_equal(tctx, r->req.pdc._pad.length, 1, "_pad.length");
|
||||
torture_assert_int_equal(tctx, r->req.pdc._pad.data[0], 0, "_pad.data");
|
||||
torture_assert_str_equal(tctx, r->req.pdc.unicode_name, "XPDATEV-PRO", "unicode_name");
|
||||
torture_assert_int_equal(tctx, r->req.pdc.nt_version, 0x0000000b, "nt_version");
|
||||
torture_assert_int_equal(tctx, r->req.pdc.lmnt_token, 0xffff, "lmnt_token");
|
||||
torture_assert_int_equal(tctx, r->req.pdc.lm20_token, 0xffff, "lm20_token");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct torture_suite *ndr_nbt_suite(TALLOC_CTX *ctx)
|
||||
{
|
||||
struct torture_suite *suite = torture_suite_create(ctx, "nbt");
|
||||
|
||||
torture_suite_add_ndr_pull_test(suite, nbt_netlogon_packet, netlogon_logon_request_req_data, netlogon_logon_request_req_check);
|
||||
|
||||
torture_suite_add_ndr_pull_test(suite,
|
||||
nbt_netlogon_packet,
|
||||
nbt_netlogon_packet_logon_primary_query_data,
|
||||
nbt_netlogon_packet_logon_primary_query_check);
|
||||
|
||||
torture_suite_add_ndr_pull_test(suite, nbt_netlogon_response2, netlogon_logon_request_resp_data, netlogon_logon_request_resp_check);
|
||||
|
||||
torture_suite_add_ndr_pull_test(suite,
|
||||
@ -159,5 +189,10 @@ struct torture_suite *ndr_nbt_suite(TALLOC_CTX *ctx)
|
||||
data_blob_const(nbt_netlogon_packet_data, sizeof(nbt_netlogon_packet_data)),
|
||||
nbt_netlogon_packet_check);
|
||||
|
||||
torture_suite_add_ndr_pullpush_test(suite,
|
||||
nbt_netlogon_packet,
|
||||
data_blob_const(nbt_netlogon_packet_logon_primary_query_data, sizeof(nbt_netlogon_packet_logon_primary_query_data)),
|
||||
nbt_netlogon_packet_logon_primary_query_check);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user