You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

obs_test.go 983 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package obs
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
  7. stgmod "gitlink.org.cn/cloudream/storage/common/models"
  8. )
  9. func Test_S2S(t *testing.T) {
  10. Convey("OBS", t, func() {
  11. s2s := S2STransfer{
  12. dstStg: &cdssdk.OBSType{
  13. Region: "cn-north-4",
  14. Endpoint: "obs.cn-north-4.myhuaweicloud.com",
  15. AK: "",
  16. SK: "",
  17. Bucket: "pcm3-bucket3",
  18. ProjectID: "",
  19. },
  20. feat: &cdssdk.S2STransferFeature{
  21. TempDir: "s2s",
  22. },
  23. }
  24. newPath, err := s2s.Transfer(context.TODO(), stgmod.StorageDetail{
  25. Storage: cdssdk.Storage{
  26. Type: &cdssdk.OBSType{
  27. Region: "cn-north-4",
  28. Endpoint: "obs.cn-north-4.myhuaweicloud.com",
  29. AK: "",
  30. SK: "",
  31. Bucket: "pcm2-bucket2",
  32. ProjectID: "",
  33. },
  34. },
  35. }, "test_data/test03.txt")
  36. defer s2s.Abort()
  37. So(err, ShouldEqual, nil)
  38. t.Logf("newPath: %s", newPath)
  39. })
  40. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。