1#
2# Test matching packages with explicit default architecture set and no
3# architecture in list of installed packages. Should work similar to the case
4# there are no architectures at all.
5#
6# List of installed packages contains a single package with no architecture
7# specified.
8#
9
10body common control
11{
12      inputs => { "../default.cf.sub" };
13      bundlesequence => { default("$(this.promise_filename)") };
14      version => "1.0";
15}
16
17bundle agent init
18{
19  vars:
20      "dummy" string => "dummy";
21}
22
23bundle agent test
24{
25  packages:
26
27      #
28      # Test that package is matched by a promise with no package_architectures
29      # constraint, as it means "any architecture"
30      #
31
32      "foobar"
33      package_version => "1",
34      package_policy => "addupdate",
35      package_method => mock,
36      classes => kept("ok_1");
37
38      #
39      # Test that specifying proper architecture explicitly matches the package.
40      #
41
42      "foobar"
43      package_version => "1",
44      package_architectures => { "setun" },
45      package_policy => "addupdate",
46      package_method => mock,
47      classes => kept("ok_2");
48
49      #
50      # Test that specifying wrong architecture explicitly does not match the package.
51      #
52
53      "foobar"
54      package_version => "1",
55      package_architectures => { "aldan" },
56      package_policy => "addupdate",
57      package_method => mock,
58      classes => fail("ok_3");
59}
60
61body package_method mock
62{
63      package_changes => "individual";
64
65      package_default_arch_command => "$(G.printf) 'setun'";
66
67      package_list_command => "$(G.printf) 'foobar-1'";
68      package_list_name_regex => "^([^-]+)";
69      package_list_version_regex => "^[^-]+-([\S+])";
70
71      package_installed_regex => ".*";
72
73      package_add_command => "$(G.false)";
74      package_update_command => "$(G.false)";
75      package_delete_command => "$(G.false)";
76      package_verify_command => "$(G.false)";
77}
78
79body classes kept(classname)
80{
81      promise_kept => { "$(classname)" };
82}
83
84body classes fail(classname)
85{
86      repair_failed => { "$(classname)" };
87}
88
89bundle agent check
90{
91  classes:
92      "ok" and => { "ok_1", "ok_2", "ok_3" };
93
94  reports:
95    ok::
96      "$(this.promise_filename) Pass";
97    !ok::
98      "$(this.promise_filename) FAIL";
99}
100### PROJECT_ID: core
101### CATEGORY_ID: 29
102