Skip to content

Commit

Permalink
Merge pull request #1121 from opensds/development
Browse files Browse the repository at this point in the history
Integration of Development Branch to Master branch for Daito RC2 Release
  • Loading branch information
skdwriting committed Dec 12, 2019
2 parents d83dcc0 + d21838f commit f3c46cc
Show file tree
Hide file tree
Showing 512 changed files with 46,006 additions and 111,583 deletions.
10 changes: 5 additions & 5 deletions client/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestCreateHost(t *testing.T) {
AccessMode: "agentless",
HostName: "sap1",
IP: "192.168.56.12",
AvailabilityZones: []string{"az1", "az2"},
AvailabilityZones: []string{"default", "az2"},
Initiators: []*model.Initiator{
&model.Initiator{
PortName: "20000024ff5bb888",
Expand Down Expand Up @@ -71,7 +71,7 @@ func TestGetHost(t *testing.T) {
AccessMode: "agentless",
HostName: "sap1",
IP: "192.168.56.12",
AvailabilityZones: []string{"az1", "az2"},
AvailabilityZones: []string{"default", "az2"},
Initiators: []*model.Initiator{
&model.Initiator{
PortName: "20000024ff5bb888",
Expand Down Expand Up @@ -107,7 +107,7 @@ func TestListHosts(t *testing.T) {
AccessMode: "agentless",
HostName: "sap1",
IP: "192.168.56.12",
AvailabilityZones: []string{"az1", "az2"},
AvailabilityZones: []string{"default", "az2"},
Initiators: []*model.Initiator{
&model.Initiator{
PortName: "20000024ff5bb888",
Expand All @@ -128,7 +128,7 @@ func TestListHosts(t *testing.T) {
AccessMode: "agentless",
HostName: "sap2",
IP: "192.168.56.13",
AvailabilityZones: []string{"az1", "az2"},
AvailabilityZones: []string{"default", "az2"},
Initiators: []*model.Initiator{
&model.Initiator{
PortName: "20012324ff5ac132",
Expand Down Expand Up @@ -175,7 +175,7 @@ func TestUpdateHost(t *testing.T) {
AccessMode: "agentless",
HostName: "sap1",
IP: "192.168.56.12",
AvailabilityZones: []string{"az1", "az2"},
AvailabilityZones: []string{"default", "az2"},
Initiators: []*model.Initiator{
&model.Initiator{
PortName: "20000024ff5bb888",
Expand Down
16 changes: 12 additions & 4 deletions client/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ func TestGetPool(t *testing.T) {
Extras: model.StoragePoolExtraSpec{
DataStorage: model.DataStorageLoS{
ProvisioningPolicy: "Thin",
IsSpaceEfficient: true,
Compression: true,
Deduplication: true,
},
IOConnectivity: model.IOConnectivityLoS{
AccessProtocol: "rbd",
Expand Down Expand Up @@ -79,12 +80,16 @@ func TestListPools(t *testing.T) {
Extras: model.StoragePoolExtraSpec{
DataStorage: model.DataStorageLoS{
ProvisioningPolicy: "Thin",
IsSpaceEfficient: true,
Compression: true,
Deduplication: true,
},
IOConnectivity: model.IOConnectivityLoS{
AccessProtocol: "rbd",
MaxIOPS: 8000000,
MaxBWS: 700,
MinIOPS: 1000000,
MinBWS: 100,
Latency: 100,
},
Advanced: map[string]interface{}{
"diskType": "SSD",
Expand All @@ -105,12 +110,16 @@ func TestListPools(t *testing.T) {
Extras: model.StoragePoolExtraSpec{
DataStorage: model.DataStorageLoS{
ProvisioningPolicy: "Thin",
IsSpaceEfficient: true,
Compression: true,
Deduplication: true,
},
IOConnectivity: model.IOConnectivityLoS{
AccessProtocol: "rbd",
MaxIOPS: 3000000,
MaxBWS: 350,
MinIOPS: 1000000,
MinBWS: 100,
Latency: 100,
},
Advanced: map[string]interface{}{
"diskType": "SAS",
Expand All @@ -125,7 +134,6 @@ func TestListPools(t *testing.T) {
t.Error(err)
return
}

if !reflect.DeepEqual(pols, expected) {
t.Errorf("Expected %v, got %v", expected, pols)
return
Expand Down
18 changes: 15 additions & 3 deletions client/profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,16 @@ func TestListProfiles(t *testing.T) {
CustomProperties: model.CustomPropertiesSpec{
"dataStorage": map[string]interface{}{
"provisioningPolicy": "Thin",
"isSpaceEfficient": true,
"compression": true,
"deduplication": true,
},
"ioConnectivity": map[string]interface{}{
"accessProtocol": "rbd",
"maxIOPS": float64(5000000),
"maxBWS": float64(500),
"minIOPS": float64(1000000),
"minBWS": float64(100),
"latency": float64(100),
},
},
},
Expand Down Expand Up @@ -126,12 +130,16 @@ func TestAddCustomProperty(t *testing.T) {
expected := &model.CustomPropertiesSpec{
"dataStorage": map[string]interface{}{
"provisioningPolicy": "Thin",
"isSpaceEfficient": true,
"compression": true,
"deduplication": true,
},
"ioConnectivity": map[string]interface{}{
"accessProtocol": "rbd",
"maxIOPS": float64(5000000),
"maxBWS": float64(500),
"minIOPS": float64(1000000),
"minBWS": float64(100),
"latency": float64(100),
},
}

Expand All @@ -152,12 +160,16 @@ func TestListCustomProperties(t *testing.T) {
expected := &model.CustomPropertiesSpec{
"dataStorage": map[string]interface{}{
"provisioningPolicy": "Thin",
"isSpaceEfficient": true,
"compression": true,
"deduplication": true,
},
"ioConnectivity": map[string]interface{}{
"accessProtocol": "rbd",
"maxIOPS": float64(5000000),
"maxBWS": float64(500),
"minIOPS": float64(1000000),
"minBWS": float64(100),
"latency": float64(100),
},
}

Expand Down
5 changes: 4 additions & 1 deletion client/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ func request(urlStr string, method string, headers HeaderOption, input interface
type receiver struct{}

func (*receiver) Recv(url string, method string, input interface{}, output interface{}) error {
return request(url, method, nil, input, output)
headers := HeaderOption{}
headers["Content-Type"] = constants.ContentType
return request(url, method, headers, input, output)
}

func NewKeystoneReceiver(auth *KeystoneAuthOptions) (Receiver, error) {
Expand Down Expand Up @@ -218,6 +220,7 @@ func (k *KeystoneReceiver) Recv(url string, method string, body interface{}, out
}

headers := HeaderOption{}
headers["Content-Type"] = constants.ContentType
headers[constants.AuthTokenHeader] = k.Auth.TokenID
return request(url, method, headers, body, output)
})
Expand Down
81 changes: 43 additions & 38 deletions client/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ func TestCreateVolume(t *testing.T) {
BaseModel: &model.BaseModel{
Id: "bd5b12a8-a101-11e7-941e-d77981b584d8",
},
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
AvailabilityZone: "default",
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
}

vol, err := fv.CreateVolume(&model.VolumeSpec{})
Expand All @@ -56,12 +57,13 @@ func TestGetVolume(t *testing.T) {
BaseModel: &model.BaseModel{
Id: "bd5b12a8-a101-11e7-941e-d77981b584d8",
},
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
AvailabilityZone: "default",
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
}

vol, err := fv.GetVolume(volID)
Expand All @@ -82,12 +84,13 @@ func TestListVolumes(t *testing.T) {
BaseModel: &model.BaseModel{
Id: "bd5b12a8-a101-11e7-941e-d77981b584d8",
},
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
AvailabilityZone: "default",
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
},
}

Expand Down Expand Up @@ -129,12 +132,13 @@ func TestUpdateVolume(t *testing.T) {
BaseModel: &model.BaseModel{
Id: "bd5b12a8-a101-11e7-941e-d77981b584d8",
},
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
AvailabilityZone: "default",
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
}

if !reflect.DeepEqual(result, expected) {
Expand All @@ -159,12 +163,13 @@ func TestExtendVolume(t *testing.T) {
BaseModel: &model.BaseModel{
Id: "bd5b12a8-a101-11e7-941e-d77981b584d8",
},
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
Name: "sample-volume",
Description: "This is a sample volume for testing",
Size: int64(1),
AvailabilityZone: "default",
Status: "available",
PoolId: "084bf71e-a102-11e7-88a8-e31fe6d52248",
ProfileId: "1106b972-66ef-11e7-b172-db03f3689c9c",
}

if !reflect.DeepEqual(result, expected) {
Expand All @@ -181,7 +186,7 @@ func TestCreateVolumeAttachment(t *testing.T) {
},
Status: "available",
VolumeId: "bd5b12a8-a101-11e7-941e-d77981b584d8",
HostInfo: model.HostInfo{},
HostId: "202964b5-8e73-46fd-b41b-a8e403f3c30b",
ConnectionInfo: model.ConnectionInfo{
DriverVolumeType: "iscsi",
ConnectionData: map[string]interface{}{
Expand All @@ -195,7 +200,7 @@ func TestCreateVolumeAttachment(t *testing.T) {

atc, err := fv.CreateVolumeAttachment(&model.VolumeAttachmentSpec{
VolumeId: volID,
HostInfo: model.HostInfo{},
HostId: "202964b5-8e73-46fd-b41b-a8e403f3c30b",
})
if err != nil {
t.Error(err)
Expand All @@ -209,14 +214,13 @@ func TestCreateVolumeAttachment(t *testing.T) {
}

func TestUpdateVolumeAttachment(t *testing.T) {
var volID = "bd5b12a8-a101-11e7-941e-d77981b584d8"
expected := &model.VolumeAttachmentSpec{
BaseModel: &model.BaseModel{
Id: "f2dda3d2-bf79-11e7-8665-f750b088f63e",
},
Status: "available",
VolumeId: "bd5b12a8-a101-11e7-941e-d77981b584d8",
HostInfo: model.HostInfo{},
HostId: "202964b5-8e73-46fd-b41b-a8e403f3c30b",
ConnectionInfo: model.ConnectionInfo{
DriverVolumeType: "iscsi",
ConnectionData: map[string]interface{}{
Expand All @@ -229,8 +233,9 @@ func TestUpdateVolumeAttachment(t *testing.T) {
}

atc, err := fv.UpdateVolumeAttachment("f2dda3d2-bf79-11e7-8665-f750b088f63e", &model.VolumeAttachmentSpec{
VolumeId: volID,
HostInfo: model.HostInfo{},
BaseModel: &model.BaseModel{
Id: "f2dda3d2-bf79-11e7-8665-f750b088f63e",
},
})
if err != nil {
t.Error(err)
Expand All @@ -251,7 +256,7 @@ func TestGetVolumeAttachment(t *testing.T) {
},
Status: "available",
VolumeId: "bd5b12a8-a101-11e7-941e-d77981b584d8",
HostInfo: model.HostInfo{},
HostId: "202964b5-8e73-46fd-b41b-a8e403f3c30b",
ConnectionInfo: model.ConnectionInfo{
DriverVolumeType: "iscsi",
ConnectionData: map[string]interface{}{
Expand Down Expand Up @@ -283,7 +288,7 @@ func TestListVolumeAttachments(t *testing.T) {
},
Status: "available",
VolumeId: "bd5b12a8-a101-11e7-941e-d77981b584d8",
HostInfo: model.HostInfo{},
HostId: "202964b5-8e73-46fd-b41b-a8e403f3c30b",
ConnectionInfo: model.ConnectionInfo{
DriverVolumeType: "iscsi",
ConnectionData: map[string]interface{}{
Expand Down
12 changes: 5 additions & 7 deletions contrib/drivers/ceph/ceph.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,9 @@ func (d *Driver) uploadSnapshotToCloud(opt *pb.CreateVolumeSnapshotOpts, bucket
SnapshotId: opt.GetId(),
Metadata: opt.GetMetadata(),
HostInfo: &pb.HostInfo{
Platform: runtime.GOARCH,
OsType: runtime.GOOS,
Host: hostname,
Initiator: "",
Platform: runtime.GOARCH,
OsType: runtime.GOOS,
Host: hostname,
},
}

Expand Down Expand Up @@ -429,9 +428,8 @@ func (d *Driver) downloadSnapshotFromCloud(opt *pb.CreateVolumeOpts) error {
VolumeId: opt.GetId(),
Metadata: opt.GetMetadata(),
HostInfo: &pb.HostInfo{
Platform: runtime.GOARCH,
OsType: runtime.GOOS,
Initiator: "",
Platform: runtime.GOARCH,
OsType: runtime.GOOS,
},
}

Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/filesharedrivers/drivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func Init(resourceType string) FileShareDriver {
case config.NFSDriverType:
f = &nfs.Driver{}
break
case config.HuaweiOceanFileDriverType:
case config.HuaweiOceanStorFileDriverType:
f = &oceanstor.Driver{}
break
case config.ManilaDriverType:
Expand Down
Loading

0 comments on commit f3c46cc

Please sign in to comment.