|
- package obs
-
- import (
- "context"
- "testing"
-
- . "github.com/smartystreets/goconvey/convey"
- clitypes "gitlink.org.cn/cloudream/jcs-pub/client/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{},
- }
-
- _, 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: "",
- },
- },
- }, clitypes.PathFromComps("test_data/test03.txt"), clitypes.PathFromComps("atest.txt"))
- defer s2s.Close()
-
- So(err, ShouldEqual, nil)
- })
- }
|