Skip to content

Commit 6cb0753

Browse files
committed
Added acceptance tests for immutable bit
Ticket: ENT-10961, CFE-1840 Signed-off-by: Lars Erik Wik <[email protected]>
1 parent f0fb898 commit 6cb0753

File tree

6 files changed

+222
-0
lines changed

6 files changed

+222
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
body common control
2+
{
3+
bundlesequence => { "init", "test", "check", "clean" };
4+
}
5+
6+
body fsattrs set_immutable
7+
{
8+
immutable => "true";
9+
}
10+
11+
body fsattrs set_mutable
12+
{
13+
immutable => "false";
14+
}
15+
16+
bundle agent init
17+
{
18+
files:
19+
"/tmp/immutable.txt"
20+
content => "I'm immutable",
21+
fsattrs => set_immutable;
22+
}
23+
24+
bundle agent test
25+
{
26+
meta:
27+
"description" -> { "CFE-1840", "ENT-10961" }
28+
string => "Test fsattrs immutable constraint";
29+
30+
"test_soft_fail"
31+
string => "hpux|aix|windows";
32+
33+
commands:
34+
"$(sys.cf_agent) -Kf $(this.promise_filename).sub";
35+
}
36+
37+
bundle agent check
38+
{
39+
vars:
40+
"expected"
41+
string => "I'm immutable";
42+
"actual"
43+
string => readfile("/tmp/immutable.txt");
44+
45+
classes:
46+
"ok"
47+
expression => strcmp("$(actual)", "$(expected)");
48+
49+
reports:
50+
ok::
51+
"$(this.promise_filename) Pass";
52+
!ok::
53+
"$(this.promise_filename) FAIL";
54+
any::
55+
"Expected: '$(expected)', actual: '$(actual)'";
56+
}
57+
58+
bundle agent clean
59+
{
60+
files:
61+
# Make sure immutable bit is not set
62+
"/tmp/immutable.txt"
63+
fsattrs => set_mutable;
64+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
bundle agent main
2+
{
3+
files:
4+
"/tmp/immutable.txt"
5+
content => "I'm mutable";
6+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
body common control
2+
{
3+
bundlesequence => { "init", "test", "check", "clean" };
4+
}
5+
6+
body fsattrs set_immutable
7+
{
8+
immutable => "true";
9+
}
10+
11+
body fsattrs set_mutable
12+
{
13+
immutable => "false";
14+
}
15+
16+
bundle agent init
17+
{
18+
files:
19+
"/tmp/immutable.txt"
20+
content => "I'm immutable",
21+
fsattrs => set_immutable;
22+
}
23+
24+
bundle agent test
25+
{
26+
meta:
27+
"description" -> { "CFE-1840", "ENT-10961" }
28+
string => "Test fsattrs immutable constraint";
29+
30+
"test_soft_fail"
31+
string => "hpux|aix|windows";
32+
33+
commands:
34+
"$(sys.cf_agent) -Kf $(this.promise_filename).sub";
35+
}
36+
37+
bundle agent check
38+
{
39+
vars:
40+
"expected"
41+
string => "I'm mutable";
42+
"actual"
43+
string => readfile("/tmp/immutable.txt");
44+
45+
classes:
46+
"ok"
47+
expression => strcmp("$(actual)", "$(expected)");
48+
49+
reports:
50+
ok::
51+
"$(this.promise_filename) Pass";
52+
!ok::
53+
"$(this.promise_filename) FAIL";
54+
any::
55+
"Expected: '$(expected)', actual: '$(actual)'";
56+
}
57+
58+
bundle agent clean
59+
{
60+
files:
61+
# Make sure immutable bit is not set
62+
"/tmp/immutable.txt"
63+
fsattrs => set_mutable;
64+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
body fsattrs set_immutable
2+
{
3+
immutable => "true";
4+
}
5+
6+
bundle agent main
7+
{
8+
files:
9+
"/tmp/immutable.txt"
10+
content => "I'm mutable",
11+
fsattrs => set_immutable;
12+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
body common control
2+
{
3+
bundlesequence => { "init", "test", "check", "clean" };
4+
}
5+
6+
body fsattrs set_immutable
7+
{
8+
immutable => "true";
9+
}
10+
11+
body fsattrs set_mutable
12+
{
13+
immutable => "false";
14+
}
15+
16+
bundle agent init
17+
{
18+
files:
19+
"/tmp/immutable.txt"
20+
content => "I'm immutable",
21+
fsattrs => set_immutable;
22+
}
23+
24+
bundle agent test
25+
{
26+
meta:
27+
"description" -> { "CFE-1840", "ENT-10961" }
28+
string => "Test fsattrs immutable constraint";
29+
30+
"test_soft_fail"
31+
string => "hpux|aix|windows";
32+
33+
commands:
34+
"$(sys.cf_agent) -Kf $(this.promise_filename).sub";
35+
}
36+
37+
bundle agent check
38+
{
39+
vars:
40+
"expected"
41+
string => "I'm mutable";
42+
"actual"
43+
string => readfile("/tmp/immutable.txt");
44+
45+
classes:
46+
"ok"
47+
expression => strcmp("$(actual)", "I'm mutable");
48+
49+
reports:
50+
ok::
51+
"$(this.promise_filename) Pass";
52+
!ok::
53+
"$(this.promise_filename) FAIL";
54+
any::
55+
"Expected: '$(expected)', actual: '$(actual)'";
56+
}
57+
58+
bundle agent clean
59+
{
60+
files:
61+
# Make sure immutable bit is not set
62+
"$(G.testfile)"
63+
fsattrs => set_mutable;
64+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
body fsattrs set_immutable
2+
{
3+
immutable => "false";
4+
}
5+
6+
bundle agent main
7+
{
8+
files:
9+
"/tmp/immutable.txt"
10+
content => "I'm mutable",
11+
fsattrs => set_immutable;
12+
}

0 commit comments

Comments
 (0)