From 0838e1d193cae90ff318a373a401897b606d1164 Mon Sep 17 00:00:00 2001 From: Nick Porter Date: Wed, 17 Apr 2024 15:33:34 +0100 Subject: [PATCH] Update SQL tests to call correct accounting section 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 | 9 ++++----- src/tests/modules/sql/acct_1_update.unlang | 9 ++++----- src/tests/modules/sql/acct_2_stop.unlang | 9 ++++----- src/tests/modules/sql/acct_start_conflict.unlang | 16 ++++++---------- .../modules/sql/acct_update_no_start.unlang | 2 +- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/tests/modules/sql/acct_0_start.unlang b/src/tests/modules/sql/acct_0_start.unlang index 56525a7d4d..0a8394ee86 100644 --- a/src/tests/modules/sql/acct_0_start.unlang +++ b/src/tests/modules/sql/acct_0_start.unlang @@ -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 diff --git a/src/tests/modules/sql/acct_1_update.unlang b/src/tests/modules/sql/acct_1_update.unlang index f892d6354e..5bf5915dc1 100644 --- a/src/tests/modules/sql/acct_1_update.unlang +++ b/src/tests/modules/sql/acct_1_update.unlang @@ -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 diff --git a/src/tests/modules/sql/acct_2_stop.unlang b/src/tests/modules/sql/acct_2_stop.unlang index 83b64e906d..1c705d933b 100644 --- a/src/tests/modules/sql/acct_2_stop.unlang +++ b/src/tests/modules/sql/acct_2_stop.unlang @@ -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 diff --git a/src/tests/modules/sql/acct_start_conflict.unlang b/src/tests/modules/sql/acct_start_conflict.unlang index 88259cdc0c..a324b18ac5 100644 --- a/src/tests/modules/sql/acct_start_conflict.unlang +++ b/src/tests/modules/sql/acct_start_conflict.unlang @@ -10,11 +10,8 @@ # # 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 diff --git a/src/tests/modules/sql/acct_update_no_start.unlang b/src/tests/modules/sql/acct_update_no_start.unlang index 87c8ce667d..f1ce632ef6 100644 --- a/src/tests/modules/sql/acct_update_no_start.unlang +++ b/src/tests/modules/sql/acct_update_no_start.unlang @@ -3,7 +3,7 @@ # %sql("${delete_from_radacct} '00000004'") -sql.accounting +sql.accounting.interim-update if (!ok) { test_fail } -- 2.47.3