From: Philippe Wooding Date: Thu, 14 May 2015 20:26:04 +0000 (+0200) Subject: Don't use instance name in SQL module tests. X-Git-Tag: release_3_0_9~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9b90aa3da26fb18dec7782a7fd42cbfc60320a6;p=thirdparty%2Ffreeradius-server.git Don't use instance name in SQL module tests. --- diff --git a/src/tests/modules/sql_mysql/acct_0_start.unlang b/src/tests/modules/sql_mysql/acct_0_start.unlang index 5b4cc81a533..64921b11630 100644 --- a/src/tests/modules/sql_mysql/acct_0_start.unlang +++ b/src/tests/modules/sql_mysql/acct_0_start.unlang @@ -2,7 +2,7 @@ # 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 @@ -11,7 +11,7 @@ else { test_pass } -sql_mysql.accounting +sql.accounting if (ok) { test_pass } @@ -20,7 +20,7 @@ else { } 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 @@ -30,7 +30,7 @@ else { } 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 diff --git a/src/tests/modules/sql_mysql/acct_1_update.unlang b/src/tests/modules/sql_mysql/acct_1_update.unlang index 2eb461a9a11..a2fa8e434d5 100644 --- a/src/tests/modules/sql_mysql/acct_1_update.unlang +++ b/src/tests/modules/sql_mysql/acct_1_update.unlang @@ -1,7 +1,7 @@ # # PRE: acct_0_start # -sql_mysql.accounting +sql.accounting if (ok) { test_pass } @@ -10,7 +10,7 @@ else { } 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 @@ -20,7 +20,7 @@ else { } 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 diff --git a/src/tests/modules/sql_mysql/acct_2_stop.unlang b/src/tests/modules/sql_mysql/acct_2_stop.unlang index 03f95700295..0e319c7ea3a 100644 --- a/src/tests/modules/sql_mysql/acct_2_stop.unlang +++ b/src/tests/modules/sql_mysql/acct_2_stop.unlang @@ -1,7 +1,7 @@ # # PRE: acct_1_update # -sql_mysql.accounting +sql.accounting if (ok) { test_pass } @@ -10,7 +10,7 @@ else { } 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 @@ -20,7 +20,7 @@ else { } 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 diff --git a/src/tests/modules/sql_mysql/acct_start_conflict.unlang b/src/tests/modules/sql_mysql/acct_start_conflict.unlang index f3fabc1c5f9..4280db4e623 100644 --- a/src/tests/modules/sql_mysql/acct_start_conflict.unlang +++ b/src/tests/modules/sql_mysql/acct_start_conflict.unlang @@ -10,7 +10,7 @@ # 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 @@ -22,7 +22,7 @@ else { # # Insert the Accounting-Request start # -sql_mysql.accounting +sql.accounting if (ok) { test_pass } @@ -34,7 +34,7 @@ else { # 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 @@ -47,7 +47,7 @@ else { # 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 @@ -62,7 +62,7 @@ else { update request { Connect-Info = 'updated' } -sql_mysql.accounting +sql.accounting if (ok) { test_pass } @@ -70,7 +70,7 @@ else { 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 diff --git a/src/tests/modules/sql_mysql/acct_update_no_start.unlang b/src/tests/modules/sql_mysql/acct_update_no_start.unlang index 76dd4f4fb32..f5025332155 100644 --- a/src/tests/modules/sql_mysql/acct_update_no_start.unlang +++ b/src/tests/modules/sql_mysql/acct_update_no_start.unlang @@ -6,7 +6,7 @@ # 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 @@ -15,7 +15,7 @@ else { test_pass } -sql_mysql.accounting +sql.accounting if (ok) { test_pass } @@ -24,7 +24,7 @@ else { } 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 @@ -34,7 +34,7 @@ else { } 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 diff --git a/src/tests/modules/sql_mysql/auth.unlang b/src/tests/modules/sql_mysql/auth.unlang index 1d1b93d92e5..361a768fd84 100644 --- a/src/tests/modules/sql_mysql/auth.unlang +++ b/src/tests/modules/sql_mysql/auth.unlang @@ -2,7 +2,7 @@ # 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 @@ -12,7 +12,7 @@ else { } 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 @@ -22,7 +22,7 @@ else { } 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 @@ -32,7 +32,7 @@ else { } 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 @@ -41,4 +41,4 @@ else { test_pass } -sql_mysql +sql diff --git a/src/tests/modules/sql_mysql/module.conf b/src/tests/modules/sql_mysql/module.conf index d8d1b101178..08a327079e3 100644 --- a/src/tests/modules/sql_mysql/module.conf +++ b/src/tests/modules/sql_mysql/module.conf @@ -1,4 +1,4 @@ -sql sql_mysql { +sql { driver = "rlm_sql_mysql" dialect = "mysql" diff --git a/src/tests/modules/sql_postgresql/acct_0_start.unlang b/src/tests/modules/sql_postgresql/acct_0_start.unlang index 51d008152d2..64921b11630 100644 --- a/src/tests/modules/sql_postgresql/acct_0_start.unlang +++ b/src/tests/modules/sql_postgresql/acct_0_start.unlang @@ -2,7 +2,7 @@ # 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 @@ -11,7 +11,7 @@ else { test_pass } -sql_postgresql.accounting +sql.accounting if (ok) { test_pass } @@ -20,7 +20,7 @@ else { } 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 @@ -30,7 +30,7 @@ else { } 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 diff --git a/src/tests/modules/sql_postgresql/acct_1_update.unlang b/src/tests/modules/sql_postgresql/acct_1_update.unlang index 42b211bd580..a2fa8e434d5 100644 --- a/src/tests/modules/sql_postgresql/acct_1_update.unlang +++ b/src/tests/modules/sql_postgresql/acct_1_update.unlang @@ -1,7 +1,7 @@ # # PRE: acct_0_start # -sql_postgresql.accounting +sql.accounting if (ok) { test_pass } @@ -10,7 +10,7 @@ else { } 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 @@ -20,7 +20,7 @@ else { } 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 diff --git a/src/tests/modules/sql_postgresql/acct_2_stop.unlang b/src/tests/modules/sql_postgresql/acct_2_stop.unlang index 7d24635fbfb..44e30c25e70 100644 --- a/src/tests/modules/sql_postgresql/acct_2_stop.unlang +++ b/src/tests/modules/sql_postgresql/acct_2_stop.unlang @@ -1,7 +1,7 @@ # # PRE: acct_1_update # -sql_postgresql.accounting +sql.accounting if (ok) { test_pass } @@ -10,7 +10,7 @@ else { } 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 @@ -20,7 +20,7 @@ else { } 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 @@ -30,7 +30,7 @@ else { } 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 diff --git a/src/tests/modules/sql_postgresql/acct_start_conflict.unlang b/src/tests/modules/sql_postgresql/acct_start_conflict.unlang index c69c88bad73..36db8cc71cc 100644 --- a/src/tests/modules/sql_postgresql/acct_start_conflict.unlang +++ b/src/tests/modules/sql_postgresql/acct_start_conflict.unlang @@ -6,7 +6,7 @@ # 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 @@ -18,7 +18,7 @@ else { # # Insert the Accounting-Request start # -sql_postgresql.accounting +sql.accounting if (ok) { test_pass } @@ -30,7 +30,7 @@ else { # 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 @@ -43,7 +43,7 @@ else { # 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 @@ -58,7 +58,7 @@ else { update request { Connect-Info = 'updated' } -sql_postgresql.accounting +sql.accounting if (ok) { test_pass } @@ -66,7 +66,7 @@ else { 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 diff --git a/src/tests/modules/sql_postgresql/acct_update_no_start.unlang b/src/tests/modules/sql_postgresql/acct_update_no_start.unlang index acffcba746d..7ff75ce6eac 100644 --- a/src/tests/modules/sql_postgresql/acct_update_no_start.unlang +++ b/src/tests/modules/sql_postgresql/acct_update_no_start.unlang @@ -2,7 +2,7 @@ # 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 @@ -11,7 +11,7 @@ else { test_pass } -sql_postgresql.accounting +sql.accounting if (ok) { test_pass } @@ -20,7 +20,7 @@ else { } 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 @@ -30,7 +30,7 @@ else { } 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 diff --git a/src/tests/modules/sql_postgresql/auth.unlang b/src/tests/modules/sql_postgresql/auth.unlang index da5ddae4718..361a768fd84 100644 --- a/src/tests/modules/sql_postgresql/auth.unlang +++ b/src/tests/modules/sql_postgresql/auth.unlang @@ -2,7 +2,7 @@ # 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 @@ -12,7 +12,7 @@ else { } 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 @@ -22,7 +22,7 @@ else { } 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 @@ -32,7 +32,7 @@ else { } 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 @@ -41,4 +41,4 @@ else { test_pass } -sql_postgresql +sql diff --git a/src/tests/modules/sql_postgresql/module.conf b/src/tests/modules/sql_postgresql/module.conf index 7fbda39ac4a..2d2c82cd397 100644 --- a/src/tests/modules/sql_postgresql/module.conf +++ b/src/tests/modules/sql_postgresql/module.conf @@ -1,4 +1,4 @@ -sql sql_postgresql { +sql { driver = "rlm_sql_postgresql" dialect = "postgresql" @@ -10,7 +10,6 @@ sql sql_postgresql { password = "radpass" # Database table configuration for everything except Oracle - radius_db = "radius" radius_db = "radius" acct_table1 = "radacct"