1bundle common test_meta
2{
3  vars:
4      "description" string => "A user present has the password unchanged when password format is unspecified";
5      "story_id" string => "5525";
6      "covers" string => "operational_kept";
7}
8
9#######################################################
10
11body common control
12{
13      inputs => { "../../default.cf.sub", "user_queries.cf.sub" };
14      bundlesequence  => { default("$(this.promise_filename)") };
15}
16
17#######################################################
18
19bundle common hpux_trusted
20{
21  classes:
22      "hpux_trusted_mode_test"
23        expression => regcmp(".*hpux_trusted.*", $(this.promise_filename));
24}
25
26bundle agent init
27{
28  meta:
29      "test_skip_unsupported" string => "hpux_trusted_mode_test.!hpux";
30
31  vars:
32    # "j0hnd0e"
33    "hash" string => "dTloMVpjYt1w2";
34
35  users:
36    "johndoe"
37      policy => "present",
38      password => init_password;
39}
40
41body password init_password
42{
43  !windows::
44    format => "hash";
45    data => "$(init.hash)";
46  windows::
47    format => "plaintext";
48    data => "Old0P4SSW0RD";
49}
50
51#######################################################
52
53bundle agent test
54{
55  users:
56    "johndoe"
57      policy => "present",
58      password => test_password;
59}
60
61body password test_password
62{
63  data => "New0P4SSW0RD";
64}
65
66#######################################################
67
68bundle agent check
69{
70  methods:
71    # Make sure it is the same as before.
72    !windows::
73      "any" usebundle => user_has_password_hash("johndoe", "$(init.hash)", "success", "failure"),
74        classes => always("methods_run");
75    windows::
76      "any" usebundle => user_has_password("johndoe", "Old0P4SSW0RD", "success", "failure"),
77        classes => always("methods_run");
78
79  classes:
80      "ready" expression => "methods_run";
81      "ok" and => { "success", "!failure" };
82
83  reports:
84    ok.ready::
85      "$(this.promise_filename) Pass";
86    !ok.ready::
87      "$(this.promise_filename) FAIL";
88}
89