zeek/testing/btest/zeek-aux/zeek-cut/time-conversion.test
Tim Wojtulewicz d7ba381d12 Adapt zeek-aux btests to zeek structure
This updates Baselines, changes paths to scripts and log files, adds TEST-DOC
annotations, and various other cleanups that make the zeek-aux tests more like
the rest of the zeek tests.
2025-09-11 13:00:53 -07:00

42 lines
1.7 KiB
Text

# @TEST-DOC: Test zeek-cut with time conversion options (-d/-u).
#
# Test -d option.
# @TEST-EXEC: cat ${ZEEK_AUX_LOGS}/conn.log | zeek-cut -d > local
# @TEST-EXEC: btest-diff local
# Test -u option.
# @TEST-EXEC: cat ${ZEEK_AUX_LOGS}/conn.log | zeek-cut -u > utc
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/zeek-aux/diff-time-zone btest-diff utc
# Test that -u can override -d.
# @TEST-EXEC: cat ${ZEEK_AUX_LOGS}/conn.log | zeek-cut -d -u > both-1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/zeek-aux/diff-time-zone btest-diff both-1
# Test that -d can override -u.
# @TEST-EXEC: cat ${ZEEK_AUX_LOGS}/conn.log | zeek-cut -u -d > both-2
# @TEST-EXEC: btest-diff both-2
# First time value is zero.
# @TEST-EXEC: cat ${ZEEK_AUX_LOGS}/zerotime.log | zeek-cut -u > zero
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/zeek-aux/diff-time-zone btest-diff zero
# File has timestamp, but not in the first column.
# @TEST-EXEC: cat ${ZEEK_AUX_LOGS}/conntimelast.log | zeek-cut -d > time-last-col
# @TEST-EXEC: btest-diff time-last-col
# File has more than one time column, and some timestamps are duplicates.
# @TEST-EXEC: cat ${ZEEK_AUX_LOGS}/multiple-times.log | zeek-cut -d > multiple-times
# @TEST-EXEC: btest-diff multiple-times
# Column order changes between two log files.
# @TEST-EXEC: cat ${ZEEK_AUX_LOGS}/conn.log ${ZEEK_AUX_LOGS}/conntimelast.log | zeek-cut -d > different-col-order
# @TEST-EXEC: btest-diff different-col-order
# File has no timestamps.
# @TEST-EXEC: cat ${ZEEK_AUX_LOGS}/onecolumn.log | zeek-cut -d > no-timestamps
# @TEST-EXEC: btest-diff no-timestamps
# Input is missing the log header lines.
# @TEST-EXEC: grep -v '^#' ${ZEEK_AUX_LOGS}/conn.log | zeek-cut -d > missing-header
# @TEST-EXEC: btest-diff missing-header