]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: print difference if deep-copy or migration test fails
authorMykola Golub <mgolub@suse.com>
Wed, 2 Dec 2020 09:41:13 +0000 (09:41 +0000)
committerJason Dillaman <dillaman@redhat.com>
Fri, 19 Feb 2021 15:06:45 +0000 (10:06 -0500)
It may appear to be useful to track the sporadic test failures
observed on jenkins, not reproducible locally.

Previously it was disabled because the output could be too
large. But after the hexdump was improved to skip repeating bytes
the output will hopefully be much smaller.

Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit bb77f740df749de1bba0e91b03c4eb23d5586e43)

src/test/librbd/test_DeepCopy.cc
src/test/librbd/test_Migration.cc

index 2f02b53415df68283fb69baf7c2561782742626b..06498a506ecfba5d753f70d0ad2f5a9c1afb3ac2 100644 (file)
@@ -118,8 +118,8 @@ struct TestDeepCopy : public TestFixture {
           std::cout << "snap: " << (src_snap_name ? src_snap_name : "null")
                     << ", block " << offset << "~" << read_size << " differs"
                     << std::endl;
-          // std::cout << "src block: " << std::endl; src_bl.hexdump(std::cout);
-          // std::cout << "dst block: " << std::endl; dst_bl.hexdump(std::cout);
+          std::cout << "src block: " << std::endl; src_bl.hexdump(std::cout);
+          std::cout << "dst block: " << std::endl; dst_bl.hexdump(std::cout);
         }
         EXPECT_TRUE(src_bl.contents_equal(dst_bl));
         offset += read_size;
index 45b8ec2bb4abb0542deb45a3680c35cb0c7ea2ad..dab75a0241d8307f4ae853756dec9a32ffcb2d03 100644 (file)
@@ -140,11 +140,8 @@ struct TestMigration : public TestFixture {
         std::cout << description
                   << ", block " << offset << "~" << read_size << " differs"
                   << std::endl;
-        char *c = getenv("TEST_RBD_MIGRATION_VERBOSE");
-        if (c != NULL && *c != '\0') {
-          std::cout << "src block: " << src_ictx->id << ": " << std::endl; src_bl.hexdump(std::cout);
-          std::cout << "dst block: " << dst_ictx->id << ": " << std::endl; dst_bl.hexdump(std::cout);
-        }
+        std::cout << "src block: " << src_ictx->id << ": " << std::endl; src_bl.hexdump(std::cout);
+        std::cout << "dst block: " << dst_ictx->id << ": " << std::endl; dst_bl.hexdump(std::cout);
       }
       EXPECT_TRUE(src_bl.contents_equal(dst_bl));
       offset += read_size;