crush: add is_v[23]_rule(ruleid) methods

Add methods to check if a *specific* rule uses v2 or v3 features.  Refactor
the existing checks to use these.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 1d95486780a54c85a5c88936a4da4bdc3576a7b8)
osd: only require crush features for rules that are actually used

Often there will be a CRUSH rule present for erasure coding that uses the
new CRUSH steps or indep mode.  If these rules are not referenced by any
pool, we do not need clients to support the mapping behavior.  This is true
because the encoding has not changed; only the expected CRUSH output.

Fixes: #8963
Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 16dadb86e02108e11a970252411855d84ab0a4a2)
unittest_osdmap: create an ec pool in test osdmap

This is part of 7294e8c4df6df9d0898f82bb6e0839ed98149310.

Signed-off-by: Sage Weil <sage@redhat.com>
unittest_osdmap: test EC rule and pool features

TODO: tiering feature bits.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 2f0e2951d773b6acce781b4b991d6d8e817ee2f9)