tests depend on the module (i.e. library). So if the module source
changes, you can just do `make MODULE.test`. The module will be
re-built, and the tests will be run.
+
+Note: all SQL tests share the same tests definitions (see sql directory).
+The modules themselves simply link to the actual tests files.
# For the remaining subdirs, add on the directory to include.
# test.mk will run the tests for all modules
# It is included last so that the module specific makefiles can be processed first
-# (modules that require a test server can
+# (modules that require a test server can set the corresponding require_test_server variable)
#
SUBMAKEFILES := $(addsuffix /all.mk,$(TEST_BUILT) $(subst _,/,$(TEST_SUBBUILT))) test.mk
--- /dev/null
+rlm_sql_sqlite.db
--- /dev/null
+All SQL related tests should be defined here and the driver specific directory need only have links to the tests defined here.
--- /dev/null
+#
+# Input packet
+#
+User-Name = 'user@example.org'
+NAS-Port = 17826193
+NAS-IP-Address = 192.0.2.10
+Framed-IP-Address = 198.51.100.59
+NAS-Identifier = 'nas.example.org'
+Acct-Status-Type = Start
+Acct-Delay-Time = 1
+Acct-Input-Octets = 0
+Acct-Output-Octets = 0
+Acct-Session-Id = '00000000'
+Acct-Unique-Session-Id = '00000000'
+Acct-Authentic = RADIUS
+Acct-Session-Time = 0
+Acct-Input-Packets = 0
+Acct-Output-Packets = 0
+Acct-Input-Gigawords = 0
+Acct-Output-Gigawords = 0
+Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
+NAS-Port-Type = Ethernet
+NAS-Port-Id = 'port 001'
+Service-Type = Framed-User
+Framed-Protocol = PPP
+Acct-Link-Count = 0
+Idle-Timeout = 0
+Session-Timeout = 604800
+Access-Loop-Encapsulation = 0x000000
+Proxy-State = 0x323531
+
+#
+# Expected answer
+#
+# There's not an Accounting-Failed packet type in RADIUS...
+#
+Response-Packet-Type == Access-Accept
--- /dev/null
+#
+# Clear out old data
+#
+update {
+ Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000000'}"
+}
+if (!&Tmp-String-0) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+sql.accounting
+if (ok) {
+ test_pass
+}
+else {
+ test_fail
+}
+
+update {
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+update {
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
+ test_fail
+}
+else {
+ test_pass
+}
--- /dev/null
+#
+# Input packet
+#
+User-Name = 'user@example.org'
+NAS-Port = 17826193
+NAS-IP-Address = 192.0.2.10
+Framed-IP-Address = 198.51.100.59
+NAS-Identifier = 'nas.example.org'
+Acct-Status-Type = Interim-Update
+Acct-Delay-Time = 1
+Acct-Input-Octets = 10
+Acct-Output-Octets = 10
+Acct-Session-Id = '00000000'
+Acct-Unique-Session-Id = '00000000'
+Acct-Authentic = RADIUS
+Acct-Session-Time = 30
+Acct-Input-Packets = 10
+Acct-Output-Packets = 10
+Acct-Input-Gigawords = 1
+Acct-Output-Gigawords = 1
+Event-Timestamp = 'Feb 1 2015 08:28:28 WIB'
+NAS-Port-Type = Ethernet
+NAS-Port-Id = 'port 001'
+Service-Type = Framed-User
+Framed-Protocol = PPP
+Acct-Link-Count = 0
+Idle-Timeout = 0
+Session-Timeout = 604800
+Access-Loop-Encapsulation = 0x000000
+Proxy-State = 0x323531
+
+#
+# Expected answer
+#
+# There's not an Accounting-Failed packet type in RADIUS...
+#
+Response-Packet-Type == Access-Accept
--- /dev/null
+#
+# PRE: acct_0_start
+#
+sql.accounting
+if (ok) {
+ test_pass
+}
+else {
+ test_fail
+}
+
+update {
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+update {
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
+ test_fail
+}
+else {
+ test_pass
+}
--- /dev/null
+#
+# Input packet
+#
+User-Name = 'user@example.org'
+NAS-Port = 17826193
+NAS-IP-Address = 192.0.2.10
+Framed-IP-Address = 198.51.100.59
+NAS-Identifier = 'nas.example.org'
+Acct-Status-Type = Stop
+Acct-Terminate-Cause = User-Request
+Acct-Delay-Time = 1
+Acct-Input-Octets = 15
+Acct-Output-Octets = 15
+Acct-Session-Id = '00000000'
+Acct-Unique-Session-Id = '00000000'
+Acct-Authentic = RADIUS
+Acct-Session-Time = 120
+Acct-Input-Packets = 15
+Acct-Output-Packets = 15
+Acct-Input-Gigawords = 1
+Acct-Output-Gigawords = 1
+Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
+NAS-Port-Type = Ethernet
+NAS-Port-Id = 'port 001'
+Service-Type = Framed-User
+Framed-Protocol = PPP
+Acct-Link-Count = 0
+Idle-Timeout = 0
+Session-Timeout = 604800
+Access-Loop-Encapsulation = 0x000000
+Proxy-State = 0x323531
+
+#
+# Expected answer
+#
+# There's not an Accounting-Failed packet type in RADIUS...
+#
+Response-Packet-Type == Access-Accept
--- /dev/null
+#
+# PRE: acct_1_update
+#
+sql.accounting
+if (ok) {
+ test_pass
+}
+else {
+ test_fail
+}
+
+update {
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+update {
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 120)) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+update {
+ Tmp-String-0 := "%{sql:SELECT AcctTerminateCause FROM radacct WHERE AcctSessionId = '00000000'}"
+}
+if (!&Tmp-String-0 || (&Tmp-String-0 != 'User-Request')) {
+ test_fail
+}
+else {
+ test_pass
+}
--- /dev/null
+#
+# Input packet
+#
+User-Name = 'user@example.org'
+NAS-Port = 17826193
+NAS-IP-Address = 192.0.2.10
+Framed-IP-Address = 198.51.100.59
+NAS-Identifier = 'nas.example.org'
+Acct-Status-Type = Start
+Acct-Delay-Time = 1
+Acct-Input-Octets = 0
+Acct-Output-Octets = 0
+Acct-Session-Id = '00000001'
+Acct-Unique-Session-Id = '00000001'
+Acct-Authentic = RADIUS
+Acct-Session-Time = 0
+Acct-Input-Packets = 0
+Acct-Output-Packets = 0
+Acct-Input-Gigawords = 0
+Acct-Output-Gigawords = 0
+Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
+NAS-Port-Type = Ethernet
+NAS-Port-Id = 'port 001'
+Service-Type = Framed-User
+Framed-Protocol = PPP
+Acct-Link-Count = 0
+Idle-Timeout = 0
+Session-Timeout = 604800
+Access-Loop-Encapsulation = 0x000000
+Proxy-State = 0x323531
+
+#
+# Expected answer
+#
+# There's not an Accounting-Failed packet type in RADIUS...
+#
+Response-Packet-Type == Access-Accept
--- /dev/null
+#
+# Check that conflicting unique IDs triggers failover to alternative query
+#
+
+#
+# Clear out old data
+#
+update {
+ Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000001'}"
+}
+if (!&Tmp-String-0) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+#
+# Insert the Accounting-Request start
+#
+sql.accounting
+if (ok) {
+ test_pass
+}
+else {
+ test_fail
+}
+
+#
+# Check the database has at least one row
+#
+update {
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000001'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+#
+# Check acctsessiontime matches the value in the request
+#
+update {
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000001'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+#
+# Change acctsessiontime and verify it's updated
+#
+update request {
+ Connect-Info = 'updated'
+}
+sql.accounting
+if (ok) {
+ test_pass
+}
+else {
+ test_fail
+}
+update {
+ Tmp-String-0 := "%{sql:SELECT connectinfo_start FROM radacct WHERE AcctSessionId = '00000001'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-String-0 != 'updated')) {
+ test_fail
+}
+else {
+ test_pass
+}
--- /dev/null
+#
+# Input packet
+#
+User-Name = 'user@example.org'
+NAS-Port = 17826193
+NAS-IP-Address = 192.0.2.10
+Framed-IP-Address = 198.51.100.59
+NAS-Identifier = 'nas.example.org'
+Acct-Status-Type = Interim-Update
+Acct-Delay-Time = 1
+Acct-Input-Octets = 10
+Acct-Output-Octets = 10
+Acct-Session-Id = '00000002'
+Acct-Unique-Session-Id = '00000002'
+Acct-Authentic = RADIUS
+Acct-Session-Time = 30
+Acct-Input-Packets = 10
+Acct-Output-Packets = 10
+Acct-Input-Gigawords = 1
+Acct-Output-Gigawords = 1
+Event-Timestamp = 'Feb 1 2015 08:28:28 WIB'
+NAS-Port-Type = Ethernet
+NAS-Port-Id = 'port 001'
+Service-Type = Framed-User
+Framed-Protocol = PPP
+Acct-Link-Count = 0
+Idle-Timeout = 0
+Session-Timeout = 604800
+Access-Loop-Encapsulation = 0x000000
+Proxy-State = 0x323531
+
+#
+# Expected answer
+#
+# There's not an Accounting-Failed packet type in RADIUS...
+#
+Response-Packet-Type == Access-Accept
--- /dev/null
+#
+# Clear out old data
+#
+update {
+ Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000002'}"
+}
+if (!&Tmp-String-0) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+sql.accounting
+if (ok) {
+ test_pass
+}
+else {
+ test_fail
+}
+
+update {
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000002'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+update {
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000002'}"
+}
+if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
+ test_fail
+}
+else {
+ test_pass
+}
--- /dev/null
+#
+# Input packet
+#
+User-Name = "foo"
+User-Password = "password"
+NAS-IP-Address = "1.2.3.4"
+
+#
+# Expected answer
+#
+Response-Packet-Type == Access-Accept
+Idle-Timeout == 3600
--- /dev/null
+#
+# Clear out old data
+#
+update {
+ Tmp-String-0 := "%{sql:DELETE FROM radcheck WHERE username = 'foo'}"
+}
+if (!&Tmp-String-0) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+update {
+ Tmp-String-0 := "%{sql:INSERT INTO radcheck (username, attribute, op, value) VALUES ('foo', 'NAS-IP-Address', '==', '1.2.3.4'), ('foo', 'Cleartext-Password', ':=', 'password')}"
+}
+if (!&Tmp-String-0) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+update {
+ Tmp-String-0 := "%{sql:DELETE FROM radreply WHERE username = 'foo'}"
+}
+if (!&Tmp-String-0) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+update {
+ Tmp-String-0 := "%{sql:INSERT INTO radreply (username, attribute, op, value) VALUES ('foo', 'Idle-Timeout', ':=', '3600')}"
+}
+if (!&Tmp-String-0) {
+ test_fail
+}
+else {
+ test_pass
+}
+
+sql
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Start
-Acct-Delay-Time = 1
-Acct-Input-Octets = 0
-Acct-Output-Octets = 0
-Acct-Session-Id = '00000000'
-Acct-Unique-Session-Id = '00000000'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 0
-Acct-Input-Packets = 0
-Acct-Output-Packets = 0
-Acct-Input-Gigawords = 0
-Acct-Output-Gigawords = 0
-Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_0_start.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_0_start.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Interim-Update
-Acct-Delay-Time = 1
-Acct-Input-Octets = 10
-Acct-Output-Octets = 10
-Acct-Session-Id = '00000000'
-Acct-Unique-Session-Id = '00000000'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 30
-Acct-Input-Packets = 10
-Acct-Output-Packets = 10
-Acct-Input-Gigawords = 1
-Acct-Output-Gigawords = 1
-Event-Timestamp = 'Feb 1 2015 08:28:28 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_1_update.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_0_start
-#
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_1_update.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Interim-Update
-Acct-Delay-Time = 1
-Acct-Input-Octets = 15
-Acct-Output-Octets = 15
-Acct-Session-Id = '00000000'
-Acct-Unique-Session-Id = '00000000'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 60
-Acct-Input-Packets = 15
-Acct-Output-Packets = 15
-Acct-Input-Gigawords = 1
-Acct-Output-Gigawords = 1
-Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_2_stop.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_1_update
-#
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 60)) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_2_stop.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Start
-Acct-Delay-Time = 1
-Acct-Input-Octets = 0
-Acct-Output-Octets = 0
-Acct-Session-Id = '00000001'
-Acct-Unique-Session-Id = '00000001'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 0
-Acct-Input-Packets = 0
-Acct-Output-Packets = 0
-Acct-Input-Gigawords = 0
-Acct-Output-Gigawords = 0
-Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_start_conflict.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_2_stop
-#
-
-#
-# Check that conflicting unique IDs triggers failover to alternative query
-#
-
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-#
-# Insert the Accounting-Request start
-#
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-#
-# Check the database has at least one row
-#
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-#
-# Check acctsessiontime matches the value in the request
-#
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
- test_fail
-}
-else {
- test_pass
-}
-
-#
-# Change acctsessiontime and verify it's updated
-#
-update request {
- Connect-Info = 'updated'
-}
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_pass
-}
-update {
- Tmp-String-0 := "%{sql:SELECT connectinfo_start FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-String-0 != 'updated')) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_start_conflict.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Interim-Update
-Acct-Delay-Time = 1
-Acct-Input-Octets = 10
-Acct-Output-Octets = 10
-Acct-Session-Id = '00000002'
-Acct-Unique-Session-Id = '00000002'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 30
-Acct-Input-Packets = 10
-Acct-Output-Packets = 10
-Acct-Input-Gigawords = 1
-Acct-Output-Gigawords = 1
-Event-Timestamp = 'Feb 1 2015 08:28:28 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_update_no_start.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_start_conflict
-#
-
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000002'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000002'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000002'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_update_no_start.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = "foo"
-User-Password = "password"
-NAS-IP-Address = "1.2.3.4"
-
-#
-# Expected answer
-#
-Response-Packet-Type == Access-Accept
-Idle-Timeout == 3600
--- /dev/null
+../sql/auth.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radcheck WHERE username = 'foo'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-String-0 := "%{sql:INSERT INTO radcheck (username, attribute, op, value) VALUES ('foo', 'NAS-IP-Address', '==', '1.2.3.4'), ('foo', 'Cleartext-Password', ':=', 'password')}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radreply WHERE username = 'foo'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-String-0 := "%{sql:INSERT INTO radreply (username, attribute, op, value) VALUES ('foo', 'Idle-Timeout', ':=', '3600')}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-sql
--- /dev/null
+../sql/auth.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Start
-Acct-Delay-Time = 1
-Acct-Input-Octets = 0
-Acct-Output-Octets = 0
-Acct-Session-Id = '00000000'
-Acct-Unique-Session-Id = '00000000'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 0
-Acct-Input-Packets = 0
-Acct-Output-Packets = 0
-Acct-Input-Gigawords = 0
-Acct-Output-Gigawords = 0
-Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_0_start.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_0_start.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Interim-Update
-Acct-Delay-Time = 1
-Acct-Input-Octets = 10
-Acct-Output-Octets = 10
-Acct-Session-Id = '00000000'
-Acct-Unique-Session-Id = '00000000'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 30
-Acct-Input-Packets = 10
-Acct-Output-Packets = 10
-Acct-Input-Gigawords = 1
-Acct-Output-Gigawords = 1
-Event-Timestamp = 'Feb 1 2015 08:28:28 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_1_update.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_0_start
-#
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_1_update.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Stop
-Acct-Terminate-Cause = User-Request
-Acct-Delay-Time = 1
-Acct-Input-Octets = 15
-Acct-Output-Octets = 15
-Acct-Session-Id = '00000000'
-Acct-Unique-Session-Id = '00000000'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 120
-Acct-Input-Packets = 15
-Acct-Output-Packets = 15
-Acct-Input-Gigawords = 1
-Acct-Output-Gigawords = 1
-Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_2_stop.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_1_update
-#
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 120)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-String-0 := "%{sql:SELECT AcctTerminateCause FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-String-0 || (&Tmp-String-0 != 'User-Request')) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_2_stop.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Start
-Acct-Delay-Time = 1
-Acct-Input-Octets = 0
-Acct-Output-Octets = 0
-Acct-Session-Id = '00000001'
-Acct-Unique-Session-Id = '00000001'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 0
-Acct-Input-Packets = 0
-Acct-Output-Packets = 0
-Acct-Input-Gigawords = 0
-Acct-Output-Gigawords = 0
-Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_start_conflict.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Check that conflicting unique IDs triggers failover to alternative query
-#
-
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-#
-# Insert the Accounting-Request start
-#
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-#
-# Check the database has at least one row
-#
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-#
-# Check acctsessiontime matches the value in the request
-#
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
- test_fail
-}
-else {
- test_pass
-}
-
-#
-# Change acctsessiontime and verify it's updated
-#
-update request {
- Connect-Info = 'updated'
-}
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-update {
- Tmp-String-0 := "%{sql:SELECT connectinfo_start FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-String-0 != 'updated')) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_start_conflict.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Interim-Update
-Acct-Delay-Time = 1
-Acct-Input-Octets = 10
-Acct-Output-Octets = 10
-Acct-Session-Id = '00000002'
-Acct-Unique-Session-Id = '00000002'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 30
-Acct-Input-Packets = 10
-Acct-Output-Packets = 10
-Acct-Input-Gigawords = 1
-Acct-Output-Gigawords = 1
-Event-Timestamp = 'Feb 1 2015 08:28:28 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_update_no_start.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000002'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000002'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000002'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_update_no_start.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = "foo"
-User-Password = "password"
-NAS-IP-Address = "1.2.3.4"
-
-#
-# Expected answer
-#
-Response-Packet-Type == Access-Accept
-Idle-Timeout == 3600
--- /dev/null
+../sql/auth.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radcheck WHERE username = 'foo'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-String-0 := "%{sql:INSERT INTO radcheck (username, attribute, op, value) VALUES ('foo', 'NAS-IP-Address', '==', '1.2.3.4'), ('foo', 'Cleartext-Password', ':=', 'password')}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radreply WHERE username = 'foo'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-String-0 := "%{sql:INSERT INTO radreply (username, attribute, op, value) VALUES ('foo', 'Idle-Timeout', ':=', '3600')}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-sql
--- /dev/null
+../sql/auth.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Start
-Acct-Delay-Time = 1
-Acct-Input-Octets = 0
-Acct-Output-Octets = 0
-Acct-Session-Id = '00000000'
-Acct-Unique-Session-Id = '00000000'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 0
-Acct-Input-Packets = 0
-Acct-Output-Packets = 0
-Acct-Input-Gigawords = 0
-Acct-Output-Gigawords = 0
-Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_0_start.attrs
\ No newline at end of file
+++ /dev/null
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_0_start.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Interim-Update
-Acct-Delay-Time = 1
-Acct-Input-Octets = 10
-Acct-Output-Octets = 10
-Acct-Session-Id = '00000000'
-Acct-Unique-Session-Id = '00000000'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 30
-Acct-Input-Packets = 10
-Acct-Output-Packets = 10
-Acct-Input-Gigawords = 1
-Acct-Output-Gigawords = 1
-Event-Timestamp = 'Feb 1 2015 08:28:28 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_1_update.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_0_start
-#
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
- test_fail
-}
-else {
- test_pass
-}
-
--- /dev/null
+../sql/acct_1_update.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Interim-Update
-Acct-Delay-Time = 1
-Acct-Input-Octets = 15
-Acct-Output-Octets = 15
-Acct-Session-Id = '00000000'
-Acct-Unique-Session-Id = '00000000'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 60
-Acct-Input-Packets = 15
-Acct-Output-Packets = 15
-Acct-Input-Gigawords = 1
-Acct-Output-Gigawords = 1
-Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_2_stop.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_1_update
-#
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 60)) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_2_stop.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Start
-Acct-Delay-Time = 1
-Acct-Input-Octets = 0
-Acct-Output-Octets = 0
-Acct-Session-Id = '00000001'
-Acct-Unique-Session-Id = '00000001'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 0
-Acct-Input-Packets = 0
-Acct-Output-Packets = 0
-Acct-Input-Gigawords = 0
-Acct-Output-Gigawords = 0
-Event-Timestamp = 'Feb 1 2015 08:28:58 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_start_conflict.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_2_stop
-#
-# Check that conflicting unique IDs triggers failover to alternative query
-#
-
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-#
-# Insert the Accounting-Request start
-#
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-#
-# Check the database has at least one row
-#
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-#
-# Check acctsessiontime matches the value in the request
-#
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
- test_fail
-}
-else {
- test_pass
-}
-
-#
-# Change acctsessiontime and verify it's updated
-#
-update request {
- Connect-Info = 'updated'
-}
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_pass
-}
-update {
- Tmp-String-0 := "%{sql:SELECT connectinfo_start FROM radacct WHERE AcctSessionId = '00000001'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-String-0 != 'updated')) {
- test_fail
-}
-else {
- test_pass
-}
--- /dev/null
+../sql/acct_start_conflict.unlang
\ No newline at end of file
+++ /dev/null
-#
-# Input packet
-#
-User-Name = 'user@example.org'
-NAS-Port = 17826193
-NAS-IP-Address = 192.0.2.10
-Framed-IP-Address = 198.51.100.59
-NAS-Identifier = 'nas.example.org'
-Acct-Status-Type = Interim-Update
-Acct-Delay-Time = 1
-Acct-Input-Octets = 10
-Acct-Output-Octets = 10
-Acct-Session-Id = '00000002'
-Acct-Unique-Session-Id = '00000002'
-Acct-Authentic = RADIUS
-Acct-Session-Time = 30
-Acct-Input-Packets = 10
-Acct-Output-Packets = 10
-Acct-Input-Gigawords = 1
-Acct-Output-Gigawords = 1
-Event-Timestamp = 'Feb 1 2015 08:28:28 WIB'
-NAS-Port-Type = Ethernet
-NAS-Port-Id = 'port 001'
-Service-Type = Framed-User
-Framed-Protocol = PPP
-Acct-Link-Count = 0
-Idle-Timeout = 0
-Session-Timeout = 604800
-Access-Loop-Encapsulation = 0x000000
-Proxy-State = 0x323531
-
-#
-# Expected answer
-#
-# There's not an Accounting-Failed packet type in RADIUS...
-#
-Response-Packet-Type == Access-Accept
--- /dev/null
+../sql/acct_update_no_start.attrs
\ No newline at end of file
+++ /dev/null
-#
-# PRE: acct_start_conflict
-#
-# Clear out old data
-#
-update {
- Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000002'}"
-}
-if (!&Tmp-String-0) {
- test_fail
-}
-else {
- test_pass
-}
-
-sql.accounting
-if (ok) {
- test_pass
-}
-else {
- test_fail
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000002'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
- test_fail
-}
-else {
- test_pass
-}
-
-update {
- Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000002'}"
-}
-if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
- test_fail
-}
-else {
- test_pass
-}
-
--- /dev/null
+../sql/acct_update_no_start.unlang
\ No newline at end of file
--- /dev/null
+../sql/auth.attrs
\ No newline at end of file
--- /dev/null
+../sql/auth.unlang
\ No newline at end of file