summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorApollon Oikonomopoulos <apoikos@debian.org>2016-12-14 23:42:23 +0200
committerApollon Oikonomopoulos <apoikos@debian.org>2016-12-14 23:42:23 +0200
commit3586b859bdf2e736fca734d8f3964fe508d3fbdd (patch)
tree1f6788afdd38e45b6f61b0f395997da54c757d73
parent62cbe5656edf082b8849c626819e1c518de01d74 (diff)
Refactor DEP-8 tests
- Run all "basic" JS tests - Drop the dependency on netcat and nmap
-rw-r--r--debian/tests/basic29
-rw-r--r--debian/tests/control4
-rw-r--r--debian/tests/mongo-client23
3 files changed, 31 insertions, 25 deletions
diff --git a/debian/tests/basic b/debian/tests/basic
new file mode 100644
index 00000000000..2a9e980f90b
--- /dev/null
+++ b/debian/tests/basic
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+set -e
+
+TIMEOUT=120
+
+echo -n "Waiting for mongod to start: "
+count=0
+
+while ! echo 'db.version()' | mongo --quiet >/dev/null; do
+ echo -n "."
+ count=$((count+1))
+ if test $count -gt $TIMEOUT; then
+ echo " mongod failed to start?"
+ pgrep mongod
+ exit 1
+ fi
+ sleep 1
+done
+
+for testfile in jstests/core/basic*.js; do
+ echo
+ echo " -> Running $testfile"
+ mongo --verbose "$testfile" 2>&1
+done
+
+echo
+echo "=================="
+echo "OK"
diff --git a/debian/tests/control b/debian/tests/control
index ebf1d4a8111..92be9ac6e6b 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,2 @@
-Tests: mongod mongo-client
-Depends: mongodb-server, mongodb-clients, nmap, netcat
+Tests: mongod basic
+Depends: mongodb-server, mongodb-clients
diff --git a/debian/tests/mongo-client b/debian/tests/mongo-client
deleted file mode 100644
index 8dbe885803f..00000000000
--- a/debian/tests/mongo-client
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -e
-
-TIMEOUT=120
-
-echo -n "Waiting for mongod to start: "
-count=0
-while (! nc -z 127.0.0.1 27017); do
- echo -n "."
- count=$((count+1))
- if test $count -gt $TIMEOUT; then
- echo "mongod failed to start?"
- pgrep mongod
- exit 1
- fi
- sleep 1
-done
-echo "mongod listening"
-
-echo "Performing basic test using mongo client: "
-mongo --verbose jstests/core/basic1.js 2>&1
-echo "OK"