This commit is contained in:
2026-11-16 09:28:38 +03:00
parent 276dbdad8a
commit 580b33efe8
99 changed files with 23335 additions and 27 deletions
+35
View File
@@ -0,0 +1,35 @@
// Small smoke tool for step 4: put → get → delete against MinIO.
#include "s3_client.hpp"
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
int main() {
try {
auto cfg = S3Client::from_env();
S3Client s3(cfg);
const std::string key = "smoke/step4.txt";
const std::string payload = "lab4-s3-smoke-ok";
std::istringstream in(payload);
s3.put_object(key, in, static_cast<std::int64_t>(payload.size()),
"text/plain");
std::ostringstream out;
s3.get_object(key, out);
if (out.str() != payload) {
std::cerr << "mismatch: got [" << out.str() << "]\n";
return 2;
}
s3.delete_object(key);
std::cout << "s3_smoke: OK bucket=" << cfg.bucket << " key=" << key << "\n";
return 0;
} catch (const std::exception& e) {
std::cerr << "s3_smoke: FAIL: " << e.what() << "\n";
return 1;
}
}