Commit 46f0dd80 authored by Sid Stenersen's avatar Sid Stenersen
Browse files

fix: harmonize ops and reports in cloud providers

parent cf9a7293
Pipeline #79710 passed with stages
in 11 minutes and 35 seconds
......@@ -83,7 +83,7 @@ namespace seismicdrive
}
return _seismicstore->dataset_sizes(reftn, refsp, dspaths);
}
return std::vector<int64_t>();
return {};
}
std::string getCreatedDate(const std::string &seistoreDatasetPath) const
......
......@@ -390,7 +390,10 @@ namespace seismicdrive
{
sendHttp(http);
}
check_status(http, "SeismicStore::dataset_delete", sdpath.getDatasetPath(), true);
if (http.response_code() != 404)
{
check_status(http, "SeismicStore::dataset_delete", sdpath.getDatasetPath(), true);
}
return true;
}
......@@ -517,9 +520,11 @@ namespace seismicdrive
auto result = jsonutils::toJson(http.get_response(), "SeismicStore::dataset_sizes");
std::vector<int64_t> sizes;
sizes.reserve(result.size());
for (auto &item : result)
{
sizes.push_back(item.asInt64());
}
return sizes;
}
......
......@@ -562,6 +562,36 @@ struct BlockSizeTest : public Test
}
++nTests;
}
{
SDGenericDataset ds(sdManager, params.sdDatasetName);
DatasetOpener d(ds, SDDatasetDisposition::READ_ONLY);
tout("Verifying block size (-1) for a block that doesn't exist");
auto s = params.sdDatasetName + randomString(8);
if (ds.getBlockSize(s) != -1)
{
throw Failed();
}
++nTests;
}
{
auto blockNames = randomStrings(aFew);
create(sdManager, blockNames);
{
SDGenericDataset ds(sdManager, params.sdDatasetName);
DatasetOpener d(ds, SDDatasetDisposition::READ_WRITE);
ds.deleteBlock(blockNames[0]);
}
SDGenericDataset ds(sdManager, params.sdDatasetName);
DatasetOpener d(ds, SDDatasetDisposition::READ_ONLY);
tout("Verifying block size (-1) for a deleted block");
if (ds.getBlockSize(blockNames[0]) != -1)
{
throw Failed();
}
++nTests;
}
return nTests;
}
};
......@@ -602,31 +632,17 @@ struct DeleteBlockTest : public Test
++nTests;
}
{
try
{
SDGenericDataset ds(sdManager, params.sdDatasetName);
DatasetOpener d(ds, SDDatasetDisposition::READ_WRITE);
tout("Deleting a deleted block");
ds.deleteBlock("0");
}
catch (const SDException &)
{
throw std::runtime_error("Delete failed");
}
SDGenericDataset ds(sdManager, params.sdDatasetName);
DatasetOpener d(ds, SDDatasetDisposition::READ_WRITE);
tout("Deleting a deleted block");
ds.deleteBlock("0");
++nTests;
}
{
try
{
SDGenericDataset ds(sdManager, params.sdDatasetName);
DatasetOpener d(ds, SDDatasetDisposition::READ_WRITE);
tout("Deleting a block that doesn't exist");
ds.deleteBlock(randomString(10));
}
catch (const SDException &)
{
throw std::runtime_error("Delete failed");
}
SDGenericDataset ds(sdManager, params.sdDatasetName);
DatasetOpener d(ds, SDDatasetDisposition::READ_WRITE);
tout("Deleting a block that doesn't exist");
ds.deleteBlock(randomString(10));
++nTests;
}
{
......@@ -1610,7 +1626,7 @@ struct SduDatasetSizeTest : public Test
{
unsigned nTests = 0;
{
tout("\nVerifying dataset size");
tout("\nVerifying dataset size (-1) for a dataset that doesn't exist");
auto size = SDUtils(sdManager).datasetSize(params.sdDatasetName);
if (size != -1)
{
......@@ -1647,14 +1663,7 @@ struct DeleteDatasetTest : public Test
unsigned nTests = 0;
{
tout("\nDeleting a dataset that doesn't exist");
try
{
SDUtils(sdManager).deleteDataset(params.sdDatasetName);
}
catch (const SDException &)
{
throw std::runtime_error("Delete failed");
}
SDUtils(sdManager).deleteDataset(params.sdDatasetName + randomString(8));
++nTests;
}
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment