File: tests

package info (click to toggle)
pgauditlogtofile 1.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 292 kB
  • sloc: ansic: 1,207; makefile: 21; sql: 11; sh: 7
file content (34 lines) | stat: -rw-r--r-- 1,085 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,7 @@ OBJS = pgauditlogtofile.o logtofile.o lo
 EXTENSION = pgauditlogtofile
 DATA = pgauditlogtofile--1.0.sql pgauditlogtofile--1.0--1.2.sql pgauditlogtofile--1.2--1.3.sql pgauditlogtofile--1.3--1.4.sql pgauditlogtofile--1.4--1.5.sql pgauditlogtofile--1.5--1.6.sql pgauditlogtofile--1.6--1.7.sql
 PGFILEDESC = "pgAuditLogToFile - An addon for pgAudit logging extension for PostgreSQL"
+REGRESS = logtofile
 
 # PG_LDFLAGS = -lz
 
--- /dev/null
+++ b/expected/logtofile.out
@@ -0,0 +1,11 @@
+-- truncate log file before test
+create table foo (t text);
+copy foo from program 'sh -c "> /tmp/pgauditlogtofile"';
+select 1\g
+ ?column? 
+----------
+        1
+(1 row)
+
+\! grep -o 'SESSION.*' /tmp/pgauditlogtofile
+SESSION","3","1","READ","SELECT","","select 1,<not logged>",,,,,,,,,"pg_regress/logtofile"
--- /dev/null
+++ b/sql/logtofile.sql
@@ -0,0 +1,7 @@
+-- truncate log file before test
+create table foo (t text);
+copy foo from program 'sh -c "> /tmp/pgauditlogtofile"';
+
+select 1\g
+
+\! grep -o 'SESSION.*' /tmp/pgauditlogtofile