1#!/bin/bash
2
3run_test ./drive_tailer preview nonexistent-file
4
5check_error_output "preview of nonexistent-file failed?" <<EOF
6preview error: nonexistent-file -- error: cannot open nonexistent-file -- No such file or directory
7tailer stderr:
8info: load preview request -- 1234
9info: exiting...
10EOF
11
12run_test ./drive_tailer preview ${test_dir}/logfile_access_log.0
13
14check_output "preview of file failed?" <<EOF
15preview of file: {test_dir}/logfile_access_log.0
16192.168.202.254 - - [20/Jul/2009:22:59:26 +0000] "GET /vmw/cgi/tramp HTTP/1.0" 200 134 "-" "gPXE/0.9.7"
17192.168.202.254 - - [20/Jul/2009:22:59:29 +0000] "GET /vmw/vSphere/default/vmkboot.gz HTTP/1.0" 404 46210 "-" "gPXE/0.9.7"
18192.168.202.254 - - [20/Jul/2009:22:59:29 +0000] "GET /vmw/vSphere/default/vmkernel.gz HTTP/1.0" 200 78929 "-" "gPXE/0.9.7"
19
20all done!
21tailer stderr:
22info: load preview request -- 1234
23info: exiting...
24EOF
25
26run_test ./drive_tailer preview "${test_dir}/remote-log-dir/*"
27
28check_output "preview of file failed?" <<EOF
29preview of file: {test_dir}/remote-log-dir/*
30{test_dir}/remote-log-dir/logfile_access_log.0
31{test_dir}/remote-log-dir/logfile_access_log.1
32
33all done!
34tailer stderr:
35info: load preview request -- 1234
36info: exiting...
37EOF
38
39run_test ./drive_tailer possible "${test_dir}/logfile_access_log.*"
40
41check_output "possible path list failed?" <<EOF
42possible path: {test_dir}/logfile_access_log.0
43possible path: {test_dir}/logfile_access_log.1
44all done!
45tailer stderr:
46complete path: {test_dir}/logfile_access_log.*
47complete glob path: {test_dir}/logfile_access_log.*
48info: exiting...
49EOF
50
51ln -sf bar foo
52
53run_test ./drive_tailer open foo
54
55check_output "open link not working?" <<EOF
56link value: foo -> bar
57all done!
58tailer stderr:
59info: monitoring path: foo
60info: exiting...
61EOF
62