// Small smoke tool for step 4: put → get → delete against MinIO. #include "s3_client.hpp" #include #include #include #include #include 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(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; } }