add iSCSI CHAP API

Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
Huamin Chen
2017-03-17 15:50:39 -04:00
parent 8667d7c4f1
commit 4b7e084a8e
8 changed files with 79 additions and 2 deletions

View File

@@ -948,6 +948,42 @@ func TestValidateVolumes(t *testing.T) {
errtype: field.ErrorTypeRequired,
errfield: "iscsi.iqn",
},
{
name: "empty secret",
vol: api.Volume{
Name: "iscsi",
VolumeSource: api.VolumeSource{
ISCSI: &api.ISCSIVolumeSource{
TargetPortal: "127.0.0.1",
IQN: "iqn.2015-02.example.com:test",
Lun: 1,
FSType: "ext4",
ReadOnly: false,
DiscoveryCHAPAuth: true,
},
},
},
errtype: field.ErrorTypeRequired,
errfield: "iscsi.secretRef",
},
{
name: "empty secret",
vol: api.Volume{
Name: "iscsi",
VolumeSource: api.VolumeSource{
ISCSI: &api.ISCSIVolumeSource{
TargetPortal: "127.0.0.1",
IQN: "iqn.2015-02.example.com:test",
Lun: 1,
FSType: "ext4",
ReadOnly: false,
SessionCHAPAuth: true,
},
},
},
errtype: field.ErrorTypeRequired,
errfield: "iscsi.secretRef",
},
// Secret
{
name: "valid Secret",