summaryrefslogtreecommitdiffstats
path: root/test/test_curl.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/test_curl.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/test_curl.sh b/test/test_curl.sh
new file mode 100644
index 0000000..be3d1cd
--- /dev/null
+++ b/test/test_curl.sh
@@ -0,0 +1,48 @@
+#! /bin/bash
+
+if test x"$SFTP_TEST_URL" == x""; then
+ exit 0
+fi
+
+run_test ${lnav_test} -n \
+ file://${test_dir}/logfile_access_log.0
+
+check_output "file URL is not working" <<EOF
+192.168.202.254 - - [20/Jul/2009:22:59:26 +0000] "GET /vmw/cgi/tramp HTTP/1.0" 200 134 "-" "gPXE/0.9.7"
+192.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"
+192.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"
+EOF
+
+cp ${test_dir}/logfile_access_log.0 curl_access_log.0
+
+run_test ${lnav_test} -n \
+ $SFTP_TEST_URL/`pwd`/curl_access_log.0
+
+check_output "sftp URL is not working" <<EOF
+192.168.202.254 - - [20/Jul/2009:22:59:26 +0000] "GET /vmw/cgi/tramp HTTP/1.0" 200 134 "-" "gPXE/0.9.7"
+192.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"
+192.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"
+EOF
+
+run_test ${lnav_test} -n \
+ -c ":poll-now" \
+ -c ":shexec echo foo >> curl_access_log.0" \
+ $SFTP_TEST_URL/`pwd`/curl_access_log.0
+
+check_output "sftp URL is not working" <<EOF
+192.168.202.254 - - [20/Jul/2009:22:59:26 +0000] "GET /vmw/cgi/tramp HTTP/1.0" 200 134 "-" "gPXE/0.9.7"
+192.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"
+192.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"
+foo
+EOF
+
+run_test ${lnav_test} -n \
+ -c ":open $SFTP_TEST_URL/`pwd`/curl_access_log.0" \
+ ${test_dir}/logfile_empty.0
+
+check_output "sftp URL is not working" <<EOF
+192.168.202.254 - - [20/Jul/2009:22:59:26 +0000] "GET /vmw/cgi/tramp HTTP/1.0" 200 134 "-" "gPXE/0.9.7"
+192.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"
+192.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"
+foo
+EOF