Skip to content

Commit

Permalink
dsdb: Use ldb_init() to make the ldb_context in dsdb audit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Bartlett <[email protected]>
Reviewed-by: Gary Lockyer <[email protected]>

Autobuild-User(master): Andrew Bartlett <[email protected]>
Autobuild-Date(master): Sat Jun  9 17:42:38 CEST 2018 on sn-devel-144
  • Loading branch information
abartlet committed Jun 9, 2018
1 parent 1b07f13 commit 81f7ecc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
32 changes: 16 additions & 16 deletions source4/dsdb/samdb/ldb_modules/tests/test_audit_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void test_has_password_changed(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

/*
* Empty message
Expand Down Expand Up @@ -196,7 +196,7 @@ static void test_get_password_action(void **state)
struct dsdb_control_password_acl_validation *pav = NULL;

TALLOC_CTX *ctx = talloc_new(NULL);
ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

/*
* Add request, will always be a reset
Expand Down Expand Up @@ -292,7 +292,7 @@ static void test_operation_json_empty(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
ac = talloc_zero(ctx, struct audit_context);

module = talloc_zero(ctx, struct ldb_module);
Expand Down Expand Up @@ -423,7 +423,7 @@ static void test_operation_json(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

ac = talloc_zero(ctx, struct audit_context);
GUID_from_string(TRANSACTION, &transaction_id);
Expand Down Expand Up @@ -618,7 +618,7 @@ static void test_as_system_operation_json(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

ac = talloc_zero(ctx, struct audit_context);
GUID_from_string(TRANSACTION, &transaction_id);
Expand Down Expand Up @@ -793,7 +793,7 @@ static void test_password_change_json_empty(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
ac = talloc_zero(ctx, struct audit_context);

module = talloc_zero(ctx, struct ldb_module);
Expand Down Expand Up @@ -892,7 +892,7 @@ static void test_password_change_json(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

ac = talloc_zero(ctx, struct audit_context);
GUID_from_string(TRANSACTION, &transaction_id);
Expand Down Expand Up @@ -1151,7 +1151,7 @@ static void test_replicated_update_json_empty(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
ac = talloc_zero(ctx, struct audit_context);

module = talloc_zero(ctx, struct ldb_module);
Expand Down Expand Up @@ -1287,7 +1287,7 @@ static void test_replicated_update_json(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

ac = talloc_zero(ctx, struct audit_context);
GUID_from_string(TRANSACTION, &transaction_id);
Expand Down Expand Up @@ -1419,7 +1419,7 @@ static void test_operation_hr_empty(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
ac = talloc_zero(ctx, struct audit_context);

module = talloc_zero(ctx, struct ldb_module);
Expand Down Expand Up @@ -1491,7 +1491,7 @@ static void test_operation_hr(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

ac = talloc_zero(ctx, struct audit_context);
GUID_from_string(TRANSACTION, &transaction_id);
Expand Down Expand Up @@ -1593,7 +1593,7 @@ static void test_as_system_operation_hr(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

ac = talloc_zero(ctx, struct audit_context);
GUID_from_string(TRANSACTION, &transaction_id);
Expand Down Expand Up @@ -1680,7 +1680,7 @@ static void test_password_change_hr_empty(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
ac = talloc_zero(ctx, struct audit_context);

module = talloc_zero(ctx, struct ldb_module);
Expand Down Expand Up @@ -1749,7 +1749,7 @@ static void test_password_change_hr(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

ac = talloc_zero(ctx, struct audit_context);
GUID_from_string(TRANSACTION, &transaction_id);
Expand Down Expand Up @@ -2081,7 +2081,7 @@ static void test_replicated_update_hr_empty(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
ac = talloc_zero(ctx, struct audit_context);

module = talloc_zero(ctx, struct ldb_module);
Expand Down Expand Up @@ -2155,7 +2155,7 @@ static void test_replicated_update_hr(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

ac = talloc_zero(ctx, struct audit_context);
GUID_from_string(TRANSACTION, &transaction_id);
Expand Down
20 changes: 10 additions & 10 deletions source4/dsdb/samdb/ldb_modules/tests/test_audit_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static void test_dsdb_audit_get_remote_address(void **state)
* Test a freshly initialized ldb
* should return NULL
*/
ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
ts = dsdb_audit_get_remote_address(ldb);
assert_null(ts);

Expand Down Expand Up @@ -503,7 +503,7 @@ static void test_dsdb_audit_get_ldb_error_string(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
module = talloc_zero(ctx, struct ldb_module);
module->ldb = ldb;

Expand Down Expand Up @@ -543,7 +543,7 @@ static void test_dsdb_audit_get_user_sid(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
module = talloc_zero(ctx, struct ldb_module);
module->ldb = ldb;

Expand Down Expand Up @@ -624,7 +624,7 @@ static void test_dsdb_audit_get_actual_sid(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

/*
* Freshly initialised structures, will be no session data
Expand Down Expand Up @@ -703,7 +703,7 @@ static void test_dsdb_audit_is_system_session(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
module = talloc_zero(ctx, struct ldb_module);
module->ldb = ldb;

Expand Down Expand Up @@ -791,7 +791,7 @@ static void test_dsdb_audit_get_unique_session_token(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
module = talloc_zero(ctx, struct ldb_module);
module->ldb = ldb;

Expand Down Expand Up @@ -849,7 +849,7 @@ static void test_dsdb_audit_get_actual_unique_session_token(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

/*
* Test a freshly initialized ldb
Expand Down Expand Up @@ -900,7 +900,7 @@ static void test_dsdb_audit_get_remote_host(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

/*
* Test a freshly initialized ldb
Expand Down Expand Up @@ -946,7 +946,7 @@ static void test_dsdb_audit_get_primary_dn(void **state)

req = talloc_zero(ctx, struct ldb_request);
msg = talloc_zero(ctx, struct ldb_message);
ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
dn = ldb_dn_new(ctx, ldb, DN);

/*
Expand Down Expand Up @@ -1112,7 +1112,7 @@ static void test_dsdb_audit_get_secondary_dn(void **state)
TALLOC_CTX *ctx = talloc_new(NULL);

req = talloc_zero(ctx, struct ldb_request);
ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);
dn = ldb_dn_new(ctx, ldb, DN);

/*
Expand Down
4 changes: 2 additions & 2 deletions source4/dsdb/samdb/ldb_modules/tests/test_group_audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static void test_audit_group_hr(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

GUID_from_string(TRANSACTION, &transaction_id);

Expand Down Expand Up @@ -627,7 +627,7 @@ static void test_audit_group_json(void **state)

TALLOC_CTX *ctx = talloc_new(NULL);

ldb = talloc_zero(ctx, struct ldb_context);
ldb = ldb_init(ctx, NULL);

GUID_from_string(TRANSACTION, &transaction_id);

Expand Down

0 comments on commit 81f7ecc

Please sign in to comment.