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 1.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package obs
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. clitypes "gitlink.org.cn/cloudream/jcs-pub/client/types"
  7. "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/storage/types"
  8. cortypes "gitlink.org.cn/cloudream/jcs-pub/coordinator/types"
  9. )
  10. func Test_S2S(t *testing.T) {
  11. Convey("OBS", t, func() {
  12. s2s := S2STransfer{
  13. stgType: &cortypes.OBSType{
  14. Region: "cn-north-4",
  15. Endpoint: "obs.cn-north-4.myhuaweicloud.com",
  16. Bucket: "pcm3-bucket3",
  17. ProjectID: "",
  18. },
  19. cred: &cortypes.OBSCred{
  20. AK: "",
  21. SK: "",
  22. },
  23. feat: &cortypes.S2STransferFeature{
  24. TempDir: "s2s",
  25. },
  26. }
  27. newPath, err := s2s.Transfer(context.TODO(), &clitypes.UserSpaceDetail{
  28. UserSpace: clitypes.UserSpace{
  29. Storage: &cortypes.OBSType{
  30. Region: "cn-north-4",
  31. Endpoint: "obs.cn-north-4.myhuaweicloud.com",
  32. Bucket: "pcm2-bucket2",
  33. ProjectID: "",
  34. },
  35. Credential: cortypes.OBSCred{
  36. AK: "",
  37. SK: "",
  38. },
  39. },
  40. }, "test_data/test03.txt", types.S2SOption{})
  41. defer s2s.Abort()
  42. So(err, ShouldEqual, nil)
  43. t.Logf("newPath: %s", newPath)
  44. })
  45. }

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