Skip to content

Commit 313724e

Browse files
committed
Test that fsattrs validation is not skipped with content attribute
Added acceptance test to test that fsattrs validation is not skipped when combining it with the content attribute. Ticket: CFE-4569 Signed-off-by: Lars Erik Wik <[email protected]>
1 parent 3cda000 commit 313724e

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
##############################################################################
2+
#
3+
# Test that fsattrs validation is not skipped when combining it with the
4+
# content attribute (see CFE-4569).
5+
#
6+
##############################################################################
7+
8+
body common control
9+
{
10+
inputs => { "../../default.cf.sub" };
11+
bundlesequence => { default("$(this.promise_filename)") };
12+
version => "1.0";
13+
}
14+
15+
bundle agent global
16+
{
17+
vars:
18+
"testfile"
19+
string => "/tmp/13_immutable.txt";
20+
}
21+
22+
body fsattrs immutable(value)
23+
{
24+
immutable => "$(value)";
25+
}
26+
27+
bundle agent init
28+
{
29+
files:
30+
"$(global.testfile)"
31+
delete => tidy,
32+
depends_on => { "testfile is not immutable" };
33+
34+
commands:
35+
"chattr -i $(global.testfile)"
36+
contain => in_shell,
37+
if => fileexists("$(global.testfile)"),
38+
handle => "testfile is not immutable";
39+
}
40+
41+
bundle agent test
42+
{
43+
meta:
44+
"description" -> { "CFE-4569" }
45+
string => "Test that fsattrs validation is not skipped when combining it with the content attribute";
46+
47+
"test_skip_unsupported"
48+
string => "hpux|aix|solaris|windows";
49+
50+
files:
51+
"$(global.testfile)"
52+
content => "You can't touch this",
53+
fsattrs => immutable("true");
54+
}
55+
56+
bundle agent check
57+
{
58+
methods:
59+
"check"
60+
usebundle => dcs_passif_output(".*Immutable.*", "", "lsattr -l $(global.testfile)", "$(this.promise_filename)");
61+
}
62+
63+
bundle agent destroy
64+
{
65+
files:
66+
"$(global.testfile)"
67+
delete => tidy,
68+
depends_on => { "testfile is no longer immutable" };
69+
70+
commands:
71+
"chattr -i $(global.testfile)"
72+
contain => in_shell,
73+
if => fileexists("$(global.testfile)"),
74+
handle => "testfile is no longer immutable";
75+
}

0 commit comments

Comments
 (0)