Skip to content

Commit

Permalink
Merge pull request ceph#51388 from Matan-B/wip-matanb-c-enable-rbd-tests
Browse files Browse the repository at this point in the history
qa/suites/crimson: Enhance rbd api testing

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Radosław Zarzyński <rzarzyns@redhat.com>
  • Loading branch information
Matan-B committed May 11, 2023
2 parents 8391374 + 01958e6 commit 653b97e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 25 deletions.
12 changes: 12 additions & 0 deletions qa/suites/crimson-rados/rbd/tasks/rbd_python_api_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
overrides:
ceph:
log-ignorelist:
- \(SLOW_OPS\)
- slow request
tasks:
- workunit:
clients:
client.0:
- rbd/test_librbd_python.sh --eval-attr 'not (SKIP_IF_CRIMSON)'
env:
RBD_FEATURES: "61"
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ tasks:
- workunit:
clients:
client.0:
- rbd/test_librbd_python.sh
- rbd/test_librbd_python.sh --eval-attr 'not (SKIP_IF_CRIMSON)'
4 changes: 2 additions & 2 deletions qa/workunits/rbd/test_librbd_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ relpath=$(dirname $0)/../../../src/test/pybind
if [ -n "${VALGRIND}" ]; then
valgrind ${VALGRIND} --suppressions=${TESTDIR}/valgrind.supp \
--errors-for-leak-kinds=definite --error-exitcode=1 \
python3 -m nose -v $relpath/test_rbd.py
python3 -m nose -v $relpath/test_rbd.py "$@"
else
python3 -m nose -v $relpath/test_rbd.py
python3 -m nose -v $relpath/test_rbd.py "$@"
fi
exit 0
2 changes: 0 additions & 2 deletions src/test/cls_rbd/test_cls_rbd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include "gtest/gtest.h"
#include "test/librados/test_cxx.h"
#include "test/librados/crimson_utils.h"

#include <errno.h>
#include <string>
Expand Down Expand Up @@ -1798,7 +1797,6 @@ TEST_F(TestClsRbd, mirror_image) {
}

TEST_F(TestClsRbd, mirror_image_status) {
SKIP_IF_CRIMSON();
struct WatchCtx : public librados::WatchCtx2 {
librados::IoCtx *m_ioctx;

Expand Down
3 changes: 0 additions & 3 deletions src/test/librbd/test_Groups.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "test/librbd/test_fixture.h"
#include "test/librbd/test_support.h"
#include "test/librados/crimson_utils.h"
#include "include/rbd/librbd.h"
#include "include/rbd/librbd.hpp"
#include "test/librados/test.h"
Expand Down Expand Up @@ -220,7 +219,6 @@ TEST_F(TestGroup, add_imagePP)

TEST_F(TestGroup, add_snapshot)
{
SKIP_IF_CRIMSON();
REQUIRE_FORMAT_V2();

rados_ioctx_t ioctx;
Expand Down Expand Up @@ -367,7 +365,6 @@ TEST_F(TestGroup, add_snapshot)

TEST_F(TestGroup, add_snapshotPP)
{
SKIP_IF_CRIMSON();
REQUIRE_FORMAT_V2();

librados::IoCtx ioctx;
Expand Down
3 changes: 0 additions & 3 deletions src/test/librbd/test_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ TEST_F(TestInternal, SnapCreateFailsToLockImage) {
}

TEST_F(TestInternal, SnapRollbackLocksImage) {
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

ASSERT_EQ(0, create_snapshot("snap1", false));
Expand Down Expand Up @@ -1182,7 +1181,6 @@ TEST_F(TestInternal, ImageOptions) {
}

TEST_F(TestInternal, WriteFullCopyup) {
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_LAYERING);

librbd::ImageCtx *ictx;
Expand Down Expand Up @@ -1737,7 +1735,6 @@ TEST_F(TestInternal, Sparsify) {


TEST_F(TestInternal, SparsifyClone) {
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_LAYERING);

librbd::ImageCtx *ictx;
Expand Down
12 changes: 0 additions & 12 deletions src/test/librbd/test_librbd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8529,7 +8529,6 @@ TEST_F(TestLibRBD, SnapshotLimitPP)

TEST_F(TestLibRBD, RebuildObjectMapViaLockOwner)
{
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK | RBD_FEATURE_OBJECT_MAP);

librados::IoCtx ioctx;
Expand Down Expand Up @@ -8582,7 +8581,6 @@ TEST_F(TestLibRBD, RebuildObjectMapViaLockOwner)

TEST_F(TestLibRBD, RenameViaLockOwner)
{
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librados::IoCtx ioctx;
Expand Down Expand Up @@ -8623,7 +8621,6 @@ TEST_F(TestLibRBD, RenameViaLockOwner)

TEST_F(TestLibRBD, SnapCreateViaLockOwner)
{
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librados::IoCtx ioctx;
Expand Down Expand Up @@ -8668,7 +8665,6 @@ TEST_F(TestLibRBD, SnapCreateViaLockOwner)

TEST_F(TestLibRBD, SnapRemoveViaLockOwner)
{
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_FAST_DIFF);

librados::IoCtx ioctx;
Expand Down Expand Up @@ -8709,7 +8705,6 @@ TEST_F(TestLibRBD, SnapRemoveViaLockOwner)
}

TEST_F(TestLibRBD, UpdateFeaturesViaLockOwner) {
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librados::IoCtx ioctx;
Expand Down Expand Up @@ -8960,7 +8955,6 @@ TEST_F(TestLibRBD, SnapUnprotectViaLockOwner)

TEST_F(TestLibRBD, FlattenViaLockOwner)
{
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librados::IoCtx ioctx;
Expand Down Expand Up @@ -9009,7 +9003,6 @@ TEST_F(TestLibRBD, FlattenViaLockOwner)

TEST_F(TestLibRBD, ResizeViaLockOwner)
{
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librados::IoCtx ioctx;
Expand Down Expand Up @@ -9046,7 +9039,6 @@ TEST_F(TestLibRBD, ResizeViaLockOwner)

TEST_F(TestLibRBD, SparsifyViaLockOwner)
{
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librados::IoCtx ioctx;
Expand Down Expand Up @@ -9751,7 +9743,6 @@ TEST_F(TestLibRBD, BlockingAIO)

TEST_F(TestLibRBD, ExclusiveLockTransition)
{
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librados::IoCtx ioctx;
Expand Down Expand Up @@ -10425,7 +10416,6 @@ TEST_F(TestLibRBD, FlushCacheWithCopyupOnExternalSnapshot) {

TEST_F(TestLibRBD, ExclusiveLock)
{
SKIP_IF_CRIMSON();
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

static char buf[10];
Expand Down Expand Up @@ -11961,7 +11951,6 @@ TEST_F(TestLibRBD, SnapRemoveWithChildMissing)

TEST_F(TestLibRBD, QuiesceWatch)
{
SKIP_IF_CRIMSON();
rados_ioctx_t ioctx;
rados_ioctx_create(_cluster, m_pool_name.c_str(), &ioctx);

Expand Down Expand Up @@ -12053,7 +12042,6 @@ TEST_F(TestLibRBD, QuiesceWatch)

TEST_F(TestLibRBD, QuiesceWatchPP)
{
SKIP_IF_CRIMSON();
librbd::RBD rbd;
librados::IoCtx ioctx;
ASSERT_EQ(0, _rados.ioctx_create(m_pool_name.c_str(), ioctx));
Expand Down
2 changes: 0 additions & 2 deletions src/test/librbd/test_mirroring.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
#include "test/librbd/test_fixture.h"
#include "test/librbd/test_support.h"
#include "test/librados/crimson_utils.h"
#include "librbd/ExclusiveLock.h"
#include "librbd/ImageState.h"
#include "librbd/ImageWatcher.h"
Expand Down Expand Up @@ -1224,7 +1223,6 @@ TEST_F(TestMirroring, SnapshotRemoveOnDisable)

TEST_F(TestMirroring, SnapshotUnlinkPeer)
{
SKIP_IF_CRIMSON();
REQUIRE_FORMAT_V2();

ASSERT_EQ(0, m_rbd.mirror_mode_set(m_ioctx, RBD_MIRROR_MODE_IMAGE));
Expand Down
3 changes: 3 additions & 0 deletions src/test/pybind/test_rbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from datetime import datetime, timedelta
from nose import with_setup, SkipTest
from nose.plugins.attrib import attr
from nose.tools import eq_ as eq, assert_raises, assert_not_equal
from rados import (Rados,
LIBRADOS_OP_FLAG_FADVISE_DONTNEED,
Expand Down Expand Up @@ -777,6 +778,7 @@ def test_copy3(self):
self._test_copy(features, self.image.stat()['order'],
self.image.stripe_unit(), self.image.stripe_count())

@attr('SKIP_IF_CRIMSON')
def test_deep_copy(self):
global ioctx
global features
Expand Down Expand Up @@ -2029,6 +2031,7 @@ def test_acquire_release_lock(self):
image.lock_acquire(RBD_LOCK_MODE_EXCLUSIVE)
image.lock_release()

@attr('SKIP_IF_CRIMSON')
def test_break_lock(self):
blocklist_rados = Rados(conffile='')
blocklist_rados.connect()
Expand Down

0 comments on commit 653b97e

Please sign in to comment.