# Clear out old data
#
update {
- Tmp-String-0 := "%{sql_mysql:DELETE FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-String-0) {
test_fail
test_pass
}
-sql_mysql.accounting
+sql.accounting
if (ok) {
test_pass
}
}
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
}
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
test_fail
#
# PRE: acct_0_start
#
-sql_mysql.accounting
+sql.accounting
if (ok) {
test_pass
}
}
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
}
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
test_fail
#
# PRE: acct_1_update
#
-sql_mysql.accounting
+sql.accounting
if (ok) {
test_pass
}
}
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
}
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 60)) {
test_fail
# Clear out old data
#
update {
- Tmp-String-0 := "%{sql_mysql:DELETE FROM radacct WHERE AcctSessionId = '00000001'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000001'}"
}
if (!&Tmp-String-0) {
test_fail
#
# Insert the Accounting-Request start
#
-sql_mysql.accounting
+sql.accounting
if (ok) {
test_pass
}
# Check the database has at least one row
#
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000001'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000001'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
# Check acctsessiontime matches the value in the request
#
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000001'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000001'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
test_fail
update request {
Connect-Info = 'updated'
}
-sql_mysql.accounting
+sql.accounting
if (ok) {
test_pass
}
test_pass
}
update {
- Tmp-String-0 := "%{sql_mysql:SELECT connectinfo_start FROM radacct WHERE AcctSessionId = '00000001'}"
+ Tmp-String-0 := "%{sql:SELECT connectinfo_start FROM radacct WHERE AcctSessionId = '00000001'}"
}
if (!&Tmp-Integer-0 || (&Tmp-String-0 != 'updated')) {
test_fail
# Clear out old data
#
update {
- Tmp-String-0 := "%{sql_mysql:DELETE FROM radacct WHERE AcctSessionId = '00000002'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000002'}"
}
if (!&Tmp-String-0) {
test_fail
test_pass
}
-sql_mysql.accounting
+sql.accounting
if (ok) {
test_pass
}
}
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000002'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000002'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
}
update {
- Tmp-Integer-0 := "%{sql_mysql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000002'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000002'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
test_fail
# Clear out old data
#
update {
- Tmp-String-0 := "%{sql_mysql:DELETE FROM radcheck WHERE username = 'foo'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radcheck WHERE username = 'foo'}"
}
if (!&Tmp-String-0) {
test_fail
}
update {
- Tmp-String-0 := "%{sql_mysql:INSERT INTO radcheck (username, attribute, op, value) VALUES ('foo', 'NAS-IP-Address', '==', '1.2.3.4'), ('foo', 'Cleartext-Password', ':=', 'password')}"
+ 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
}
update {
- Tmp-String-0 := "%{sql_mysql:DELETE FROM radreply WHERE username = 'foo'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radreply WHERE username = 'foo'}"
}
if (!&Tmp-String-0) {
test_fail
}
update {
- Tmp-String-0 := "%{sql_mysql:INSERT INTO radreply (username, attribute, op, value) VALUES ('foo', 'Idle-Timeout', ':=', '3600')}"
+ Tmp-String-0 := "%{sql:INSERT INTO radreply (username, attribute, op, value) VALUES ('foo', 'Idle-Timeout', ':=', '3600')}"
}
if (!&Tmp-String-0) {
test_fail
test_pass
}
-sql_mysql
+sql
-sql sql_mysql {
+sql {
driver = "rlm_sql_mysql"
dialect = "mysql"
# Clear out old data
#
update {
- Tmp-String-0 := "%{sql_postgresql:DELETE FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-String-0) {
test_fail
test_pass
}
-sql_postgresql.accounting
+sql.accounting
if (ok) {
test_pass
}
}
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
}
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
test_fail
#
# PRE: acct_0_start
#
-sql_postgresql.accounting
+sql.accounting
if (ok) {
test_pass
}
}
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
}
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
test_fail
#
# PRE: acct_1_update
#
-sql_postgresql.accounting
+sql.accounting
if (ok) {
test_pass
}
}
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
}
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 120)) {
test_fail
}
update {
- Tmp-String-0 := "%{sql_postgresql:SELECT AcctTerminateCause FROM radacct WHERE AcctSessionId = '00000000'}"
+ Tmp-String-0 := "%{sql:SELECT AcctTerminateCause FROM radacct WHERE AcctSessionId = '00000000'}"
}
if (!&Tmp-String-0 || (&Tmp-String-0 != 'User-Request')) {
test_fail
# Clear out old data
#
update {
- Tmp-String-0 := "%{sql_postgresql:DELETE FROM radacct WHERE AcctSessionId = '00000001'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000001'}"
}
if (!&Tmp-String-0) {
test_fail
#
# Insert the Accounting-Request start
#
-sql_postgresql.accounting
+sql.accounting
if (ok) {
test_pass
}
# Check the database has at least one row
#
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000001'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000001'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
# Check acctsessiontime matches the value in the request
#
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000001'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000001'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
test_fail
update request {
Connect-Info = 'updated'
}
-sql_postgresql.accounting
+sql.accounting
if (ok) {
test_pass
}
test_fail
}
update {
- Tmp-String-0 := "%{sql_postgresql:SELECT connectinfo_start FROM radacct WHERE AcctSessionId = '00000001'}"
+ Tmp-String-0 := "%{sql:SELECT connectinfo_start FROM radacct WHERE AcctSessionId = '00000001'}"
}
if (!&Tmp-Integer-0 || (&Tmp-String-0 != 'updated')) {
test_fail
# Clear out old data
#
update {
- Tmp-String-0 := "%{sql_postgresql:DELETE FROM radacct WHERE AcctSessionId = '00000002'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000002'}"
}
if (!&Tmp-String-0) {
test_fail
test_pass
}
-sql_postgresql.accounting
+sql.accounting
if (ok) {
test_pass
}
}
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000002'}"
+ Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000002'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
test_fail
}
update {
- Tmp-Integer-0 := "%{sql_postgresql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000002'}"
+ Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000002'}"
}
if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 30)) {
test_fail
# Clear out old data
#
update {
- Tmp-String-0 := "%{sql_postgresql:DELETE FROM radcheck WHERE username = 'foo'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radcheck WHERE username = 'foo'}"
}
if (!&Tmp-String-0) {
test_fail
}
update {
- Tmp-String-0 := "%{sql_postgresql:INSERT INTO radcheck (username, attribute, op, value) VALUES ('foo', 'NAS-IP-Address', '==', '1.2.3.4'), ('foo', 'Cleartext-Password', ':=', 'password')}"
+ 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
}
update {
- Tmp-String-0 := "%{sql_postgresql:DELETE FROM radreply WHERE username = 'foo'}"
+ Tmp-String-0 := "%{sql:DELETE FROM radreply WHERE username = 'foo'}"
}
if (!&Tmp-String-0) {
test_fail
}
update {
- Tmp-String-0 := "%{sql_postgresql:INSERT INTO radreply (username, attribute, op, value) VALUES ('foo', 'Idle-Timeout', ':=', '3600')}"
+ Tmp-String-0 := "%{sql:INSERT INTO radreply (username, attribute, op, value) VALUES ('foo', 'Idle-Timeout', ':=', '3600')}"
}
if (!&Tmp-String-0) {
test_fail
test_pass
}
-sql_postgresql
+sql
-sql sql_postgresql {
+sql {
driver = "rlm_sql_postgresql"
dialect = "postgresql"
password = "radpass"
# Database table configuration for everything except Oracle
- radius_db = "radius"
radius_db = "radius"
acct_table1 = "radacct"