s4/test-libnet: Helper func to initialize libnet_context
authorKamen Mazdrashki <kamenim@samba.org>
Thu, 10 Jun 2010 10:12:08 +0000 (13:12 +0300)
committerKamen Mazdrashki <kamenim@samba.org>
Thu, 10 Jun 2010 22:20:09 +0000 (01:20 +0300)
commiteda49261205471a1e0c96ae4e1eda037edb11eba
treef0272ba5805abb7d9d43435a434c0802c615bc58
parent85d7863b2c2420bd652d73ab4ec230f709acae73
s4/test-libnet: Helper func to initialize libnet_context

and create rpc connections to SAMR and LSA pipes.
This function should be used in cases where we need
'deterministic' connection to the DC we are testing against.

The problem is that most of the test follow the pattern:
1. Connect to server supplied on command line
2. Create user/group through connection in 1.
3. Use 'fresh' libnet_context to query/alter the object in
   step 2.

In singe-DC environment this work well. But in multiple-DC
environment libnet may connect to another DC (step 3), not
the one we use in step 1 and 2. This leads to false error -
object created in step 2 is not found on DC we are querying
in step 3.
source4/torture/libnet/utils.c