mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'origin/topic/johanna/sqlite-pragmas'
* origin/topic/johanna/sqlite-pragmas: Options for SQLite log writer, eliminate duplicate definitions Test synchronous/journal mode options for SQLite log writer Added default options for synchronous and journal mode Support for synchronous and journal_mode
This commit is contained in:
commit
7b582bc345
10 changed files with 165 additions and 3 deletions
|
@ -0,0 +1,28 @@
|
|||
# This test exercises the SQLIte pragmas for synchronous and jornal_mode.
|
||||
# Sadly, most of these do not have a way to test that they succeeded. So
|
||||
# we mostly do the inverse test - if there are no error messages in .stderr
|
||||
# everything should be fine.
|
||||
#
|
||||
# We can test for WAL journaling mode, as this persists and can be queried from
|
||||
# the sqlite file.
|
||||
|
||||
# @TEST-REQUIRES: which sqlite3
|
||||
# @TEST-REQUIRES: has-writer Zeek::SQLiteWriter
|
||||
# @TEST-GROUP: sqlite
|
||||
#
|
||||
# @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT Log::default_writer=Log::WRITER_SQLITE LogSQLite::synchronous=LogSQLite::SQLITE_SYNCHRONOUS_EXTRA LogSQLite::journal_mode=LogSQLite::SQLITE_JOURNAL_MODE_DELETE
|
||||
# @TEST-EXEC: echo "Should be delete" > results
|
||||
# @TEST-EXEC: sqlite3 http.sqlite "PRAGMA journal_mode" >> results
|
||||
# @TEST-EXEC: rm http.sqlite
|
||||
# @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT Log::default_writer=Log::WRITER_SQLITE LogSQLite::synchronous=LogSQLite::SQLITE_SYNCHRONOUS_OFF LogSQLite::journal_mode=LogSQLite::SQLITE_JOURNAL_MODE_TRUNCATE
|
||||
# @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT Log::default_writer=Log::WRITER_SQLITE LogSQLite::synchronous=LogSQLite::SQLITE_SYNCHRONOUS_NORMAL LogSQLite::journal_mode=LogSQLite::SQLITE_JOURNAL_MODE_PERSIST
|
||||
# @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT Log::default_writer=Log::WRITER_SQLITE LogSQLite::synchronous=LogSQLite::SQLITE_SYNCHRONOUS_EXTRA LogSQLite::journal_mode=LogSQLite::SQLITE_JOURNAL_MODE_MEMORY
|
||||
# @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT Log::default_writer=Log::WRITER_SQLITE LogSQLite::synchronous=LogSQLite::SQLITE_SYNCHRONOUS_EXTRA LogSQLite::journal_mode=LogSQLite::SQLITE_JOURNAL_MODE_WAL
|
||||
# @TEST-EXEC: echo "Should be WAL" >> results
|
||||
# @TEST-EXEC: sqlite3 http.sqlite "PRAGMA journal_mode" >> results
|
||||
# @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT Log::default_writer=Log::WRITER_SQLITE LogSQLite::synchronous=LogSQLite::SQLITE_SYNCHRONOUS_FULL LogSQLite::journal_mode=LogSQLite::SQLITE_JOURNAL_MODE_OFF
|
||||
# @TEST-EXEC: btest-diff results
|
||||
# @TEST-EXEC: echo "end of stderr" >> .stderr # grep -v returns false on empty output
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER='grep -v tablename' btest-diff .stderr
|
||||
|
||||
@load base/protocols/http
|
Loading…
Add table
Add a link
Reference in a new issue