From: Nick Porter Date: Fri, 9 May 2025 13:14:14 +0000 (+0100) Subject: SQL tests are independent X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=489ab5ce43f551b0fb125e19295e02192e2a94df;p=thirdparty%2Ffreeradius-server.git SQL tests are independent So the PRE entry won't actually insert the record which we want to update. --- diff --git a/src/tests/modules/sql/acct_1_update.attrs b/src/tests/modules/sql/acct_1_update.attrs index a1d2eaad287..1b834c2dd47 100644 --- a/src/tests/modules/sql/acct_1_update.attrs +++ b/src/tests/modules/sql/acct_1_update.attrs @@ -14,7 +14,7 @@ Acct-Output-Octets = 10 Acct-Session-Id = '00000001' Acct-Unique-Session-Id = '00000001' Acct-Authentic = RADIUS -Acct-Session-Time = 30 +Acct-Session-Time = 0 Acct-Input-Packets = 10 Acct-Output-Packets = 10 Acct-Input-Gigawords = 1 diff --git a/src/tests/modules/sql/acct_1_update.unlang b/src/tests/modules/sql/acct_1_update.unlang index 5bf5915dc11..ba327e09a34 100644 --- a/src/tests/modules/sql/acct_1_update.unlang +++ b/src/tests/modules/sql/acct_1_update.unlang @@ -1,6 +1,15 @@ # -# PRE: acct_0_start +# The SQL tests are independent - so we fake a "Start" before running the I-U # +%sql("${delete_from_radacct} '00000001'") + +sql.accounting.start +if !(ok) { + test_fail +} + +Acct-Session-Time = 30 + sql.accounting.interim-update if !(ok) { test_fail