]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Use remote.run_unit_test for gtests xml-scanner
authorVallari Agrawal <val.agl002@gmail.com>
Sun, 5 Mar 2023 09:52:36 +0000 (15:22 +0530)
committerVallari Agrawal <val.agl002@gmail.com>
Wed, 8 Mar 2023 10:25:52 +0000 (15:55 +0530)
Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
qa/tasks/workunit.py
qa/workunits/rados/test.sh
src/test/librados/misc_cxx.cc

index 92c5780f90ea09a7c0cb7c7f8846a3ad8ee9808c..a6a12e27e4e5f16453176ab5f3525486c2cda775 100644 (file)
@@ -388,6 +388,7 @@ def _run_tests(ctx, refspec, role, tests, env, basedir,
                 raise RuntimeError('Spec did not match any workunits: {spec!r}'.format(spec=spec))
             for workunit in to_run:
                 log.info('Running workunit %s...', workunit)
+                output_xml = f'{testdir}/archive/'
                 args = [
                     'mkdir', '-p', '--', scratch_tmp,
                     run.Raw('&&'),
@@ -421,10 +422,11 @@ def _run_tests(ctx, refspec, role, tests, env, basedir,
                         workunit=workunit,
                     ),
                 ])
-                remote.run(
+                remote.run_unit_test(
                     logger=log.getChild(role),
                     args=args + optional_args,
-                    label="workunit test {workunit}".format(workunit=workunit)
+                    label="workunit test {workunit}".format(workunit=workunit),
+                    unittest_xml=output_xml
                 )
                 if cleanup:
                     args=['sudo', 'rm', '-rf', '--', scratch_tmp]
index daa25fe4dfd8a32f4f1e7b7091020581e357f413..a88826cf619cb2a12dde0dd06d2b40fd6d25f6a5 100755 (executable)
@@ -12,6 +12,8 @@ function cleanup() {
 }
 trap cleanup EXIT ERR HUP INT QUIT
 
+GTEST_OUTPUT="xml:/home/ubuntu/cephtest/archive/gtest_xml_report"
+
 declare -A pids
 
 for f in \
@@ -37,7 +39,7 @@ do
     if [ $parallel -eq 1 ]; then
        r=`printf '%25s' $f`
        ff=`echo $f | awk '{print $1}'`
-       bash -o pipefail -exc "ceph_test_rados_$f $color 2>&1 | tee ceph_test_rados_$ff.log | sed \"s/^/$r: /\"" &
+       bash -o pipefail -exc "ceph_test_rados_$f --gtest_output=$GTEST_OUTPUT-$f.xml $color 2>&1 | tee ceph_test_rados_$ff.log | sed \"s/^/$r: /\"" &
        pid=$!
        echo "test $f on pid $pid"
        pids[$f]=$pid
index 545d5e57bdff8dbf749010dd5d9a17870be20578..92c5559c92b781d5ca6dc1d070d8aab6f2dc690c 100644 (file)
@@ -42,9 +42,9 @@ TEST_F(LibRadosMiscPP, LongNamePP) {
   bufferlist bl;
   bl.append("content");
   int maxlen = g_conf()->osd_max_object_name_len;
-  ASSERT_EQ(0, ioctx.write(string(maxlen/2, 'a').c_str(), bl, bl.length(), 0));
-  ASSERT_EQ(0, ioctx.write(string(maxlen-1, 'a').c_str(), bl, bl.length(), 0));
-  ASSERT_EQ(0, ioctx.write(string(maxlen, 'a').c_str(), bl, bl.length(), 0));
+  ASSERT_EQ(10, ioctx.write(string(maxlen/2, 'a').c_str(), bl, bl.length(), 0));
+  ASSERT_EQ(10, ioctx.write(string(maxlen-1, 'a').c_str(), bl, bl.length(), 0));
+  ASSERT_EQ(10, ioctx.write(string(maxlen, 'a').c_str(), bl, bl.length(), 0));
   ASSERT_EQ(-ENAMETOOLONG, ioctx.write(string(maxlen+1, 'a').c_str(), bl, bl.length(), 0));
   ASSERT_EQ(-ENAMETOOLONG, ioctx.write(string(maxlen*2, 'a').c_str(), bl, bl.length(), 0));
 }
@@ -135,9 +135,9 @@ TEST_F(LibRadosMiscPP, LongAttrNamePP) {
   bufferlist bl;
   bl.append("content");
   int maxlen = g_conf()->osd_max_attr_name_len;
-  ASSERT_EQ(0, ioctx.setxattr("bigattrobj", string(maxlen/2, 'a').c_str(), bl));
-  ASSERT_EQ(0, ioctx.setxattr("bigattrobj", string(maxlen-1, 'a').c_str(), bl));
-  ASSERT_EQ(0, ioctx.setxattr("bigattrobj", string(maxlen, 'a').c_str(), bl));
+  ASSERT_EQ(10, ioctx.setxattr("bigattrobj", string(maxlen/2, 'a').c_str(), bl));
+  ASSERT_EQ(10, ioctx.setxattr("bigattrobj", string(maxlen-1, 'a').c_str(), bl));
+  ASSERT_EQ(10, ioctx.setxattr("bigattrobj", string(maxlen, 'a').c_str(), bl));
   ASSERT_EQ(-ENAMETOOLONG, ioctx.setxattr("bigattrobj", string(maxlen+1, 'a').c_str(), bl));
   ASSERT_EQ(-ENAMETOOLONG, ioctx.setxattr("bigattrobj", string(maxlen*2, 'a').c_str(), bl));
 }
@@ -289,8 +289,8 @@ TEST_F(LibRadosMiscPP, AioOperatePP) {
     bl2.append(buf2, sizeof(buf2));
     o.append(bl2);
   }
-  ASSERT_EQ(0, ioctx.aio_operate("foo", my_completion, &o));
-  ASSERT_EQ(0, my_completion->wait_for_complete_and_cb());
+  ASSERT_EQ(10, ioctx.aio_operate("foo", my_completion, &o));
+  ASSERT_EQ(10, my_completion->wait_for_complete_and_cb());
   ASSERT_EQ(my_aio_complete, true);
   my_completion->release();