ceph_manager: factorize with get_osd_dump_json

Replace code that duplicates get_osd_dump_json with a call to the
function.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_manager: factorize with get_pool_dump

Replace code that duplicates get_osd_dump_json with a call to the
function.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_manager: fix typo in get_pgid docstring

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_manager: add pool type constants

The osd dump command displays pool types using numerics instead of
symbolic names. Create constants in the CephManager class to use instead
of numbers.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: tests only needs 1 machine

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: keep all json object representation

For erasure coded pools to be tested, the json object representation
must be preserved for all PG because they are all different. The
internal representation is changed from

   db[name]["pgid"] = pg
   db[name]["json"] = objjson

to a per pg map:

   db[name].setdefault("pg2json", {})[pg] = objjson

and the rest of the code is modified to adapt accordingly.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: add hinfo_key tests for erasure coded objects

When an hinfo_key attribute is found, assume an erasure coded object and
verify set-attr/get-attr works as expected by removing its content and
restoring it.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: encapsulate into a function

Move code out of the task into function. Also remove the "REP" specifics
from helper functions that could also be used for erasure coded pools.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: add pgnum option

Instead of hardcoding 12 use a configuration option that defaults to
12. It is handy during development to lower the number to 4 and speed up
the test cycle.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: use CephManager::get_pool_dump

Instead of custom made get_pool_id function.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: only run get/set bytes for replicated pools

It needs to be adapted to run with erasure coded pools.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: run tests on erasure coded pools

Create an erasure coded pool and run tests on it. The list of PGs is
adapted to contain the shard id.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: skip unused osds

When the number of objects is low, some OSDs may not be used at all.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph_objectstore_tool: add assert so that teuthology knows when this test fails

Signed-off-by: David Zafman <dzafman@redhat.com>
ceph_objectstore_tool: nullfd isn't used anymore

Signed-off-by: David Zafman <dzafman@redhat.com>
ceph_objectstore_tool: s/log.errors/log.error/

Signed-off-by: David Zafman <dzafman@redhat.com>
ceph_objectstore_tool: EC pools don't support omap

Signed-off-by: David Zafman <dzafman@redhat.com>
ceph_objectstore_tool: fix flake8 issues

has_key() removed in python 3.x (found by Flake8)

Signed-off-by: David Zafman <dzafman@redhat.com>