Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #19411: Add new methods tests #1300

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
f740034
Fixes #18243: Add solaris package support to ncf
peckpeck Sep 22, 2020
910ca1d
Fixes #18313: implement nim package manager
ncharles Oct 12, 2020
96ea54b
Update tree/20_cfe_basics/packages.cf
ncharles Oct 12, 2020
1ca245f
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Oct 13, 2020
208b443
Fixes #18349: User/Group of user technique files should be rudder:rudder
fanf Oct 20, 2020
492956e
Fixes #18369: Broken ncf doc build
amousset Oct 20, 2020
b521f49
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Oct 21, 2020
ef8d84c
Fixes #18433: Do not fix component key in generic methods reporting
peckpeck Oct 27, 2020
b8460e9
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Oct 31, 2020
fa92761
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Oct 31, 2020
c33d322
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Oct 31, 2020
f728255
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Oct 31, 2020
f1e4ed9
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Oct 31, 2020
ec7de7a
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 1, 2020
82d40b6
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 2, 2020
bef0a7a
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 9, 2020
16dd24c
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 13, 2020
fa585e3
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 13, 2020
a6ee49f
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 16, 2020
6608f07
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 16, 2020
c9ad0a5
Fixes #18600: Augeas methods should prefer the agent provided binary
peckpeck Nov 17, 2020
6d642be
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 18, 2020
149d7fe
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 18, 2020
53b21dc
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 18, 2020
9d071d7
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 19, 2020
1ce13b8
Fixes #18646: Fix the augeas path
Fdall Nov 20, 2020
70a70c6
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 27, 2020
fcea06a
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 27, 2020
4165692
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 30, 2020
34107ec
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Nov 30, 2020
ee599ce
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Dec 15, 2020
2cc6b7d
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Dec 16, 2020
abd6262
Fixes #18741: Add solaris specific paths
Fdall Dec 7, 2020
c044c4e
Fixes #18776: Typos in parent ticket
Fdall Dec 22, 2020
3007a8c
Fixes #18797: head bash command path should be taken from the ncf_pat…
Fdall Jan 4, 2021
435b24c
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Jan 14, 2021
2639a4c
Fixes #18439: homogenize class parameters names and descriptions for …
Oct 28, 2020
546c794
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Feb 16, 2021
6371bf5
Merge branch 'branches/rudder/6.2'
Feb 16, 2021
80df727
Fixes #18924: file_check_block_devices test does not work on debian b…
Fdall Feb 18, 2021
37437b6
Merge branch 'branches/rudder/6.2'
Feb 18, 2021
ce06638
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Feb 19, 2021
350d226
Merge branch 'branches/rudder/6.2'
Feb 19, 2021
8da57a8
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Feb 25, 2021
d762b53
Merge branch 'branches/rudder/6.2'
Feb 25, 2021
5a99180
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Feb 25, 2021
0c41125
Merge branch 'branches/rudder/6.2'
Feb 25, 2021
1c712ce
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Mar 18, 2021
c60c54f
Merge branch 'branches/rudder/6.2'
Mar 18, 2021
c09f7be
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Apr 2, 2021
743dfe6
Merge branch 'branches/rudder/6.2'
Apr 2, 2021
e81d12f
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
May 1, 2021
896be60
Merge branch 'branches/rudder/6.2'
May 1, 2021
0ed441a
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
May 6, 2021
c9f8f6f
Merge branch 'branches/rudder/6.2'
May 6, 2021
36dac5b
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
May 10, 2021
a04b8aa
Merge branch 'branches/rudder/6.2'
May 10, 2021
c4ee20f
Fixes #19260: Improve augeas methods documentation and audit mode
amousset May 12, 2021
f01f38f
Merge branch 'branches/rudder/6.2'
May 18, 2021
8507290
Fixes #19274: Fail report on kept when no file is provided
amousset May 19, 2021
4d2191e
Merge branch 'branches/rudder/6.2'
May 19, 2021
3757b3e
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Jun 3, 2021
8251bf2
Merge branch 'branches/rudder/6.2'
Jun 3, 2021
5d0482b
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Jun 3, 2021
61ebd28
Merge branch 'branches/rudder/6.2'
Jun 3, 2021
fdd9ce3
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Jun 8, 2021
671621b
Merge branch 'branches/rudder/6.2'
Jun 8, 2021
4b740ad
Merge branch 'branches/rudder/6.1' into branches/rudder/6.2
Jun 8, 2021
f2d20e9
Merge branch 'branches/rudder/6.2'
Jun 8, 2021
b13e742
Fixes #19411: Add new methods tests
Fdall Jun 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ncf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import os
import sys
import shutil
import json
import grp
from pprint import pprint

DEFAULT_NCF_DIR = '/usr/share/ncf'

NCF_DIR = os.path.dirname(os.path.realpath(__file__))
NCF_TREE_DIR = os.path.join(NCF_DIR, 'tree')
NCF_TOOLS_DIR = os.path.join(NCF_DIR, 'tools')
GROUP_OWNER = 'rudder'

sys.path[0:0] = [NCF_TOOLS_DIR, DEFAULT_NCF_DIR]

Expand Down Expand Up @@ -63,10 +65,13 @@ def write_all_methods(path):
methods = ncf.get_all_generic_methods_metadata()

methodsFile = '/var/rudder/configuration-repository/ncf/generic_methods.json'
gid = grp.getgrnam(GROUP_OWNER)[2]
if not os.path.exists(os.path.dirname(methodsFile)):
os.makedirs(os.path.dirname(methodsFile))
os.chown(os.path.dirname(methodsFile), -1, gid)
with open(methodsFile, 'w') as outfile:
json.dump(methods["data"]["generic_methods"], outfile, indent=2)
os.chown(methodsFile, -1, gid)

def write_all_techniques(path, migrate_old):
techniques = ncf.get_all_techniques_metadata(True,migrate_old)
Expand All @@ -77,8 +82,8 @@ def write_all_techniques(path, migrate_old):
techniqueFile = '/var/rudder/configuration-repository/techniques/'+category+"/"+ bundle_name +"/"+version+'/technique.json'
if not os.path.exists(techniqueFile):
with open('/var/rudder/configuration-repository/techniques/'+category+"/"+ bundle_name +"/"+version+'/technique.json', 'w') as outfile:
json.dump(technique, outfile, indent=2)

json.dump(technique, outfile, indent=2)
os.chown(techniqueFile, -1, grp.getgrnam(GROUP_OWNER)[2])


def usage():
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/30_generic_methods/command_execution.cf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bundle agent init
vars:
"tmp" string => getenv("TEMP", 1024);

"command[1]" string => "/bin/date | egrep '[0-9]'";
"command[1]" string => "/bin/date | ${paths.path[egrep]} '[0-9]'";
"result[1]" string => "repaired";

"command[2]" string => "/bin/false";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
#######################################################
#
# Read a file into a string
# Currently in staging since the method does not behave
# as intended. The fix need to deprecate this one and
# develop a new one. Until then, the test will be set
# to staging.
#
#######################################################

bundle common acc_path
{
vars:
Expand All @@ -28,40 +18,32 @@ bundle agent init
vars:
"tmp" string => getenv("TEMP", 1024);

"file[0]" string => "${tmp}/etc/hosts0";
"value[0]" string => "127.0.0.1";
"lens[0]" string => "Hosts";
"path[0]" string => "/etc/hosts/1/ipaddr";
"file[0]" string => "${tmp}/etc/sshd_config0";
"value[0]" string => "yes";
"lens[0]" string => "Sshd";
"path[0]" string => "${tmp}/etc/sshd_config0/PermitRootLogin";
"status[0]" string => "success";
"mode[0]" string => "enforce";

"file[1]" string => "${tmp}/etc/hosts1";
"value[1]" string => "127.0.0.1";
"lens[1]" string => "";
"path[1]" string => "/etc/hosts/1/ipaddr";
"status[1]" string => "error";
"file[1]" string => "${tmp}/etc/sshd_config1";
"value[1]" string => "no";
"lens[1]" string => "Sshd";
"path[1]" string => "${tmp}/etc/sshd_config1/PermitRootLogin";
"status[1]" string => "repaired";
"mode[1]" string => "enforce";

#file is null but the lens should be enough for augeas
"file[2]" string => "";
"value[2]" string => "127.0.0.1";
"lens[2]" string => "Hosts";
"path[2]" string => "/etc/hosts/1/ipaddr";
"file[2]" string => "${tmp}/etc/sshd_config1";
"value[2]" string => "yes";
"lens[2]" string => "Sshd";
"path[2]" string => "${tmp}/etc/sshd_config1/StrictModes";
"status[2]" string => "success";
"mode[2]" string => "enforce";

"file[3]" string => "${tmp}/etc/hosts3";
"value[3]" string => "0.1.2.3";
"lens[3]" string => "Hosts";
"path[3]" string => "/etc/hosts/1/ipaddr";
"status[3]" string => "repaired";
"mode[3]" string => "enforce";

"indices" slist => getindices("file");

files:
"${tmp}/etc/hosts${indices}"
copy_from => local_cp("/etc/hosts");
"${tmp}/etc/sshd_config${indices}"
copy_from => local_cp("${this.promise_dirname}/file_augeas_set.sshd_config_yes");
}

#######################################################
Expand All @@ -75,18 +57,20 @@ bundle agent test
"ph0" usebundle => apply_gm("file_augeas_set", @{args0}, "${init.status[0]}", "ph0", "${init.mode[0]}");
"ph1" usebundle => apply_gm("file_augeas_set", @{args1}, "${init.status[1]}", "ph1", "${init.mode[1]}");
"ph2" usebundle => apply_gm("file_augeas_set", @{args2}, "${init.status[2]}", "ph2", "${init.mode[2]}");
"ph3" usebundle => apply_gm("file_augeas_set", @{args3}, "${init.status[3]}", "ph3", "${init.mode[3]}");
}

#######################################################

bundle agent check
{
classes:
"classes_ok" expression => "ph0_ok.ph1_ok.ph2_ok";
classes_ok::
"content_0" expression => returnszero("diff ${init.file[0]} ${this.promise_dirname}/file_augeas_set.sshd_config_yes 2>/dev/null", "useshell");
"content_1" expression => returnszero("diff ${init.file[1]} ${this.promise_dirname}/file_augeas_set.sshd_config_no 2>/dev/null", "useshell");
"content_ok" expression => "content_0.content_1";

"classes_ok" expression => "ph0_ok.ph1_ok.ph2_ok.ph3_ok";

"ok" expression => "classes_ok";
"ok" expression => "classes_ok.content_ok";

reports:
ok::
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Authentication:

#LoginGraceTime 2m
PermitRootLogin no
StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Authentication:

#LoginGraceTime 2m
PermitRootLogin yes
StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
20 changes: 16 additions & 4 deletions tests/acceptance/30_generic_methods/file_check_block_device.cf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#########################################
#
# Test checking if a block device or not
#
# Test checking if a block device or not
#
#########################################

bundle common acc_path
Expand Down Expand Up @@ -30,14 +30,26 @@ bundle agent init
"block_device_canon" string => canonify("${block_device}");

"file_list" slist => { "${file}", "${block_device}" };
solaris::
"mknod" string => "/usr/sbin/mknod";
debian::
"mknod" string => "/bin/mknod";
!solaris.!debian::
"mknod" string => "/usr/bin/mknod";

files:
"${file}"
create => "true";

commands:
"/bin/mknod"
args => "-m 640 \"${block_device}\" b 7 0"; # /dev/loop0
"${mknod}"
args => "\"${block_device}\" b 7 0", # /dev/loop0
if => "solaris";

"${mknod}"
args => "-m 640 \"${block_device}\" b 7 0", # /dev/loop0
if => "!solaris";

}

#######################################################
Expand Down
9 changes: 5 additions & 4 deletions tests/acceptance/30_generic_methods/file_content.cf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bundle agent init
{
vars:
"tmp" string => getenv("TEMP", 1024);

"file_1" string => "${tmp}/test_1";
"file_1_canon" string => canonify("${file_1}");
"file_2" string => "${tmp}/test_2";
Expand Down Expand Up @@ -73,10 +74,10 @@ bundle agent test
bundle agent check
{
vars:
"line_1_present_exists_test" string => "/bin/grep -E \"^${init.line_present}$\" \"${init.file_1}\"";
"line_1_added_exists_test" string => "/bin/grep -E \"^${init.line_to_add}$\" \"${init.file_1}\"";
"line_2_present_exists_test" string => "/bin/grep -E \"^${init.line_present}$\" \"${init.file_2}\"";
"line_2_added_exists_test" string => "/bin/grep -E \"^${init.line_to_add}$\" \"${init.file_2}\"";
"line_1_present_exists_test" string => "${paths.path[grep]} -E \"^${init.line_present}$\" \"${init.file_1}\"";
"line_1_added_exists_test" string => "${paths.path[grep]} -E \"^${init.line_to_add}$\" \"${init.file_1}\"";
"line_2_present_exists_test" string => "${paths.path[grep]} -E \"^${init.line_present}$\" \"${init.file_2}\"";
"line_2_added_exists_test" string => "${paths.path[grep]} -E \"^${init.line_to_add}$\" \"${init.file_2}\"";
"file_3_test" string => "/usr/bin/diff \"${init.ref_3}\" \"${init.file_3}\"";

classes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ bundle agent init
"${source_file}"
edit_line => insert_lines("test file"),
create => "true";

"${destination_file_3}"
edit_line => insert_lines("test file"),
create => "true";
Expand All @@ -50,7 +51,7 @@ bundle agent test
"ph1" usebundle => file_from_local_source_with_check("${init.source_file}", "${init.destination_file_1}", "/bin/true", "0");
"ph2" usebundle => file_from_local_source_with_check("${init.source_file}", "${init.destination_file_2}", "/bin/false", "0");
"ph3" usebundle => file_from_local_source_with_check("${init.source_file}", "${init.destination_file_3}", "/bin/false", "0");
"ph4" usebundle => file_from_local_source_with_check("${init.source_file}", "${init.destination_file_4}", "/bin/false", "1");
"ph4" usebundle => file_from_local_source_with_check("${init.source_file}", "${init.destination_file_4}", "exit 1", "1");
}

#######################################################
Expand Down Expand Up @@ -78,7 +79,7 @@ bundle agent check
"ok_3" expression => "file_3.content_3.file_from_local_source_with_check_${init.destination_file_canon_3}_kept";
"ok_4" expression => "file_4.content_4.file_from_local_source_with_check_${init.destination_file_canon_4}_repaired.!file_from_local_source_with_check_${init.destination_file_canon_4}_error";
"ok" expression => "ok_1.ok_2.ok_3.ok_4";

reports:
ok::
"$(this.promise_filename) Pass";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ bundle agent test
bundle agent check
{
vars:
"file_length_check_1" string => "/usr/bin/test `/bin/cat ${init.destination_file_1} | wc -l` = '1'";
"file_content_check_1" string => "/bin/cat ${init.destination_file_1} | head -n1 | grep '^sys.host is: ${sys.host}$'";
"file_length_check_1" string => "${paths.path[test]} `${paths.path[cat]} ${init.destination_file_1} | wc -l` = '1'";
"file_content_check_1" string => "${paths.path[cat]} ${init.destination_file_1} | ${ncf_paths.path[head]} -n1 | ${paths.path[grep]} '^sys.host is: ${sys.host}$'";

classes:
# By default, should create the file if it doesn't exist
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/30_generic_methods/file_from_template.cf
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ bundle agent test
bundle agent check
{
vars:
"file_length_check" string => "/usr/bin/test `/bin/cat ${init.destination_file} | wc -l` = '1'";
"file_content_check" string => "/bin/cat ${init.destination_file} | head -n1 | grep '^sys.host is: ${sys.host}$'";
"file_length_check" string => "${paths.path[test]} `${paths.path[cat]} ${init.destination_file} | wc -l` = '1'";
"file_content_check" string => "${paths.path[cat]} ${init.destination_file} | ${ncf_paths.path[head]} -n1 | ${paths.path[grep]} '^sys.host is: ${sys.host}$'";

classes:
# By default, should create the file if it doesn't exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ bundle agent test
bundle agent check
{
vars:
"file_length_check" string => "/usr/bin/test `/bin/cat ${init.destination_file} | wc -l` = '1'";
"file_content_check" string => "/bin/cat ${init.destination_file} | head -n1 | grep '^sys.host is: ${sys.host}$'";
"file_length_check" string => "${paths.path[test]} `${paths.path[cat]} ${init.destination_file} | wc -l` = '1'";
"file_content_check" string => "${paths.path[cat]} ${init.destination_file} | ${ncf_paths.path[head]} -n1 | ${paths.path[grep]} '^sys.host is: ${sys.host}$'";

classes:
# By default, should create the file if it doesn't exist
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/30_generic_methods/file_lines_absent.cf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bundle agent test
bundle agent check
{
vars:
"line_exists_test" string => "/bin/grep -E \"^${init.line_to_test}$\" \"${init.file}\"";
"line_exists_test" string => "${paths.path[grep]} -E \"^${init.line_to_test}$\" \"${init.file}\"";

classes:
"file_exists" expression => fileexists("${init.file}");
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/30_generic_methods/file_lines_present.cf
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ bundle agent test
bundle agent check
{
vars:
"line_exists_test" string => "/bin/grep -E \"^${init.line_to_add}$\" \"${init.file}\"";
"line_exists_test" string => "${paths.path[grep]} -E \"^${init.line_to_add}$\" \"${init.file}\"";

classes:
# By default, file_lines_present should create the file if it doesn't exist
"file_exists" expression => fileexists("${init.file}");
"line_exists"
"line_exists"
expression => returnszero("${line_exists_test}", "noshell"),
ifvarclass => canonify("file_lines_present_${init.file}_reached");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ bundle agent test
bundle agent check
{
vars:
"line_exists_test" string => "/usr/bin/test `/bin/grep \"^${init.line_to_add}$\" \"${init.file}\" | wc -l` = '1'";
"line_exists_test" string => "${paths.path[test]} `${paths.path[grep]} \"^${init.line_to_add}$\" \"${init.file}\" | wc -l` = '1'";

classes:
# By default, file_lines_present should create the file if it doesn't exist
"file_exists" expression => fileexists("${init.file}");

"line_exists" expression => returnszero("${line_exists_test}", "useshell"),
ifvarclass => canonify("file_lines_present_${init.file}_reached");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bundle agent test
bundle agent check
{
vars:
"line_exists_test" string => "/bin/grep -E \"^${init.line_to_test}$\" \"${init.file}\"";
"line_exists_test" string => "${paths.path[grep]} -E \"^${init.line_to_test}$\" \"${init.file}\"";

classes:
"file_exists" expression => fileexists("${init.file}");
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/30_generic_methods/file_replace_lines.cf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bundle agent test
bundle agent check
{
vars:
"line_exists_test" string => "/bin/grep -E \"^${init.line_for_replacement}$\" \"${init.file}\"";
"line_exists_test" string => "${paths.path[grep]} -E \"^${init.line_for_replacement}$\" \"${init.file}\"";

classes:
# By default, file_replace_lines should create the file if it doesn't exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ bundle agent result(id, result)
#######################################################

bundle agent check
{
{
classes:
"ok_1" expression => strcmp("${init.file_1_expected}", "${result.file_1}");
"ok_1_class" expression => "file_report_content_head_${init.file_1_canon}_kept.!file_report_content_head_${init.file_1_canon}_error";
Expand All @@ -103,7 +103,15 @@ bundle agent check
"ok" expression => "ok_1.ok_2.ok_1_class.ok_2_class.ok_3_class.ok_4_class";

reports:
"'${result.file_1}'";
"'${result.file_1}'";
!ok_1::
"Issue in 1";
!ok_2::
"Issue in 2";
!ok_3::
"Issue in 3";
!ok_4::
"Issue in 4";
ok::
"$(this.promise_filename) Pass";
!ok::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bundle agent test
bundle agent check
{
vars:
"command_ps" string => "/bin/ps afux | /bin/grep ${init.service_name} | /bin/grep -v grep";
"command_ps" string => "/bin/ps afux | ${paths.path[grep]} ${init.service_name} | ${paths.path[grep]} -v grep";

classes:
"service_running" expression => returnszero("${command_ps}", "useshell"),
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/30_generic_methods/unsafe/user_create.cf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bundle agent check
{
vars:
pass1::
"user_line" string => execresult("/bin/grep '^${init.user}:' /etc/passwd", "useshell");
"user_line" string => execresult("${paths.path[grep]} '^${init.user}:' /etc/passwd", "useshell");

classes:
pass1::
Expand All @@ -53,7 +53,7 @@ bundle agent check
"ph1_ok" expression => "!user_create_${init.user}_kept.user_create_${init.user}_repaired.!user_create_${init.user}_error";

"ok" expression => "user1_ok.ph1_ok";

any::
"pass1" expression => "any";

Expand Down
Loading