DescriptionKatarzyna Jachim
2013-09-06 15:14:35 UTC
Created attachment 794810[details]
test logs (vdsm, engine, server etc.)
Description of problem:
If you try to add an iscsi storage connection via REST API with empty target, it will fail:
POST request:
<storage_connection>
<address>10.34.63.202</address>
<type>iscsi</type>
<port>3260</port>
<target></target>
</storage_connection>
response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
<reason>Operation Failed</reason>
<detail>[Target details cannot be empty.]</detail>
</fault>
However, if you create a connection with non-empty target, you can later change the target to empty:
PUT request:
<storage_connection>
<address>10.34.63.202</address>
<type>iscsi</type>
<port>3260</port>
<target></target>
</storage_connection>
response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<storage_connection href="/api/storageconnections/28aeccb1-d72b-4742-bff2-4f9199463873" id="28aeccb1-d72b-4742-bff2-4f9199463873">
<address>10.34.63.202</address>
<type>iscsi</type>
<port>3260</port>
<target></target>
</storage_connection>
Version-Release number of selected component (if applicable): is13
How reproducible: 100%
Steps to Reproduce:
1. create an iscsi storage connection
2. try to change target to empty string
Actual results: it is possible to change an iscsi storage connection so that the target is empty
Expected results: the command should fail with the "Target details cannot be empty." error
Additional info:
Attached logs are from this execution: http://jenkins.qa.lab.tlv.redhat.com:8080/view/Storage/view/3.3/job/3.3-storage_storage_connections_iscsi-iscsi-rest/25/testReport/junit/storage_storage_connections.test_manage_storage_connections_iscsi/013-TestCase288986;test_changing_storage_connection_without_target/TestCase288986_test_changing_storage_connection_without_target/
2013-09-04 17:19:24,283 - MainThread - plmanagement.trace - INFO - art.rhevm_api.tests_lib.low_level.storageconnections._prepare_connection_object(kwargs={'lun_target': '', 'type': 'iscsi'})
2013-09-04 17:19:24,285 - MainThread - storageconnections - DEBUG - PUT request content is -- url:/api/storageconnections/c1a89e8c-b220-424b-8b0f-7133b5cc6040 body:<storage_connection>
<type>iscsi</type>
<target></target>
</storage_connection>
2013-09-04 17:19:24,625 - MainThread - core_api - DEBUG - Request response time: 0.260
2013-09-04 17:19:24,626 - MainThread - storageconnections - DEBUG - Response body for PUT request is:
<storage_connection href="/api/storageconnections/c1a89e8c-b220-424b-8b0f-7133b5cc6040" id="c1a89e8c-b220-424b-8b0f-7133b5cc6040">
<address>256.256.256.256</address>
<type>iscsi</type>
<port>3260</port>
<target></target>
</storage_connection>