This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 2f781a55e1966f19e2d8a9ed7fd2958563e3b9d4 (commit)
via 5e4e136deec466074117525ba672618d2445dbe1 (commit)
from 4866f4e6b9f3c966170f349eb6db74d2ff2d1692 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/2f781a55e1966f19e2d8a9ed7fd2958563e3b9d4
commit 2f781a55e1966f19e2d8a9ed7fd2958563e3b9d4
Author: Jeff Darcy <jdarcy(a)redhat.com>
Date: Mon Oct 4 13:30:01 2010 -0400
More basic tests.
Added some through-the-API result checking to cover metadata.
Added a duplicate-bucket test.
diff --git a/t/basic b/t/basic
index 7e77f94..a7d3b1e 100644
--- a/t/basic
+++ b/t/basic
@@ -134,14 +134,23 @@ wait_for .1 30 "curl -s
http://localhost:$port" curl -X
PUT
http://localhost:$port/b1 || fail=1
test -d FS/b1 || fail=1
+# Try to create a duplicate bucket.
+curl -f -X PUT
http://localhost:$port/b1 2> dup_bucket.err
+grep ' 500$' dup_bucket.err || fail=1
+
# PUT to root; should fail
curl -f -X PUT
http://localhost:$port 2> root_put.err
-grep ' 404' root_put.err || fail=1
+grep ' 404$' root_put.err || fail=1
# Create a file in that bucket.
echo foo | curl -T -
http://localhost:$port/b1/f1 || fail=1
+# Test presence in the FS.
test -f FS/b1/f1 || fail=1
test "$(cat FS/b1/f1)" = foo || fail=1
+# Test through the API as well.
+curl
http://localhost:$port/b1/f1 > f1copy
+test "$(cat f1copy)" = foo || fail=1
+
# Get root; default, then Accept: XML & JSON:
curl
http://localhost:$port > root || fail=1
@@ -153,12 +162,18 @@ compare root root.xml || fail=1
curl -H 'Accept: */json'
http://localhost:$port > root || fail=1
compare root root.json || fail=1
-# Delete an object and ensure that it's gone from the file system.
+# Delete an object.
curl -X DELETE
http://localhost:$port/b1/f1 || fail=1
+# Ensure that it's gone from the file system.
test -f FS/b1/f1 && fail=1
+# Ensure that it's gone in the API as well.
+curl -f
http://localhost:$port/b1/f1 > /dev/null 2> del_object.err
+grep ' 404$' del_object.err || fail=1
# Try to delete a nonexistent object.
-curl -X DELETE
http://localhost:$port/b1/no-such-obj || fail=1
+curl -f -X DELETE
http://localhost:$port/b1/no-such-obj 2> del_nosuch.err
+grep ' 404$' del_nosuch.err || fail=1
+
# ################## Providers
http://repo.or.cz/w/iwhd.git/commit/5e4e136deec466074117525ba672618d2445dbe1
commit 5e4e136deec466074117525ba672618d2445dbe1
Author: Jeff Darcy <jdarcy(a)redhat.com>
Date: Mon Oct 4 11:47:47 2010 -0400
Enhance tests.
Added failure check for "PUT to root" test.
Added "-s -S" to curl commands to kill silly progress bars.
Added rdbuf call in meta.cpp to silence C++ code.
diff --git a/meta.cpp b/meta.cpp
index d6ce8f7..bcbf2f7 100644
--- a/meta.cpp
+++ b/meta.cpp
@@ -120,6 +120,11 @@ RepoMeta::RepoMeta ()
{
char addr[128];
+ if (!verbose) {
+ cout.rdbuf(0);
+ cout << "bite me" << endl;
+ }
+
sprintf(addr,"%s:%u",db_host,db_port);
client.connect(addr);
}
diff --git a/t/basic b/t/basic
index c1aa5e4..7e77f94 100644
--- a/t/basic
+++ b/t/basic
@@ -129,12 +129,14 @@ cleanup_() { kill $mongo_pid $iwhd_pid; }
wait_for .1 30 "curl -s
http://localhost:$port" || { echo iwhd failed to
listen; Exit 1; }
+
# Create an empty bucket.
curl -X PUT
http://localhost:$port/b1 || fail=1
test -d FS/b1 || fail=1
-# Post to root; should fail (but FIXME: how to detect failure?)
-curl -X PUT
http://localhost:$port || fail=1
+# PUT to root; should fail
+curl -f -X PUT
http://localhost:$port 2> root_put.err
+grep ' 404' root_put.err || fail=1
# Create a file in that bucket.
echo foo | curl -T -
http://localhost:$port/b1/f1 || fail=1
diff --git a/t/init.cfg b/t/init.cfg
index f0301d4..863481a 100644
--- a/t/init.cfg
+++ b/t/init.cfg
@@ -6,7 +6,8 @@ stderr_fileno_=9
# Always use curl's -q option, so that a user's .rc settings
# cannot perturb these tests.
-curl() { env curl -q "$@"; }
+# Also add -s and -S to get rid of silly progress bars etc.
+curl() { env curl -q -s -S "$@"; }
wait_for()
{
-----------------------------------------------------------------------
Summary of changes:
meta.cpp | 5 +++++
t/basic | 25 +++++++++++++++++++++----
t/init.cfg | 3 ++-
3 files changed, 28 insertions(+), 5 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")