#
# Remove old log files
#
-group {
- &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_delim.log"`
-
- #
- # We can only over-ride actions in an "actions" subsection,
- # and then only as the last item in a group.
- #
- actions {
- fail = 1
- }
-}
-if (fail) {
- ok
-}
+%file.rm("$ENV{MODULE_TEST_DIR}/test_delim.log")
linelog_fmt_delim
&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_delim.log"`
}
# Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_delim.log"`
+%file.rm("$ENV{MODULE_TEST_DIR}/test_delim.log")
#
# Remove old log files
#
-group {
- &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_escapes.log"`
-
- actions {
- fail = 1
- }
-}
-if (fail) {
- ok
-}
+%file.rm("$ENV{MODULE_TEST_DIR}/test_escapes.log");
# Raw attribute value should be written out without further molestation.
# Because the value is wrapped in '' the \n is left as \n.
&control.Tmp-String-1 := 'foo\nbar'
linelog_escapes
-&Tmp-String-0 := `/bin/sh -c "tail -n2 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
&Tmp-String-1 := "%hex(%{Tmp-String-0})"
#
# Fixme... needs completing. Too many broken escaping things.
# Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_escapes.log"`
+%file.rm("$ENV{MODULE_TEST_DIR}/test_escapes.log");
#
# Remove old log files
#
-group {
- &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_a.log"`
-
- actions {
- fail = 1
- }
-}
-if (fail) {
- ok
-}
+%file.rm("$ENV{MODULE_TEST_DIR}/test_a.log")
# Check linelog fails over to the default message (an xlat expansion)
&control.Tmp-String-0 := 'test_default'
}
# Check it's not overwriting the same line repeatedly
-&Tmp-String-0 := `/bin/sh -c "head -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
+&Tmp-String-0 := %file.head("$ENV{MODULE_TEST_DIR}/test_a.log");
if (&Tmp-String-0 == 'bob default') {
test_pass
}
# Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_a.log"`
+%file.rm("$ENV{MODULE_TEST_DIR}/test_a.log")
# Remove old log files
-group {
- &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_b.log"`
-
- actions {
- fail = 1
- }
-}
-if (fail) {
- ok
-}
+%file.rm("$ENV{MODULE_TEST_DIR}/test_b.log")
# Check behaviour when we don't have a default configured (should not create new file)
&control.Tmp-String-0 := 'test_default'
}
# Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_b.log"`
+%file.rm("$ENV{MODULE_TEST_DIR}/test_b.log")
# Remove old log files
-group {
- &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_c.log"`
-
- actions {
- fail = 1
- }
-}
-if (fail) {
- ok
-}
+%file.rm("$ENV{MODULE_TEST_DIR}/test_c.log")
# Check behaviour using an attribute ref as a path
&control.Tmp-String-0 := '.messages.test_xlat'
}
# Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_c.log"`
+%file.rm("$ENV{MODULE_TEST_DIR}/test_c.log")
# Remove old log files
-group {
- &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_d.log"`
+%file.rm("$ENV{MODULE_TEST_DIR}/test_d.log")
- actions {
- fail = 1
- }
-}
-if (fail) {
- ok
-}
linelog_fmt
&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_d.log"`
}
# Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_d.log"`
+%file.rm("$ENV{MODULE_TEST_DIR}/test_d.log")
# Remove old log files
-group {
- &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_e.log"`
-
- actions {
- fail = 1
- }
-}
-if (fail) {
- ok
-}
+%file.rm("$ENV{MODULE_TEST_DIR}/test_d.log")
# Set attribute used in header line
&control.Tmp-String-1 := "%t"
linelog_header
-&Tmp-String-0 := `/bin/sh -c "head -n1 $ENV{MODULE_TEST_DIR}/test_e.log"`
+&Tmp-String-0 := %file.head("$ENV{MODULE_TEST_DIR}/test_e.log")
if (&Tmp-String-0 == "Log started %{control.Tmp-String-1}") {
test_pass
}
# Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_e.log"`
+%file.rm("$ENV{MODULE_TEST_DIR}/test_e.log")
#
# Remove old log files
#
-group {
- &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_xlat.log"`
+%file.rm("$ENV{MODULE_TEST_DIR}/test_xlat.log")
- #
- # We can only over-ride actions in an "actions" subsection,
- # and then only as the last item in a group.
- #
- actions {
- fail = 1
- }
-}
-if (fail) {
- ok
-}
if (%{linelog_fmt_delim_xlat:bob} != 5) {
test_fail
}
}
# Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_xlat.log"`
-
+%file.rm("$ENV{MODULE_TEST_DIR}/test_xlat.log")
# Try with some handcrafted JSON
else {
test_fail
}
+
+# Remove the file
+%file.rm("$ENV{MODULE_TEST_DIR}/test_xlat.log")