Install
openclaw skills install day253-volcengine-storage-tos-testMinimal TOS smoke tests. Validate AK/SK config, list buckets, and upload/download with Volcengine TOS. Supports both tosutil CLI and tos_manage.py script.
openclaw skills install day253-volcengine-storage-tos-testCategory: test
.env)。依赖:pip install tos
python skills/storage/tos/volcengine-storage-tos/scripts/tos_manage.py list-buckets --print-json
python skills/storage/tos/volcengine-storage-tos/scripts/tos_manage.py list-objects \
--bucket <bucket> --prefix "" --max-keys 20 --print-json
echo "tos-manage-test-$(date +%s)" > /tmp/tos-test.txt
python skills/storage/tos/volcengine-storage-tos/scripts/tos_manage.py upload \
--bucket <bucket> --key tests/tos-test.txt --file /tmp/tos-test.txt --print-json
python skills/storage/tos/volcengine-storage-tos/scripts/tos_manage.py head \
--bucket <bucket> --key tests/tos-test.txt --print-json
python skills/storage/tos/volcengine-storage-tos/scripts/tos_manage.py download \
--bucket <bucket> --key tests/tos-test.txt --file /tmp/tos-test-down.txt
diff /tmp/tos-test.txt /tmp/tos-test-down.txt && echo "PASS: content matches" || echo "FAIL: content mismatch"
python skills/storage/tos/volcengine-storage-tos/scripts/tos_manage.py presign \
--bucket <bucket> --key tests/tos-test.txt --expires 300 --print-json
python skills/storage/tos/volcengine-storage-tos/scripts/tos_manage.py delete \
--bucket <bucket> --key tests/tos-test.txt --confirm
tosutil 是火山引擎官方 TOS 命令行工具,需单独下载安装。 参考:https://www.volcengine.com/docs/6349/148772
tosutil config
tosutil ls
tosutil ls tos://<bucket> -s --limited-num 20
echo "tosutil-test-$(date +%s)" > /tmp/tosutil-test.txt
tosutil cp /tmp/tosutil-test.txt tos://<bucket>/tests/tosutil-test.txt
tosutil cp tos://<bucket>/tests/tosutil-test.txt /tmp/tosutil-test-down.txt
diff /tmp/tosutil-test.txt /tmp/tosutil-test-down.txt && echo "PASS" || echo "FAIL"
tosutil rm tos://<bucket>/tests/tosutil-test.txt
list-buckets / tosutil ls 能返回至少一个 bucket。diff 无输出)。head 返回正确的 content_length 和 content_type。| 现象 | 原因 | 解决 |
|---|---|---|
| 403 AccessDenied | AK/SK 错误或无权限 | 检查 IAM 策略,确认允许 tos:* 或最小读写权限 |
| Endpoint 不可达 | Region 与 Endpoint 不匹配 | 端点格式为 tos-{region}.volces.com |
| NoSuchBucket | Bucket 名拼写或 Region 错误 | 先 list-buckets 确认桶存在 |
| 上传成功但下载内容不一致 | 网络中断或部分写入 | 检查 ETag 或重新上传 |