|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package obs
-
- import (
- "context"
- "testing"
-
- . "github.com/smartystreets/goconvey/convey"
- clitypes "gitlink.org.cn/cloudream/jcs-pub/client/types"
- "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/storage/types"
- cortypes "gitlink.org.cn/cloudream/jcs-pub/coordinator/types"
- )
-
- func Test_S2S(t *testing.T) {
- Convey("OBS", t, func() {
- s2s := S2STransfer{
- stgType: &cortypes.OBSType{
- Region: "cn-north-4",
- Endpoint: "obs.cn-north-4.myhuaweicloud.com",
- Bucket: "pcm3-bucket3",
- ProjectID: "",
- },
- cred: &cortypes.OBSCred{
- AK: "",
- SK: "",
- },
- feat: &cortypes.S2STransferFeature{
- TempDir: "s2s",
- },
- }
-
- newPath, err := s2s.Transfer(context.TODO(), &clitypes.UserSpaceDetail{
- UserSpace: clitypes.UserSpace{
- Storage: &cortypes.OBSType{
- Region: "cn-north-4",
- Endpoint: "obs.cn-north-4.myhuaweicloud.com",
- Bucket: "pcm2-bucket2",
- ProjectID: "",
- },
- Credential: cortypes.OBSCred{
- AK: "",
- SK: "",
- },
- },
- }, "test_data/test03.txt", types.S2SOption{})
- defer s2s.Abort()
-
- So(err, ShouldEqual, nil)
- t.Logf("newPath: %s", newPath)
- })
- }
|