Skip to content

Commit

Permalink
Rename testdb to harness.
Browse files Browse the repository at this point in the history
  • Loading branch information
niemeyer committed Mar 3, 2016
1 parent dae7702 commit 37d465b
Show file tree
Hide file tree
Showing 64 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
startdb:
@testdb/setup.sh start
@harness/setup.sh start

stopdb:
@testdb/setup.sh stop
@harness/setup.sh stop
2 changes: 1 addition & 1 deletion auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ func (s *S) TestAuthX509Cred(c *C) {
c.Skip("server does not support SSL")
}

clientCertPEM, err := ioutil.ReadFile("testdb/client.pem")
clientCertPEM, err := ioutil.ReadFile("harness/client.pem")
c.Assert(err, IsNil)

clientCert, err := tls.X509KeyPair(clientCertPEM, clientCertPEM)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions testdb/setup.sh → harness/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
LINE="---------------"

start() {
mkdir _testdb
cd _testdb
mkdir _harness
cd _harness
echo keyfile > keyfile
chmod 600 keyfile
cp ../testdb/server.pem server.pem
cp -a ../testdb/daemons .
cp ../harness/server.pem server.pem
cp -a ../harness/daemons .
if ! mongod --help | grep -q -- --ssl; then
rm -rf daemons/db3
fi
Expand All @@ -27,18 +27,18 @@ start() {
echo "$UP processes up..."
if [ x$COUNT = x$UP ]; then
echo "Running setup.js with mongo..."
mongo --nodb ../testdb/init.js
mongo --nodb ../harness/init.js
exit 0
fi
sleep 1
done
echo "Failed to start processes. svstat _testdb/daemons/* output:"
echo "Failed to start processes. svstat _harness/daemons/* output:"
echo $LINE
svstat daemons/*
echo $LINE
for DAEMON in daemons/*; do
if $(svstat $DAEMON | grep ' up ' | grep ' [0-3] seconds' > /dev/null); then
echo "Logs for _testdb/$DAEMON:"
echo "Logs for _harness/$DAEMON:"
echo $LINE
cat $DAEMON/log/log.txt
echo $LINE
Expand All @@ -48,8 +48,8 @@ start() {
}

stop() {
if [ -d _testdb ]; then
cd _testdb
if [ -d _harness ]; then
cd _harness
if [ -f svscan.pid ]; then
kill -9 $(cat svscan.pid) 2> /dev/null || true
svc -dx daemons/* daemons/*/log > /dev/null 2>&1 || true
Expand All @@ -67,7 +67,7 @@ stop() {
echo "Done."
fi
cd ..
rm -rf _testdb
rm -rf _harness
fi
}

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (s *S) SetUpSuite(c *C) {
}

func (s *S) SetUpTest(c *C) {
err := run("mongo --nodb testdb/dropall.js")
err := run("mongo --nodb harness/dropall.js")
if err != nil {
panic(err.Error())
}
Expand Down Expand Up @@ -142,7 +142,7 @@ func (s *S) Stop(host string) {
// Give a moment for slaves to sync and avoid getting rollback issues.
panicOnWindows()
time.Sleep(2 * time.Second)
err := run("svc -d _testdb/daemons/" + supvName(host))
err := run("svc -d _harness/daemons/" + supvName(host))
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -185,8 +185,8 @@ func (s *S) Thaw(host string) {
func (s *S) StartAll() {
if s.stopped {
// Restart any stopped nodes.
run("svc -u _testdb/daemons/*")
err := run("mongo --nodb testdb/wait.js")
run("svc -u _harness/daemons/*")
err := run("mongo --nodb harness/wait.js")
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 37d465b

Please sign in to comment.