]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/osd/TestRados.cc: skip 0 weight ops
authorSamuel Just <sam.just@inktank.com>
Fri, 6 Dec 2013 19:02:04 +0000 (11:02 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 22 Jan 2014 22:39:14 +0000 (14:39 -0800)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/test/osd/TestRados.cc

index 1def0622f10f64fc854f856eeb16b6e29b04e24c..79c367c58e8a6b53e203215f5d45a4c0b38d7a6f 100644 (file)
@@ -294,11 +294,6 @@ int main(int argc, char **argv)
          break;
        }
       }
-      if (ec_pool && !op_types[j].ec_pool_valid) {
-       cerr << "Error: cannot use op type " << op_types[j].name
-            << " with --ec-pool" << std::endl;
-       exit(1);
-      }
       if (!op_types[j].name) {
        cerr << "unknown op " << argv[i] << std::endl;
        exit(1);
@@ -307,9 +302,15 @@ int main(int argc, char **argv)
       if (weight < 0) {
        cerr << "Weights must be nonnegative." << std::endl;
        return 1;
+      } else if (weight > 0) {
+       if (ec_pool && !op_types[j].ec_pool_valid) {
+         cerr << "Error: cannot use op type " << op_types[j].name
+              << " with --ec-pool" << std::endl;
+         exit(1);
+       }
+       cout << "adding op weight " << op_types[j].name << " -> " << weight << std::endl;
+       op_weights.insert(pair<TestOpType, unsigned int>(op_types[j].op, weight));
       }
-      cout << "adding op weight " << op_types[j].name << " -> " << weight << std::endl;
-      op_weights.insert(pair<TestOpType, unsigned int>(op_types[j].op, weight));
     } else {
       cerr << "unknown arg " << argv[i] << std::endl;
       //usage();