Skip to content

Commit 667948c

Browse files
committed
Added acceptance test to clear immutable bit
Ticket: ENT-10961, CFE-1840 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 9fca212 commit 667948c

File tree

1 file changed

+69
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)