--- /dev/null
+#
+# Test the "files" module
+#
--- /dev/null
+#
+# Input packet
+#
+User-Name = "fivel"
+User-Password = "mousekewitz"
+
+#
+# Expected answer
+#
+Response-Packet-Type == Access-Accept
\ No newline at end of file
--- /dev/null
+#
+# Async calls should always return a zero length string
+# because we don't wait for the response.
+#
+update request {
+ Tmp-String-0 := "%{exec_async:/bin/bash -c 'echo hello'}"
+}
+if (&Tmp-String-0 != '') {
+ test_fail
+} else {
+ test_pass
+}
+
+#
+# Async calls should not have their output added to the request
+#
+update request {
+ Tmp-String-0 := "%{exec_async:/bin/bash -c \"echo 'reply:Reply-Message = \'hello\''\"}"
+}
+
+if (&reply:Reply-Message == 'hello') {
+ test_fail
+} else {
+ test_pass
+}
\ No newline at end of file
--- /dev/null
+#
+# Input packet
+#
+User-Name = "tony"
+User-Password = "taponi"
+
+#
+# Expected answer
+#
+Response-Packet-Type == Access-Accept
\ No newline at end of file
--- /dev/null
+#
+# Sync calls should always return a zero length string
+# because we don't wait for the response.
+#
+update request {
+ &Tmp-String-0 := `/bin/bash -c 'echo hello'`
+}
+if (&Tmp-String-0 != 'hello') {
+ test_fail
+} else {
+ test_pass
+}
+
+#
+# Test default list override
+#
+#update request {
+# control: += `/bin/bash -c "echo reply:Reply-Message = \'hello\'"`
+#}
+
+#if (&reply:Reply-Message != 'hello') {
+# test_fail
+#} else {
+# test_pass
+#}
--- /dev/null
+exec exec_async {
+ wait = no
+ input_pairs = request
+ shell_escape = yes
+ timeout = 10
+}
+
+exec exec_sync {
+ wait = yes
+ input_pairs = control
+ shell_escape = yes
+ timeout = 10
+}
+
--- /dev/null
+#
+# Input packet
+#
+User-Name = "tony"
+User-Password = "taponi"
+
+#
+# Expected answer
+#
+Response-Packet-Type == Access-Accept
\ No newline at end of file
--- /dev/null
+#
+# Sync calls should always return a zero length string
+# because we don't wait for the response.
+#
+update request {
+ &Tmp-String-0 := "%{exec_sync:/bin/bash -c 'echo hello'}"
+}
+if (&Tmp-String-0 != 'hello') {
+ test_fail
+} else {
+ test_pass
+}
+
+#
+# Sync calls should have their output added to the request
+#
+update request {
+ &Tmp-String-0 := "%{exec_sync:/bin/bash -c 'echo \"reply:Reply-Message = \'hello\'\"'}"
+}
+
+if (&reply:Reply-Message != 'hello') {
+ test_fail
+} else {
+ test_pass
+}