rgw: add compatibility for MultipartUpload

Fixes: #6677
It seems that there's some external library that uses MultipartUpload
instead of CompleteMultipartUpload, even though it's not part of the
documented api. Support it.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
doc: Added documenting Ceph to the toc tree.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Added Documenting Ceph (draft) document.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: add-or-rm-mons.rst: better explanation on number of monitors

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
doc: Adding more information on style and usage for documenting Ceph.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Incorporated feedback.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
rgw: set bucket permissions, cors on swift creation

Fixes: #7271
Swift bucket creation was ignoring the x-container-read,
x-container-write and the various cors related headers. Now going
through the same logic that bucket modify goes.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
common: ping existing admin socket before unlink

When a daemon initializes it tries to create an admin socket and unlinks
any pre-existing file, regardless. If such a file is in use, it causes
the existing daemon to loose its admin socket.

The AdminSocketClient::ping is implemented to probe an existing socket,
using the "0" message. The AdminSocket::bind_and_listen function is
modified to call ping() on when it finds existing file. It unlinks the
file only if the ping fails.

http://tracker.ceph.com/issues/7188 fixes: #7188

Backport: emperor, dumpling
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
Merge pull request #1246 from dachary/wip-7188

common: ping existing admin socket before unlink
Objecter: keep ObjectOperation rval pointers for writes

Just before sending an op, prepare_mutate_op() is called, creating a
new Op. prepare_read_op() already copied over all the out-params
correctly, but for write operations the individual op return value
pointers were not copied, so they would not be filled in. With this
fixed, librados users can get the per-op return codes again.

Partially fixes: #6483
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
test/librados: move test.cc into its own library

This way it doesn't have to be compiled many times, and it's easier
to add new general functionality to new files without adding those
.cc files to every test program.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
test/librados: create general test case classes

Using a test case allows us to remove a boatload of boilerplate code
in all the tests, and focus them more on what they're actually
testing.

Create one for C tests, and one for C++ tests, with the same
functionality:

- create a pool when the test case starts
- between individual tests, create an ioctx and set its namespace uniquely
- delete objects from the default namespace during individual test teardown
- delete the pool only when the whole test case is finished

In gtest, a test case is the whole set of tests declared as part of
the same class using TEST_F(). Many tests create and delete individual
pools, but this is unnecessary for independent operation in most
cases, since we can use namespaces for that now. Since pool creation
and deletion dominates test run time, using these test cases makes
running many of the tests much faster.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
test/librados: add a connect_cluster() helper

This mirrors the c++ version, connect_cluster_pp(), and removes the
same code from create_one_pool().

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
test/librados: use connect_cluster_pp() instead of duplicating it

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
test/librados/cmd: remove unnecessary pool creation

Several tests here don't use the pool at all.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
test/librados: use a test case instead of duplicating code everywhere

These tests don't have any special requirements on their ioctx and
pools, so they can also run much faster by using different namespaces
per test instead of new pools. For the few tests that do depend on
namespace, reset the ioctx to the default namespace.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
test/librados: use standard rados test case for snapshot tests

Split these into two categories, self-managed and pool snapshots,
since they are mutually exclusive for a single pool. Remove snapshots
and objects at the end of tests, regardless of pass/fail, so the same
pool can be reused.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
test/librados: refactor setup/teardown in tiering tests

These tests can either use the standard RadosTest, with one pool, or a
new test case with two pools.

The new test case has to copy a couple lines in static methods
(working around lack of virtual static methods is more complex than
it's worth here), but the rest is straight forward. Rename
base_pool_name and base_ioctx to pool_name and ioctx to match the
member variables of the parent class RadosTest.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
test/librados: add ObjectReadOperation tests

These will help prevent regressions and demonstrate what should be
expected by the c api.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librados: add section docs for object operations

The doxygen end section of watch notify was accidentally moved when
these were added, so fix that at the same time.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>