1# Based on 00_basics/ifelapsed_and_expireafter/timed/package_lock.cf
2
3body common control
4{
5    inputs => { "../default.cf.sub" };
6    bundlesequence => { default("$(this.promise_filename)") };
7}
8
9bundle agent init
10{
11  files:
12      "$(sys.workdir)/modules/packages/."
13        create => "true";
14      "$(sys.workdir)/modules/packages/test_module"
15        copy_from => local_cp("$(this.promise_filename).module");
16}
17
18body package_module test_module
19{
20    query_installed_ifelapsed => "60";
21    query_updates_ifelapsed => "14400";
22    default_options => { "$(G.testfile)" };
23    interpreter => "/bin/sh";   # NOTE: no hashbang in the test_module script
24}
25
26bundle agent test
27{
28  meta:
29      "description"
30        string => "Test that the interpreter for the package module script can be set",
31        meta => { "CFE-2880" };
32
33  packages:
34      "first_pkg"
35        policy => "present",
36        package_module => test_module;
37      "second_pkg"
38        policy => "present",
39        package_module => test_module;
40}
41
42bundle agent check
43{
44  methods:
45      "any" usebundle => dcs_check_diff($(G.testfile),
46                                        "$(this.promise_filename).expected",
47                                        $(this.promise_filename));
48}
49