s3-pdbtest: Initialise more elements for testing
authorAndrew Bartlett <abartlet@samba.org>
Wed, 27 Jun 2012 04:36:31 +0000 (14:36 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 27 Jun 2012 09:29:17 +0000 (11:29 +0200)
If these were left as defaults, they cause issues when the backend (pdb_samba4)
returns the internal defaults from the directory, not the defaults from samu_new()

Andrew Bartlett

source3/torture/pdbtest.c

index aad66bc0c85d524f249c96bbdd78988fc88deff7..c4c6bb687167efa0c2349db89501ab0ab87e451d 100644 (file)
@@ -390,6 +390,8 @@ int main(int argc, char **argv)
        pdb_set_homedir(out, "\\\\torture\\home", PDB_SET);
        pdb_set_logon_script(out, "torture_script.cmd", PDB_SET);
 
+       pdb_set_acct_ctrl(out, ACB_NORMAL, PDB_SET);
+
        pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &history);
        if (history * PW_HISTORY_ENTRY_LEN < NT_HASH_LEN) {
                buf = (uint8 *)TALLOC(ctx, NT_HASH_LEN);
@@ -423,6 +425,12 @@ int main(int argc, char **argv)
                pdb_set_pass_can_change_time(out, time(NULL)+min_age, PDB_SET);
        }
 
+       pdb_set_logon_time(out, time(NULL)-3600, PDB_SET);
+
+       pdb_set_logoff_time(out, time(NULL), PDB_SET);
+
+       pdb_set_kickoff_time(out, time(NULL)+3600, PDB_SET);
+
        /* Create account */
        if (!NT_STATUS_IS_OK(rv = pdb->add_sam_account(pdb, out))) {
                fprintf(stderr, "Error in add_sam_account: %s\n",