summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/mongotop/smoke.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/gotools/mongotop/smoke.sh')
-rwxr-xr-xsrc/mongo/gotools/mongotop/smoke.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mongo/gotools/mongotop/smoke.sh b/src/mongo/gotools/mongotop/smoke.sh
new file mode 100755
index 00000000000..5f0d8980f02
--- /dev/null
+++ b/src/mongo/gotools/mongotop/smoke.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+set -e
+
+if ! [ -a mongotop ]
+then
+ echo "need a mongotop binary in the same directory as the smoke script"
+ exit 1
+fi
+
+chmod 755 mongotop
+
+./mongotop > output.out &
+mongotop_pid=$!
+
+sleep 5
+
+kill $mongotop_pid
+
+headers=( "ns" "total" "read" "write" )
+for header in "${headers[@]}"
+do
+ if [ `head -2 output.out | grep -c $header` -ne 1 ]
+ then
+ echo "header row doesn't contain $header"
+ exit 1
+ fi
+done
+
+if [ `head -5 output.out | grep -c ms` -ne 3 ]
+then
+ echo "subsequent lines don't contain ms totals"
+ exit 1
+fi