--- /dev/null
+#
+# Input packet
+#
+Packet-Type = Access-Request
+User-Name = "attrref"
+User-Password = "password"
+NAS-IP-Address = "1.2.3.4"
+Framed-IP-Address = "1.2.3.4"
+
+#
+# Expected answer
+#
+Packet-Type == Access-Accept
+Idle-Timeout == 3600
--- /dev/null
+#
+# Clear out old data
+#
+%sql("${delete_from_radcheck} 'attrref'")
+%sql("${delete_from_radreply} 'attrref'")
+
+if (%sql("${insert_into_radcheck} ('attrref', 'NAS-IP-Address', '==', '&Framed-IP-Address')") != "1") {
+ test_fail
+}
+
+if (%sql("${insert_into_radcheck} ('attrref', 'Password.Cleartext', ':=', 'password')") != "1") {
+ test_fail
+}
+
+if (%sql("${insert_into_radreply} ('attrref', 'Idle-Timeout', ':=', '3600')") != "1") {
+ test_fail
+}
+
+sql
--- /dev/null
+#
+# Input packet
+#
+Packet-Type = Access-Request
+User-Name = "user_auth_nested"
+User-Password = "password"
+NAS-IP-Address = "1.2.3.4"
+
+#
+# Expected answer
+#
+Packet-Type == Access-Accept
+Idle-Timeout == 3600
+Digest-Attributes == { Nonce == "dcd98b7102dd2f0e8b11d0f600bfb0c093", Method == "Invite", URI == "sip:bob@biloxi.com" }
--- /dev/null
+#
+# Clear out old data. We don't care if the deletion deletes any rows.
+#
+%sql("${delete_from_radcheck} 'user_auth_nested'")
+%sql("${delete_from_radreply} 'user_auth_nested'")
+
+#
+# Add in the check items.
+#
+if (%sql("${insert_into_radcheck} ('user_auth_nested', 'NAS-IP-Address', '==', '1.2.3.4')") != "1") {
+ test_fail
+}
+
+if (%sql("${insert_into_radcheck} ('user_auth_nested', 'Password.Cleartext', ':=', 'password')") != "1") {
+ test_fail
+}
+
+#
+# Add in the reply items.
+#
+if (%sql("${insert_into_radreply} ('user_auth_nested', 'Idle-Timeout', ':=', '3600')") != "1") {
+ test_fail
+}
+
+if (0) {
+if (%sql("${insert_into_radreply} ('user_auth_nested', 'Digest-Attributes', ':=', 'Nonce = \"dcd98b7102dd2f0e8b11d0f600bfb0c093\", Method = \"Invite\", URI = \"sip:bob@biloxi.com\"')") != "1") {
+ test_fail
+}
+
+} else {
+if (%sql("${insert_into_radreply} ('user_auth_nested', 'Digest-Attributes', ':=', '')") != "1") {
+ test_fail
+}
+
+if (%sql("${insert_into_radreply} ('user_auth_nested', '.Nonce', '=', 'dcd98b7102dd2f0e8b11d0f600bfb0c093')") != "1") {
+ test_fail
+}
+
+if (%sql("${insert_into_radreply} ('user_auth_nested', '.Method', '=', 'Invite')") != "1") {
+ test_fail
+}
+
+if (%sql("${insert_into_radreply} ('user_auth_nested', '.URI', '=', 'sip:bob@biloxi.com')") != "1") {
+ test_fail
+}
+}
+
+#
+# Run the SQL module to get the replies.
+#
+sql
--- /dev/null
+#
+# Input packet
+#
+Packet-Type = Access-Request
+User-Name = "xlat"
+User-Password = "password"
+NAS-IP-Address = "1.2.3.4"
+
+#
+# Expected answer
+#
+Packet-Type == Access-Accept
+Reply-Message == "Hello xlat"
--- /dev/null
+#
+# Clear out old data
+#
+%sql("${delete_from_radcheck} 'xlat'")
+%sql("${delete_from_radreply} 'xlat'")
+
+if (%sql("${insert_into_radcheck} ('%{User-Name}', 'Password.Cleartext', ':=', 'password')") != "1") {
+ test_fail
+}
+
+if (%sql("${insert_into_radreply} ('%{User-Name}', 'Reply-Message', ':=', '\"Hello \%{User-Name}\"')") != "1") {
+ test_fail
+}
+
+sql
--- /dev/null
+../sql/attrref.attrs
\ No newline at end of file
--- /dev/null
+../sql/attrref.unlang
\ No newline at end of file
--- /dev/null
+../sql/nested.attrs
\ No newline at end of file
--- /dev/null
+../sql/nested.unlang
\ No newline at end of file
--- /dev/null
+../sql/xlat.attrs
\ No newline at end of file
--- /dev/null
+../sql/xlat.unlang
\ No newline at end of file
--- /dev/null
+../sql/attrref.attrs
\ No newline at end of file
--- /dev/null
+../sql/attrref.unlang
\ No newline at end of file
--- /dev/null
+../sql/nested.attrs
\ No newline at end of file
--- /dev/null
+../sql/nested.unlang
\ No newline at end of file
--- /dev/null
+../sql/xlat.attrs
\ No newline at end of file
--- /dev/null
+../sql/xlat.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-Packet-Type = Access-Request
-User-Name = "attrref"
-User-Password = "password"
-NAS-IP-Address = "1.2.3.4"
-Framed-IP-Address = "1.2.3.4"
-
-#
-# Expected answer
-#
-Packet-Type == Access-Accept
-Idle-Timeout == 3600
--- /dev/null
+../sql/attrref.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Clear out old data
-#
-%sql("${delete_from_radcheck} 'attrref'")
-%sql("${delete_from_radreply} 'attrref'")
-
-if (%sql("${insert_into_radcheck} ('attrref', 'NAS-IP-Address', '==', '&Framed-IP-Address')") != "1") {
- test_fail
-}
-
-if (%sql("${insert_into_radcheck} ('attrref', 'Password.Cleartext', ':=', 'password')") != "1") {
- test_fail
-}
-
-if (%sql("${insert_into_radreply} ('attrref', 'Idle-Timeout', ':=', '3600')") != "1") {
- test_fail
-}
-
-sql
--- /dev/null
+../sql/attrref.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-Packet-Type = Access-Request
-User-Name = "user_auth_nested"
-User-Password = "password"
-NAS-IP-Address = "1.2.3.4"
-
-#
-# Expected answer
-#
-Packet-Type == Access-Accept
-Idle-Timeout == 3600
-Digest-Attributes == { Nonce == "dcd98b7102dd2f0e8b11d0f600bfb0c093", Method == "Invite", URI == "sip:bob@biloxi.com" }
--- /dev/null
+../sql/nested.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Clear out old data. We don't care if the deletion deletes any rows.
-#
-%sql("${delete_from_radcheck} 'user_auth_nested'")
-%sql("${delete_from_radreply} 'user_auth_nested'")
-
-#
-# Add in the check items.
-#
-if (%sql("${insert_into_radcheck} ('user_auth_nested', 'NAS-IP-Address', '==', '1.2.3.4')") != "1") {
- test_fail
-}
-
-if (%sql("${insert_into_radcheck} ('user_auth_nested', 'Password.Cleartext', ':=', 'password')") != "1") {
- test_fail
-}
-
-#
-# Add in the reply items.
-#
-if (%sql("${insert_into_radreply} ('user_auth_nested', 'Idle-Timeout', ':=', '3600')") != "1") {
- test_fail
-}
-
-if (0) {
-if (%sql("${insert_into_radreply} ('user_auth_nested', 'Digest-Attributes', ':=', 'Nonce = \"dcd98b7102dd2f0e8b11d0f600bfb0c093\", Method = \"Invite\", URI = \"sip:bob@biloxi.com\"')") != "1") {
- test_fail
-}
-
-} else {
-if (%sql("${insert_into_radreply} ('user_auth_nested', 'Digest-Attributes', ':=', '')") != "1") {
- test_fail
-}
-
-if (%sql("${insert_into_radreply} ('user_auth_nested', '.Nonce', '=', 'dcd98b7102dd2f0e8b11d0f600bfb0c093')") != "1") {
- test_fail
-}
-
-if (%sql("${insert_into_radreply} ('user_auth_nested', '.Method', '=', 'Invite')") != "1") {
- test_fail
-}
-
-if (%sql("${insert_into_radreply} ('user_auth_nested', '.URI', '=', 'sip:bob@biloxi.com')") != "1") {
- test_fail
-}
-}
-
-#
-# Run the SQL module to get the replies.
-#
-sql
--- /dev/null
+../sql/nested.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-Packet-Type = Access-Request
-User-Name = "xlat"
-User-Password = "password"
-NAS-IP-Address = "1.2.3.4"
-
-#
-# Expected answer
-#
-Packet-Type == Access-Accept
-Reply-Message == "Hello xlat"
--- /dev/null
+../sql/xlat.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Clear out old data
-#
-%sql("${delete_from_radcheck} 'xlat'")
-%sql("${delete_from_radreply} 'xlat'")
-
-if (%sql("${insert_into_radcheck} ('%{User-Name}', 'Password.Cleartext', ':=', 'password')") != "1") {
- test_fail
-}
-
-if (%sql("${insert_into_radreply} ('%{User-Name}', 'Reply-Message', ':=', '\"Hello \%{User-Name}\"')") != "1") {
- test_fail
-}
-
-sql
--- /dev/null
+../sql/xlat.unlang
\ No newline at end of file