]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Update SQL tests to call correct accounting section
authorNick Porter <nick@portercomputing.co.uk>
Wed, 17 Apr 2024 14:33:34 +0000 (15:33 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Tue, 23 Apr 2024 09:47:07 +0000 (10:47 +0100)
Accounting query selection is now driven by the section being processed
rather than expansion of a reference which included the Acct-Status-Type

src/tests/modules/sql/acct_0_start.unlang
src/tests/modules/sql/acct_1_update.unlang
src/tests/modules/sql/acct_2_stop.unlang
src/tests/modules/sql/acct_start_conflict.unlang
src/tests/modules/sql/acct_update_no_start.unlang

index 56525a7d4ddd0b6db4e15f01b6cac06f50ddd857..0a8394ee8630dc20cd382f9c86107d9b278a5cc7 100644 (file)
@@ -4,11 +4,8 @@
 
 %sql("${delete_from_radacct} '00000000'")
 
-sql.accounting
-if (ok) {
-       test_pass
-}
-else {
+sql.accounting.start
+if !(ok) {
        test_fail
 }
 
@@ -19,3 +16,5 @@ if (%sql("SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'") != "1"
 if (%sql("SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'") != "0") {
        test_fail
 }
+
+test_pass
index f892d6354e4a11477a7ce226b3cbb86f630b3ae5..5bf5915dc112889daafdbafd23070470399b08a4 100644 (file)
@@ -1,11 +1,8 @@
 #
 #  PRE: acct_0_start
 #
-sql.accounting
-if (ok) {
-       test_pass
-}
-else {
+sql.accounting.interim-update
+if !(ok) {
        test_fail
 }
 
@@ -16,3 +13,5 @@ if (%sql("SELECT count(*) FROM radacct WHERE AcctSessionId = '00000001'") != "1"
 if (%sql("SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000001'") != "30") {
        test_pass
 }
+
+test_pass
index 83b64e906d3a2afa7f44005a6f993a11ddf7c309..1c705d933b7751c8b1382c9fff4d763a1edcc4e7 100644 (file)
@@ -1,11 +1,8 @@
 #
 #  PRE: acct_1_update
 #
-sql.accounting
-if (ok) {
-       test_pass
-}
-else {
+sql.accounting.stop
+if !(ok) {
        test_fail
 }
 
@@ -20,3 +17,5 @@ if(%sql("SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000002'")
 if(%sql("SELECT AcctTerminateCause FROM radacct WHERE AcctSessionId = '00000002'") != 'User-Request') {
        test_fail
 }
+
+test_pass
index 88259cdc0c36b19b1fac60a7dff0a7b4feba26a7..a324b18ac5227492ebb638ebfc136bdb428eb049 100644 (file)
 #
 #  Insert the Accounting-Request start
 #
-sql.accounting
-if (ok) {
-       test_pass
-}
-else {
+sql.accounting.start
+if !(ok) {
        test_fail
 }
 
@@ -37,14 +34,13 @@ if (%sql("SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000003'")
 #
 &Connect-Info = 'updated'
 
-sql.accounting
-if (ok) {
-       test_pass
-}
-else {
+sql.accounting.start
+if !(ok) {
        test_fail
 }
 
 if (%sql("SELECT connectinfo_start FROM radacct WHERE AcctSessionId = '00000003'") != 'updated') {
        test_fail
 }
+
+test_pass
index 87c8ce667db100d1053fab59aafafcc99c25910e..f1ce632ef6b12ecec5bdaed059861230de5396cf 100644 (file)
@@ -3,7 +3,7 @@
 #
 %sql("${delete_from_radacct} '00000004'")
 
-sql.accounting
+sql.accounting.interim-update
 if (!ok) {
        test_fail
 }