64921b11630c6864e3ce49b5c4aea3bf09967886
[freeradius.git] / src / tests / modules / sql_postgresql / acct_0_start.unlang
1 #
2 #  Clear out old data
3 #
4 update {
5         Tmp-String-0 := "%{sql:DELETE FROM radacct WHERE AcctSessionId = '00000000'}"
6 }
7 if (!&Tmp-String-0) {
8         test_fail
9 }
10 else {
11         test_pass
12 }
13
14 sql.accounting
15 if (ok) {
16         test_pass
17 }
18 else {
19         test_fail
20 }
21
22 update {
23         Tmp-Integer-0 := "%{sql:SELECT count(*) FROM radacct WHERE AcctSessionId = '00000000'}"
24 }
25 if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 1)) {
26         test_fail
27 }
28 else {
29         test_pass
30 }
31
32 update {
33         Tmp-Integer-0 := "%{sql:SELECT acctsessiontime FROM radacct WHERE AcctSessionId = '00000000'}"
34 }
35 if (!&Tmp-Integer-0 || (&Tmp-Integer-0 != 0)) {
36         test_fail
37 }
38 else {
39         test_pass
40 }