As a precaution to using cleanup for mass deletion of other
objects, only allow --prefix which begins with "benchmark_data."
Signed-off-by: David Zafman <dzafman@redhat.com>
die "Different objects found after cleanup"
fi
+ set +e
+ run_expect_fail $RADOS_TOOL -p $p cleanup --prefix illegal_prefix
+ run_expect_succ $RADOS_TOOL -p $p cleanup --prefix benchmark_data_otherhost
+ set -e
+
$RADOS_TOOL rmpool $p $p --yes-i-really-really-mean-it
}
const std::string run_name_meta = (run_name.empty() ? BENCH_LASTRUN_METADATA : run_name);
const std::string prefix = (orig_prefix.empty() ? generate_object_prefix_nopid() : orig_prefix);
+ if (prefix.substr(0, BENCH_PREFIX.length()) != BENCH_PREFIX) {
+ cerr << "Specified --prefix invalid, it must begin with \"" << BENCH_PREFIX << "\"" << std::endl;
+ return -EINVAL;
+ }
+
std::list<Object> unfiltered_objects;
std::set<std::string> meta_namespaces, all_namespaces;