os.unlink(OTHERFILE)
cmd = (CFSD_PREFIX + "--op import --file {FOO}").format(osd=ONEOSD, FOO=OTHERFILE)
- ERRORS += test_failure(cmd, "open: No such file or directory")
+ ERRORS += test_failure(cmd, "file: {FOO}: No such file or directory".format(FOO=OTHERFILE))
+
+ cmd = "./ceph-objectstore-tool --data-path BAD_DATA_PATH --journal-path " + OSDDIR + "/{osd}.journal --op list".format(osd=ONEOSD)
+ ERRORS += test_failure(cmd, "data-path: BAD_DATA_PATH: No such file or directory")
+
+ cmd = "./ceph-objectstore-tool --journal-path BAD_JOURNAL_PATH --op dump-journal"
+ ERRORS += test_failure(cmd, "journal-path: BAD_JOURNAL_PATH: (2) No such file or directory")
# On import can't use stdin from a terminal
cmd = (CFSD_PREFIX + "--op import --pgid {pg}").format(osd=ONEOSD, pg=ONEPG)
}
if (file_fd != fd_none && file_fd < 0) {
- perror("open");
+ string err = string("file: ") + file;
+ perror(err.c_str());
myexit(1);
}
// Special handling for filestore journal, so we can dump it without mounting
if (op == "dump-journal" && type == "filestore") {
int ret = mydump_journal(formatter, jpath, g_conf->journal_dio);
+ if (ret < 0) {
+ cerr << "journal-path: " << jpath << ": "
+ << cpp_strerror(ret) << std::endl;
+ myexit(1);
+ }
formatter->flush(cout);
- myexit(ret != 0);
+ myexit(0);
}
//Verify that data-path really exists
struct stat st;
if (::stat(dpath.c_str(), &st) == -1) {
- perror("data-path");
- myexit(1);
+ string err = string("data-path: ") + dpath;
+ perror(err.c_str());
+ myexit(1);
}
//Verify data data-path really is a filestore
if (type == "filestore") {