Skip to content

Commit 3cb3600

Browse files
committed
Adjusted test expectations
Some new rules / nuances for bundles, comments, class guards and blank lines. Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
1 parent 79f7c3c commit 3cb3600

4 files changed

Lines changed: 58 additions & 0 deletions

File tree

tests/format/002_basics.expected.cf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
body common control
44
{
55
inputs => { "/var/cfengine/inputs/some_file.cf" };
6+
67
linux::
78
inputs => { "/var/cfengine/inputs/other_file.cf" };
9+
810
ubuntu::
911
inputs => {};
1012
}

tests/format/005_bundle_comments.expected.cf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,24 @@ bundle agent g
5252
{
5353
# comment
5454
}
55+
56+
# For the library
57+
bundle edit_line fixapache
58+
{
59+
# Comment before promise type
60+
field_edits:
61+
# Comment before promiser
62+
"APACHE_MODULES=.*"
63+
# Comment can be here
64+
# and multiple lines
65+
edit_field => quotedvar("$(add_modules)","append");
66+
67+
# Comment before class guard:
68+
linux::
69+
"APACHE_MODULES=.*"
70+
# Comment can be here
71+
# and multiple lines
72+
edit_field => quotedvar("$(del_modules)","delete");
73+
74+
# Trailing comments are fun!
75+
}

tests/format/005_bundle_comments.input.cf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,24 @@ bundle agent g
5050
{
5151
# comment
5252
}
53+
54+
# For the library
55+
bundle edit_line fixapache
56+
{
57+
# Comment before promise type
58+
field_edits:
59+
# Comment before promiser
60+
"APACHE_MODULES=.*"
61+
# Comment can be here
62+
# and multiple lines
63+
edit_field => quotedvar("$(add_modules)","append");
64+
65+
# Comment before class guard:
66+
linux::
67+
"APACHE_MODULES=.*"
68+
# Comment can be here
69+
# and multiple lines
70+
edit_field => quotedvar("$(del_modules)","delete");
71+
72+
# Trailing comments are fun!
73+
}

tests/format/011_promises.expected.cf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ body common control
6767
"services/main.cf",
6868
};
6969
version => "CFEngine Promises.cf 3.27.0";
70+
7071
# From 3.7 onwards there is a new package promise implementation using package
7172
# modules in which you MUST provide package modules used to generate
7273
# software inventory reports. You can also provide global default package module
@@ -76,50 +77,63 @@ body common control
7677
$(package_module_knowledge.platform_default),
7778
@(default:package_module_knowledge.additional_inventory),
7879
};
80+
7981
# We only define package_inventory on redhat like systems that have a
8082
# python version that works with the package module.
8183
(redhat|centos|suse|sles|opensuse|amazon_linux).cfe_python_for_package_modules_supported.!disable_inventory_package_refresh::
8284
package_inventory => {
8385
$(package_module_knowledge.platform_default),
8486
@(default:package_module_knowledge.additional_inventory),
8587
};
88+
8689
aix.!disable_inventory_package_refresh::
8790
package_inventory => {
8891
$(package_module_knowledge.platform_default),
8992
@(default:package_module_knowledge.additional_inventory),
9093
};
94+
9195
freebsd.!disable_inventory_package_refresh::
9296
package_inventory => {
9397
$(package_module_knowledge.platform_default),
9498
@(default:package_module_knowledge.additional_inventory),
9599
};
100+
96101
aix::
97102
package_module => $(package_module_knowledge.platform_default);
103+
98104
(debian|redhat|suse|sles|opensuse|amazon_linux|freebsd)::
99105
package_module => $(package_module_knowledge.platform_default);
106+
100107
windows::
101108
package_inventory => {
102109
$(package_module_knowledge.platform_default),
103110
@(default:package_module_knowledge.additional_inventory),
104111
};
105112
package_module => $(package_module_knowledge.platform_default);
113+
106114
termux::
107115
package_module => $(package_module_knowledge.platform_default);
116+
108117
alpinelinux::
109118
package_module => $(package_module_knowledge.platform_default);
119+
110120
any::
111121
ignore_missing_bundles => "$(def.control_common_ignore_missing_bundles)";
112122
ignore_missing_inputs => "$(def.control_common_ignore_missing_inputs)";
113123
# The number of minutes after which last-seen entries are purged from cf_lastseen.lmdb
114124
lastseenexpireafter => "$(def.control_common_lastseenexpireafter)";
125+
115126
control_common_tls_min_version_defined::
116127
tls_min_version => "$(default:def.control_common_tls_min_version)";
128+
117129
# See also: allowtlsversion in body server control
118130
control_common_tls_ciphers_defined::
119131
tls_ciphers => "$(default:def.control_common_tls_ciphers)";
132+
120133
# See also: allowciphers in body server control
121134
control_common_system_log_level_defined::
122135
system_log_level => "$(default:def.control_common_system_log_level)";
136+
123137
control_common_protocol_version_defined::
124138
protocol_version => "$(default:def.control_common_protocol_version)";
125139
}

0 commit comments

Comments
 (0)