]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Ensure there's no way linelog tests can conflict
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 31 Oct 2022 18:56:21 +0000 (12:56 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 31 Oct 2022 18:56:21 +0000 (12:56 -0600)
src/tests/modules/linelog/linelog-delim.unlang
src/tests/modules/linelog/linelog-escapes.unlang
src/tests/modules/linelog/linelog-multi.unlang
src/tests/modules/linelog/linelog.unlang
src/tests/modules/linelog/module.conf

index 760b5803e90238011ab427f25fa4477f111da2a0..f164804815cd92721f13d4cb6f321f7f3997820b 100644 (file)
@@ -4,7 +4,7 @@
 #  Remove old log files
 #
 group {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_delim.log"`
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_delim.log"`
 
        #
        #  We can only over-ride actions in an "actions" subsection,
@@ -19,7 +19,7 @@ if (fail) {
 }
 
 linelog_fmt_delim
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_delim.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_delim.log"`
 
 if (&Tmp-String-0 == 'bob, ') {
        test_pass
@@ -30,7 +30,7 @@ else {
 
 #  Check strings are appended
 linelog_fmt_delim
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_delim.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_delim.log"`
 
 if (&Tmp-String-0 == 'bob, bob, ') {
        test_pass
@@ -40,4 +40,4 @@ else {
 }
 
 #  Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_delim.log"`
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_delim.log"`
index d1226cedff0c2873181e75860e7e8676f652678a..0a96a8758681d999464800759906ad7577f2fd9e 100644 (file)
@@ -4,7 +4,7 @@
 #  Remove old log files
 #
 group {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_escapes.log"`
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_escapes.log"`
 
        actions {
                fail = 1
@@ -20,7 +20,7 @@ if (fail) {
 &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 -n2 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_escapes.log"`
 &Tmp-String-1 := "%{hex:%{Tmp-String-0}}"
 
 #
@@ -34,7 +34,7 @@ else {
        test_fail
 }
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_escapes.log"`
 
 #
 #  This is left alone, and not "\n" --> 0x0a, too.
@@ -52,7 +52,7 @@ else {
 &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 -n2 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_escapes.log"`
 &Tmp-String-1 := "%{hex:%{Tmp-String-0}}"
 
 if (&Tmp-String-1 == '666f6f0a626172') {
@@ -62,7 +62,7 @@ else {
        test_fail
 }
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_escapes.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_escapes.log"`
 
 if (&Tmp-String-0 == "bar") {
        test_pass
@@ -74,4 +74,4 @@ else {
 #  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"`
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_escapes.log"`
index d4e7adecea6da347f606ecaf0c6996b3686299b4..0510a54cb4807cbc1053621598a808622d82c64b 100644 (file)
@@ -4,7 +4,7 @@
 #  Remove old log files
 #
 group {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_multi.log"`
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_multi.log"`
 
        actions {
                fail = 1
@@ -32,7 +32,7 @@ if (fail) {
 }
 
 linelog_ref_multi
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_multi.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_multi.log"`
 
 if (&Tmp-String-0 == '0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ') {
        test_pass
@@ -52,7 +52,7 @@ else {
 
 linelog_ref_multi
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_multi.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_multi.log"`
 
 if (&Tmp-String-0 == ', blippo, ') {
        test_pass
@@ -73,4 +73,4 @@ else {
 }
 
 #  Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_multi.log"`
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_multi.log"`
index 1dfe9820558a31596625530b765003dfcb493821..3a2e0321fb7e12eaa44bcbb574273929e4443faf 100644 (file)
@@ -4,7 +4,7 @@
 #  Remove old log files
 #
 group {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_a.log"`
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log"`
 
        actions {
                fail = 1
@@ -18,7 +18,7 @@ if (fail) {
 &control.Tmp-String-0 := 'test_default'
 
 linelog_fmt_and_ref
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob default') {
        test_pass
@@ -32,7 +32,7 @@ else {
 
 linelog_fmt_and_ref
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob exec') {
        test_pass
@@ -42,7 +42,7 @@ else {
 }
 
 #  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 := `/bin/sh -c "head -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob default') {
        test_pass
@@ -56,7 +56,7 @@ else {
 
 linelog_fmt_and_ref
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob') {
        test_pass
@@ -70,7 +70,7 @@ else {
 
 linelog_fmt_and_ref
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log"`
 
 if (&Tmp-String-0 == 'bob xlat') {
        test_pass
@@ -84,7 +84,7 @@ else {
 
 linelog_fmt_and_ref
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log"`
 
 if (&Tmp-String-0 == '%{User-Name} literal') {
        test_pass
@@ -98,7 +98,7 @@ else {
 
 linelog_fmt_and_ref
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_a.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log"`
 
 if (&Tmp-String-0 == '') {
        test_pass
@@ -108,11 +108,11 @@ else {
 }
 
 #  Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_a.log"`
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log"`
 
 #  Remove old log files
 group {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_b.log"`
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_b.log"`
 
        actions {
                fail = 1
@@ -134,7 +134,7 @@ else {
 }
 
 group {
-       &Tmp-String-0 := `/bin/sh -c "test ! -e $ENV{MODULE_TEST_DIR}/test_b.log"`
+       &Tmp-String-0 := `/bin/sh -c "test ! -e $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_b.log"`
 
        actions {
                fail = 1
@@ -152,7 +152,7 @@ else {
 
 linelog_ref
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_b.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_b.log"`
 
 if (&Tmp-String-0 == 'bob exec') {
        test_pass
@@ -162,11 +162,11 @@ else {
 }
 
 #  Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_b.log"`
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_b.log"`
 
 #  Remove old log files
 group {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_c.log"`
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_c.log"`
 
        actions {
                fail = 1
@@ -180,7 +180,7 @@ if (fail) {
 &control.Tmp-String-0 := '.messages.test_xlat'
 
 linelog_fmt_and_ref_attr
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_c.log"`
 
 if (&Tmp-String-0 == 'bob xlat') {
        test_pass
@@ -193,7 +193,7 @@ else {
 &control.Tmp-String-0 := 'test_xlat'
 
 linelog_fmt_and_ref_attr
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_c.log"`
 
 if (&Tmp-String-0 == 'bob') {
        test_pass
@@ -206,7 +206,7 @@ else {
 &control.Tmp-String-0 := 'messages.test_xlat'
 
 linelog_fmt_and_ref_attr
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_c.log"`
 
 if (&Tmp-String-0 == 'bob xlat') {
        test_pass
@@ -228,7 +228,7 @@ else {
        test_fail
 }
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_c.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_c.log"`
 
 if (&Tmp-String-0 == 'bob xlat') {
        test_pass
@@ -251,11 +251,11 @@ else {
 }
 
 #  Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_c.log"`
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_c.log"`
 
 #  Remove old log files
 group {
-       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_d.log"`
+       &Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_d.log"`
 
        actions {
                fail = 1
@@ -266,7 +266,7 @@ if (fail) {
 }
 linelog_fmt
 
-&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/test_d.log"`
+&Tmp-String-0 := `/bin/sh -c "tail -n1 $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_d.log"`
 
 if (&Tmp-String-0 == 'bob') {
        test_pass
@@ -276,4 +276,4 @@ else {
 }
 
 #  Remove the file
-&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/test_d.log"`
+&Tmp-String-0 := `/bin/sh -c "rm $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_d.log"`
index 0d8f86c43ac9122d523ee50bdd5ee378a87a4cd4..d7aefb305de89a77a6048740af5552f72f3d9f28 100644 (file)
@@ -3,7 +3,7 @@ linelog linelog_fmt_and_ref {
        destination = file
 
        file {
-               filename = $ENV{MODULE_TEST_DIR}/test_a.log
+               filename = $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_a.log
        }
 
        format = "%{User-Name} default"
@@ -24,7 +24,7 @@ linelog linelog_ref {
        destination = file
 
        file {
-               filename = $ENV{MODULE_TEST_DIR}/test_b.log
+               filename = $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_b.log
        }
 
        reference = ".messages.%{control.Tmp-String-0}"
@@ -42,7 +42,7 @@ linelog linelog_fmt_and_ref_attr {
        destination = file
 
        file {
-               filename = $ENV{MODULE_TEST_DIR}/test_c.log
+               filename = $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_c.log
        }
 
        format = &User-Name
@@ -62,7 +62,7 @@ linelog linelog_fmt {
        destination = file
 
        file {
-               filename = $ENV{MODULE_TEST_DIR}/test_d.log
+               filename = $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_d.log
        }
 
        format = &User-Name
@@ -73,7 +73,7 @@ linelog linelog_escapes {
        destination = file
 
        file {
-               filename = $ENV{MODULE_TEST_DIR}/test_escapes.log
+               filename = $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_escapes.log
        }
 
        reference = ".messages.%{control.Tmp-String-0}"
@@ -90,7 +90,7 @@ linelog linelog_fmt_delim {
        destination = file
 
        file {
-               filename = $ENV{MODULE_TEST_DIR}/test_delim.log
+               filename = $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_delim.log
        }
 
        delimiter = ", "
@@ -103,7 +103,7 @@ linelog linelog_ref_multi {
        destination = file
 
        file {
-               filename = $ENV{MODULE_TEST_DIR}/test_multi.log
+               filename = $ENV{MODULE_TEST_DIR}/$ENV{MODULE_TEST_UNLANG}/test_multi.log
        }
 
        delimiter = ", "