1#######################################################
2
3body common control
4{
5      inputs => { "../default.cf.sub" };
6      bundlesequence  => { default("$(this.promise_filename)") };
7      version => "1.0";
8}
9
10#######################################################
11
12body agent control
13{
14  # (?!) should always fail to match. It is the zero-width negative
15  # look-ahead. If what is in the parentheses matches then the whole
16  # match fails. Given that it has nothing in it, it will fail the
17  # match for anything (including nothing).
18
19  files_single_copy => { "(?!)" };
20}
21
22bundle agent init
23{
24  vars:
25    "copy_files" slist => { "one", "two" };
26
27   files:
28    "$(G.testdir)/$(copy_files)"
29      create => "true",
30      edit_line => insert_lines("$(copy_files)");
31}
32
33bundle agent test
34{
35  meta:
36      "description" string => "Test that files_single_copy does not prevent file patterns that do not match from being copied multiple times.";
37
38      "test_soft_fail"
39        string => "any",
40        meta => { "CFE-2459" };
41
42  files:
43
44    # Here we iterate over each copy_file to promise the content
45    # of the testfile. We expect that with files_single_copy in
46    # effect only the first file should be copied.
47
48    "$(G.testfile)"
49      copy_from => local_dcp( "$(G.testdir)/$(init.copy_files)" );
50}
51
52#######################################################
53
54bundle agent check
55{
56
57  methods:
58    "" usebundle => dcs_check_diff($(G.testfile), "$(G.testdir)/two", $(this.promise_filename));
59}
60