deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH] FGCP: added unit tests for storage_volumes and fixed error with unknown id
Date Tue, 19 Feb 2013 10:18:35 GMT
On 02/19, diesk@fast.au.fujitsu.com wrote:

ACK

> From: Dies Koper <diesk@fast.au.fujitsu.com>
> 
> ---
>  server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb  |   3 +
>  ...st_0002_must_return_list_of_storage_volumes.yml | 207 +++++++++++++++++++++
>  ...t_0003_must_allow_to_filter_storage_volumes.yml | 118 ++++++++++++
>  ...ust_allow_to_retrieve_single_storage_volume.yml | 118 ++++++++++++
>  ...005_must_allow_to_create_the_storage_volume.yml | 162 ++++++++++++++++
>  server/tests/drivers/fgcp/storage_volumes_test.rb  |  58 ++++++
>  6 files changed, 666 insertions(+)
>  create mode 100644 server/tests/drivers/fgcp/fixtures/test_0002_must_return_list_of_storage_volumes.yml
>  create mode 100644 server/tests/drivers/fgcp/fixtures/test_0003_must_allow_to_filter_storage_volumes.yml
>  create mode 100644 server/tests/drivers/fgcp/fixtures/test_0004_must_allow_to_retrieve_single_storage_volume.yml
>  create mode 100644 server/tests/drivers/fgcp/fixtures/test_0005_must_allow_to_create_the_storage_volume.yml
>  create mode 100644 server/tests/drivers/fgcp/storage_volumes_test.rb
> 
> diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
> index 5fca504..71b53bd 100644
> --- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
> +++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
> @@ -468,7 +468,10 @@ class FgcpDriver < Deltacloud::BaseDriver
>          begin
>            vdisk = client.get_vdisk_attributes(opts[:id])['vdisk'][0]
>          rescue Exception => ex
> +          # vdisk doesn't exist
>            return [] if ex.message =~ /VALIDATION_ERROR.*t exist./
> +          # vsys_id extracted from :id doesn't exist
> +          return [] if ex.message =~ /VALIDATION_ERROR.*A wrong value is set/
>            raise
>          end
>          state = client.get_vdisk_status(opts[:id])['vdiskStatus'][0]
> diff --git a/server/tests/drivers/fgcp/fixtures/test_0002_must_return_list_of_storage_volumes.yml
b/server/tests/drivers/fgcp/fixtures/test_0002_must_return_list_of_storage_volumes.yml
> new file mode 100644
> index 0000000..8a4fc1e
> --- /dev/null
> +++ b/server/tests/drivers/fgcp/fixtures/test_0002_must_return_list_of_storage_volumes.yml
> @@ -0,0 +1,207 @@
> +--- 
> +recorded_with: VCR 2.4.0
> +http_interactions: 
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5Nzk5MDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=ListVSYS&Locale=en&Signature=fJ1hJj//O//EqlTF3wspQYRNWh2so9hWLSd0t3ofbMrCQs2Bd7lcv4oN21vT%0ApiST6oVq/MaTj2QwUnYH5v5ss6A/TnnbXy4JoijJsvtkbiTam7vretKjCZ/I%0A2PDU2W80nnq/FTGz3ps0StmpaH6S85+Inqj8ZknMnkPnAeAvv3dsPmMBrz+Y%0Agsmv9f8hytzO7ZijWuY5MWi8dnFWABeJAkan5P101Fq6qEo0XiaOtwhCHbE0%0AlwWwfRsfyM5WPDcd78ouUoGYcpHBvK2Wc56FNW5HZxEbugvhNZwaeJbKoC+8%0ALW1zuHMiG6UyyPmsjCIGSBdN0ptEMzJrSK4TB5TNRg==%0A&Version=2011-01-31
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:39 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=751F332488926C74634CE41549FC6EFB; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <ListVSYSResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vsyss>
> +            <vsys>
> +              <baseDescriptor>2-tier Skeleton</baseDescriptor>
> +              <creator>UZXC0GRT</creator>
> +              <description>2-tier Skeleton</description>
> +              <vsysId>UZXC0GRT-ZG8ZJCJ07</vsysId>
> +              <vsysName>Dies-DC-test</vsysName>
> +            </vsys>
> +          </vsyss>
> +        </ListVSYSResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:39 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5Nzk5MDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=ListVDisk&Locale=en&Signature=fJ1hJj//O//EqlTF3wspQYRNWh2so9hWLSd0t3ofbMrCQs2Bd7lcv4oN21vT%0ApiST6oVq/MaTj2QwUnYH5v5ss6A/TnnbXy4JoijJsvtkbiTam7vretKjCZ/I%0A2PDU2W80nnq/FTGz3ps0StmpaH6S85+Inqj8ZknMnkPnAeAvv3dsPmMBrz+Y%0Agsmv9f8hytzO7ZijWuY5MWi8dnFWABeJAkan5P101Fq6qEo0XiaOtwhCHbE0%0AlwWwfRsfyM5WPDcd78ouUoGYcpHBvK2Wc56FNW5HZxEbugvhNZwaeJbKoC+8%0ALW1zuHMiG6UyyPmsjCIGSBdN0ptEMzJrSK4TB5TNRg==%0A&Version=2011-01-31&vsysId=UZXC0GRT-ZG8ZJCJ07
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:39 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=5E350F7C087E5E45828C0DC7AFCD4A6F; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <ListVDiskResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vdisks>
> +            <vdisk>
> +              <creator>UZXC0GRT</creator>
> +              <size>10.0</size>
> +              <vdiskId>UZXC0GRT-ZG8ZJCJ07-D-0039</vdiskId>
> +              <vdiskName>DISK1</vdiskName>
> +            </vdisk>
> +            <vdisk>
> +              <creator>UZXC0GRT</creator>
> +              <size>10.0</size>
> +              <vdiskId>UZXC0GRT-ZG8ZJCJ07-D-0040</vdiskId>
> +              <vdiskName>Test Volume</vdiskName>
> +            </vdisk>
> +            <vdisk>
> +              <attachedTo>UZXC0GRT-ZG8ZJCJ07-S-0186</attachedTo>
> +              <creator>UZXC0GRT</creator>
> +              <size>10.0</size>
> +              <vdiskId>UZXC0GRT-ZG8ZJCJ07-S-0186</vdiskId>
> +              <vdiskName>test</vdiskName>
> +            </vdisk>
> +          </vdisks>
> +        </ListVDiskResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:40 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5ODAwMDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=ListVSYS&Locale=en&Signature=RnNg0tCmSZe9zvDaT/jvvvt47a9DP82wvq/zMqnHfZrOB7b7X0ILnDISKEL/%0A67/rx5ja35Xz6hLMD6vv/JSPRaPvLP5G+MIBDYLW/B8jkqkUdnwKeJD+NKNb%0As/eTJkaJZR1Ivov6XKI8f+EMaRuKSIAOvvJobut2pVDO/nETvIv1siqsGaIw%0A9bA6qvK1jEbzZ4kxrsvBEzoSyMvF/B8yYdnx78/dsKrG9ttDVgDjctR49wDy%0AmACSUvz+yVWrU7LmUZiHWRXc1IvtSCEIWcLd+1WMd+PNmzpEJ1luqv9WMfaC%0Aehu2H4HqPxgjN6ImCf3oL8OvtGOuPozMYWM6v/jmhA==%0A&Version=2011-01-31
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:40 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=52BF9BBA58E1595740E99CC8FEA05245; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <ListVSYSResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vsyss>
> +            <vsys>
> +              <baseDescriptor>2-tier Skeleton</baseDescriptor>
> +              <creator>UZXC0GRT</creator>
> +              <description>2-tier Skeleton</description>
> +              <vsysId>UZXC0GRT-ZG8ZJCJ07</vsysId>
> +              <vsysName>Dies-DC-test</vsysName>
> +            </vsys>
> +          </vsyss>
> +        </ListVSYSResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:40 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5ODAwMDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=ListVDisk&Locale=en&Signature=RnNg0tCmSZe9zvDaT/jvvvt47a9DP82wvq/zMqnHfZrOB7b7X0ILnDISKEL/%0A67/rx5ja35Xz6hLMD6vv/JSPRaPvLP5G+MIBDYLW/B8jkqkUdnwKeJD+NKNb%0As/eTJkaJZR1Ivov6XKI8f+EMaRuKSIAOvvJobut2pVDO/nETvIv1siqsGaIw%0A9bA6qvK1jEbzZ4kxrsvBEzoSyMvF/B8yYdnx78/dsKrG9ttDVgDjctR49wDy%0AmACSUvz+yVWrU7LmUZiHWRXc1IvtSCEIWcLd+1WMd+PNmzpEJ1luqv9WMfaC%0Aehu2H4HqPxgjN6ImCf3oL8OvtGOuPozMYWM6v/jmhA==%0A&Version=2011-01-31&vsysId=UZXC0GRT-ZG8ZJCJ07
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:40 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=4B40EF845E654E46C80CC3E2ACD9554F; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <ListVDiskResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vdisks>
> +            <vdisk>
> +              <creator>UZXC0GRT</creator>
> +              <size>10.0</size>
> +              <vdiskId>UZXC0GRT-ZG8ZJCJ07-D-0039</vdiskId>
> +              <vdiskName>DISK1</vdiskName>
> +            </vdisk>
> +            <vdisk>
> +              <creator>UZXC0GRT</creator>
> +              <size>10.0</size>
> +              <vdiskId>UZXC0GRT-ZG8ZJCJ07-D-0040</vdiskId>
> +              <vdiskName>Test Volume</vdiskName>
> +            </vdisk>
> +            <vdisk>
> +              <attachedTo>UZXC0GRT-ZG8ZJCJ07-S-0186</attachedTo>
> +              <creator>UZXC0GRT</creator>
> +              <size>10.0</size>
> +              <vdiskId>UZXC0GRT-ZG8ZJCJ07-S-0186</vdiskId>
> +              <vdiskName>test</vdiskName>
> +            </vdisk>
> +          </vdisks>
> +        </ListVDiskResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:41 GMT
> diff --git a/server/tests/drivers/fgcp/fixtures/test_0003_must_allow_to_filter_storage_volumes.yml
b/server/tests/drivers/fgcp/fixtures/test_0003_must_allow_to_filter_storage_volumes.yml
> new file mode 100644
> index 0000000..d0264e4
> --- /dev/null
> +++ b/server/tests/drivers/fgcp/fixtures/test_0003_must_allow_to_filter_storage_volumes.yml
> @@ -0,0 +1,118 @@
> +--- 
> +recorded_with: VCR 2.4.0
> +http_interactions: 
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5ODAxMDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=GetVDiskAttributes&Locale=en&Signature=d46pDJnCJNyCjpEnyqrV9PaJj46KK9Fu+xfUki8GUkYFoZDWPQ8jTjNzk+By%0AyI8Vkx/xqlDSZDBkJ7RG39P0VJdEz2WaIVFoosx+BIBN3kNq48BEv5MBwtrt%0ASJKEGctrirbL3Gdljs6G5t/yvsnYHfTvvbB8kSc2BtMJGq7oaGPT5NdqeIzA%0AU1KsTgkOopV/i2O3AaQnY615VRQGu0KruWgYc2yU91hgWJCC59gh4WtZjUJt%0AM0ydezDbgrazauoUB9V2i2+GH6B25nuqSspjl9MItyrzSg+JlR56HNjG4v9I%0AxoYCyR7zXkpiMApG5L6nWxM7QE1YrgaBkDxhEGAsfg==%0A&Version=2011-01-31&vdiskId=UZXC0GRT-ZG8ZJCJ07-D-0039&vsysId=UZXC0GRT-ZG8ZJCJ07
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:41 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=9024CD00A9730FA9BBBFC9A31DD6445A; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <GetVDiskAttributesResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vdisk>
> +            <creator>UZXC0GRT</creator>
> +            <size>10.0</size>
> +            <vdiskId>UZXC0GRT-ZG8ZJCJ07-D-0039</vdiskId>
> +            <vdiskName>DISK1</vdiskName>
> +          </vdisk>
> +        </GetVDiskAttributesResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:41 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5ODAxMDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=GetVDiskStatus&Locale=en&Signature=d46pDJnCJNyCjpEnyqrV9PaJj46KK9Fu+xfUki8GUkYFoZDWPQ8jTjNzk+By%0AyI8Vkx/xqlDSZDBkJ7RG39P0VJdEz2WaIVFoosx+BIBN3kNq48BEv5MBwtrt%0ASJKEGctrirbL3Gdljs6G5t/yvsnYHfTvvbB8kSc2BtMJGq7oaGPT5NdqeIzA%0AU1KsTgkOopV/i2O3AaQnY615VRQGu0KruWgYc2yU91hgWJCC59gh4WtZjUJt%0AM0ydezDbgrazauoUB9V2i2+GH6B25nuqSspjl9MItyrzSg+JlR56HNjG4v9I%0AxoYCyR7zXkpiMApG5L6nWxM7QE1YrgaBkDxhEGAsfg==%0A&Version=2011-01-31&vdiskId=UZXC0GRT-ZG8ZJCJ07-D-0039&vsysId=UZXC0GRT-ZG8ZJCJ07
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:41 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=43597DCA5EDE43BF5152259F70F837CB; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <GetVDiskStatusResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vdiskStatus>NORMAL</vdiskStatus>
> +        </GetVDiskStatusResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:42 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5ODAyMDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=GetVDiskAttributes&Locale=en&Signature=0jsYfBjvmX+xpc6oVCPBe9zzbbVjie2CUPafdNO9df9WciyAYMkDzo7A51rx%0AgLMFc8sv/gNJu9ZpQnA6o2TxGmuQGigUSS5bTH18nwmgG47lGkOpCENSbL65%0A84HweqQMnSv7MG+XnKTWkM+laJsnzsNZAuTaG7HLtgWXnL2oP9gkxF52ldE1%0Af3TsExpGzbWmMymR/D8P/p6PZbED3UgxRY1sZ105mhzAkQqJ9gekS/nrUHVO%0ABOLgyM1N6BFrdu/rrwjWnrLYRAXIo6qXbLRWsxBH3y78MXYpXjPJw2aIJF8E%0AAHtf3jW7NQrocp/fduNT7ZxBee0JuZRvfYOnidTvBg==%0A&Version=2011-01-31&vdiskId=unknown&vsysId=
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:42 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=CDE03281485C677AA81819A9A481FA1E; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <OViSSResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>A wrong value is set.:[vsysId, vdiskId]</responseMessage>
> +          <responseStatus>VALIDATION_ERROR</responseStatus>
> +        </OViSSResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:42 GMT
> diff --git a/server/tests/drivers/fgcp/fixtures/test_0004_must_allow_to_retrieve_single_storage_volume.yml
b/server/tests/drivers/fgcp/fixtures/test_0004_must_allow_to_retrieve_single_storage_volume.yml
> new file mode 100644
> index 0000000..bd09705
> --- /dev/null
> +++ b/server/tests/drivers/fgcp/fixtures/test_0004_must_allow_to_retrieve_single_storage_volume.yml
> @@ -0,0 +1,118 @@
> +--- 
> +recorded_with: VCR 2.4.0
> +http_interactions: 
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5Nzg4MDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=GetVDiskAttributes&Locale=en&Signature=Fq0FpoLXIVbxQgnkKoq3UzfcyWN/fakSoVgCJX7xHFbp3Sqx8hf0gWXA+Iqr%0A6T53zLS6eNZc8JfzWAUqpupP2R3+MWCTAebsmUdWTpGrhKIPiE2nicfPW76V%0AMONgzrRR/L5S+IZmMwNlBlyvQI+GSqXxPpNDbIeLZqjFLvXGYZzIwndiOlgy%0Aw3H1o+eWpGip6zF5oAwo4EtXG1nxbBBLIVslctVLuxjTdjia0Du9PJr8uaIC%0AcCzwHy9M1BkSk5MWgYW+hJyARJG2RflbUELMZoTopYSAzUi7VzmCncLYqPRs%0A3RYQg9AEou2URrPliEvlqzf0o/9KqrTfW5B0fgYUYQ==%0A&Version=2011-01-31&vdiskId=UZXC0GRT-ZG8ZJCJ07-D-0039&vsysId=UZXC0GRT-ZG8ZJCJ07
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:28 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=79BE1F2B727C0A9EA4CBD0A6491078A0; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <GetVDiskAttributesResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vdisk>
> +            <creator>UZXC0GRT</creator>
> +            <size>10.0</size>
> +            <vdiskId>UZXC0GRT-ZG8ZJCJ07-D-0039</vdiskId>
> +            <vdiskName>DISK1</vdiskName>
> +          </vdisk>
> +        </GetVDiskAttributesResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:29 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5Nzg5MDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=GetVDiskStatus&Locale=en&Signature=PvKtURF/4t8ibo0jJ4Shr9fKuFHTamwxEulv+Ubz3jKb2QaT/WLUAa19zLMV%0AE5jknFbHQudX4Vx4AONTT30T7DGUy8RqBDy7B3CmqRiixYpcM+0XAPVYdgNs%0Ad30hdhdlaHyItfz20qvkCZVAfu6J9y3jRrRHtIhKhUeCK4/IDMKVWDhgMlrZ%0AXqxLkE2RzLfXlxphyl3ql7aN/UIZ0LJvSLli4DtZ2z8QFsiYD25Qro3GZ5V3%0A6Vfi5fQMY2P2IboBGTRvrYcP7zm1tOJTKZ51Mf+GpeEDgAPatg0ocgxrEoOu%0ACh02ChtDlQX7DiOLL6exOPi5Ju0F10KQCwS5rMgj4g==%0A&Version=2011-01-31&vdiskId=UZXC0GRT-ZG8ZJCJ07-D-0039&vsysId=UZXC0GRT-ZG8ZJCJ07
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:29 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=61481EE7E0B625CCDB11DFFC15915884; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <GetVDiskStatusResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vdiskStatus>NORMAL</vdiskStatus>
> +        </GetVDiskStatusResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:29 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5Nzg5MDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=GetVDiskAttributes&Locale=en&Signature=PvKtURF/4t8ibo0jJ4Shr9fKuFHTamwxEulv+Ubz3jKb2QaT/WLUAa19zLMV%0AE5jknFbHQudX4Vx4AONTT30T7DGUy8RqBDy7B3CmqRiixYpcM+0XAPVYdgNs%0Ad30hdhdlaHyItfz20qvkCZVAfu6J9y3jRrRHtIhKhUeCK4/IDMKVWDhgMlrZ%0AXqxLkE2RzLfXlxphyl3ql7aN/UIZ0LJvSLli4DtZ2z8QFsiYD25Qro3GZ5V3%0A6Vfi5fQMY2P2IboBGTRvrYcP7zm1tOJTKZ51Mf+GpeEDgAPatg0ocgxrEoOu%0ACh02ChtDlQX7DiOLL6exOPi5Ju0F10KQCwS5rMgj4g==%0A&Version=2011-01-31&vdiskId=unknown&vsysId=
> +    body: 
> +      string: ""
> +    headers: 
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +      Accept: 
> +      - text/xml
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:29 GMT
> +      Connection: 
> +      - close
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Set-Cookie: 
> +      - JSESSIONID=7EA229A9D9A825F06AF683A1DC248007; Path=/ovisspxy; Secure
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <OViSSResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>A wrong value is set.:[vsysId, vdiskId]</responseMessage>
> +          <responseStatus>VALIDATION_ERROR</responseStatus>
> +        </OViSSResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:29 GMT
> diff --git a/server/tests/drivers/fgcp/fixtures/test_0005_must_allow_to_create_the_storage_volume.yml
b/server/tests/drivers/fgcp/fixtures/test_0005_must_allow_to_create_the_storage_volume.yml
> new file mode 100644
> index 0000000..f50975b
> --- /dev/null
> +++ b/server/tests/drivers/fgcp/fixtures/test_0005_must_allow_to_create_the_storage_volume.yml
> @@ -0,0 +1,162 @@
> +--- 
> +recorded_with: VCR 2.4.0
> +http_interactions: 
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5Nzg5MDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=ListVSYS&Locale=en&Signature=PvKtURF/4t8ibo0jJ4Shr9fKuFHTamwxEulv+Ubz3jKb2QaT/WLUAa19zLMV%0AE5jknFbHQudX4Vx4AONTT30T7DGUy8RqBDy7B3CmqRiixYpcM+0XAPVYdgNs%0Ad30hdhdlaHyItfz20qvkCZVAfu6J9y3jRrRHtIhKhUeCK4/IDMKVWDhgMlrZ%0AXqxLkE2RzLfXlxphyl3ql7aN/UIZ0LJvSLli4DtZ2z8QFsiYD25Qro3GZ5V3%0A6Vfi5fQMY2P2IboBGTRvrYcP7zm1tOJTKZ51Mf+GpeEDgAPatg0ocgxrEoOu%0ACh02ChtDlQX7DiOLL6exOPi5Ju0F10KQCwS5rMgj4g==%0A&Version=2011-01-31
> +    body: 
> +      string: ""
> +    headers: 
> +      Accept: 
> +      - text/xml
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Connection: 
> +      - close
> +      Set-Cookie: 
> +      - JSESSIONID=9C8B4022BCBE86ACD2630933F70971E6; Path=/ovisspxy; Secure
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:29 GMT
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <ListVSYSResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vsyss>
> +            <vsys>
> +              <baseDescriptor>2-tier Skeleton</baseDescriptor>
> +              <creator>UZXC0GRT</creator>
> +              <description>2-tier Skeleton</description>
> +              <vsysId>UZXC0GRT-ZG8ZJCJ07</vsysId>
> +              <vsysName>Dies-DC-test</vsysName>
> +            </vsys>
> +          </vsyss>
> +        </ListVSYSResponse>
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:30 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjQ5NzkwMDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=CreateVDisk&Locale=en&Signature=xyXj1AR0Jp25nRZeXfPBScSMAyawIP+xw91RorQCKsd17CDP1o7zubmc9aXt%0AnyE6nL49wrWZ4hWxUVj9lT1GBHz+u0Pv7vglWVfWCag9bfJKe48an8LSM+pR%0AHCoqcaIXGlXhumoKEaClnGGKYuvE0EEAR8Hw7DIkQH5YLdPTQGX1VsOKFkkv%0Aw/huC8jCUX6i0vZp1fmRTw7DLBg3oIh+TJcXGwY/p8B+1nmJGuCINN5SGzWm%0AO0wZwRXXaZlmw0dye3GOElaOmXrNn0hLQlXs6zDg2q27Xl4wgUiyj360nEKb%0A/ozt9gsH9vtTmochT6Ex0j++RsFnKGFRvnbc99qOpA==%0A&Version=2011-01-31&size=10.0&vdiskName=Test%20Volume&vsysId=UZXC0GRT-ZG8ZJCJ07
> +    body: 
> +      string: ""
> +    headers: 
> +      Accept: 
> +      - text/xml
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Connection: 
> +      - close
> +      Set-Cookie: 
> +      - JSESSIONID=67D06D40243ADD32D54DA31AB498D126; Path=/ovisspxy; Secure
> +      Date: 
> +      - Tue, 19 Feb 2013 04:56:30 GMT
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <CreateVDiskResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vdiskId>UZXC0GRT-ZG8ZJCJ07-D-0040</vdiskId>
> +        </CreateVDiskResponse>
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 04:56:39 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjUwMzgzMDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=GetVDiskAttributes&Locale=en&Signature=CbjigJu5MgcVRG6frY1PBA7ALiX9qvCqac0NdURv5CzkTtldPujCw+9b4K78%0AEZktJzOgqNpVYRwX2nTMEYiY4K2QCK3srvXJlkVAfu41haUBfaj1ohzo/uB/%0ATCZUGbDJLISB3vBUnqP97ckNS/wlyLrqPlAug92gfMXzd9FI3YYyUxw0xKnz%0AMVvRorwNa8jdys9BKrduEJrZ4y0aeUEUp3nnOGq0sBng3hSgP9NCXsIz9HEE%0AY1No2YBDWDMJQIHfu+BEKw+fUA+N1dOEX5TmTVltmGXuKTfGaCXVtrbMsyiI%0A2U1avnjvkQ4OIb/smUwSF4ThxJoriXScX+DUP4nu8Q==%0A&Version=2011-01-31&vdiskId=UZXC0GRT-ZG8ZJCJ07-D-0040&vsysId=UZXC0GRT-ZG8ZJCJ07
> +    body: 
> +      string: ""
> +    headers: 
> +      Accept: 
> +      - text/xml
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Set-Cookie: 
> +      - JSESSIONID=2E779E78DB9BCD90E97852E2512D3411; Path=/ovisspxy; Secure
> +      Connection: 
> +      - close
> +      Date: 
> +      - Tue, 19 Feb 2013 05:06:23 GMT
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <GetVDiskAttributesResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vdisk>
> +            <creator>UZXC0GRT</creator>
> +            <size>10.0</size>
> +            <vdiskId>UZXC0GRT-ZG8ZJCJ07-D-0040</vdiskId>
> +            <vdiskName>Test Volume</vdiskName>
> +          </vdisk>
> +        </GetVDiskAttributesResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 05:06:24 GMT
> +- request: 
> +    method: get
> +    uri: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint?AccessKeyId=QVVTIEVhc3Rlcm4gRGF5bGlnaHQgVGltZSYxMzYxMjUwMzg0MDAwJjEuMCZT%0ASEExd2l0aFJTQQ==%0A&Action=GetVDiskStatus&Locale=en&Signature=akBsWkD1bslXidF+FIn6FPOIPJKtBnPhaVns2+ddTwsBoQ1VoNrdTHeLnm/z%0ATRDU5XB4bA91VJuaNlsjkOOSvuj7Ga+jAJ7W/tyNG0QEV/7+1ifQkHPW+nqs%0AQnzIIIYhRKBWynQTbpUfSzxay8osLudTriT7P/NXl9qYZhljulj3JfbwXp1c%0Au6INgFFYioCnFmOQuR+NVgwGjdiV/wpLf7INMHNHABpmrHtn76mMU95USG1i%0AQuqRee7TM9Hjtr4X4KnwVyVKVc840aLJg70aiSW7Cml01u7H/5TKeOAjRwfv%0ADdtOjf49T4PtK+TxwFrXQ+gFZ8lsoHRZ6jFt/I4J3Q==%0A&Version=2011-01-31&vdiskId=UZXC0GRT-ZG8ZJCJ07-D-0040&vsysId=UZXC0GRT-ZG8ZJCJ07
> +    body: 
> +      string: ""
> +    headers: 
> +      Accept: 
> +      - text/xml
> +      User-Agent: 
> +      - OViSS-API-CLIENT
> +  response: 
> +    status: 
> +      code: 200
> +      message: OK
> +    headers: 
> +      Set-Cookie: 
> +      - JSESSIONID=74DEB6A34AC4370A0D9FA1EF2331C1DC; Path=/ovisspxy; Secure
> +      Connection: 
> +      - close
> +      Date: 
> +      - Tue, 19 Feb 2013 05:06:24 GMT
> +      Content-Type: 
> +      - text/xml;charset=UTF-8
> +      Transfer-Encoding: 
> +      - chunked
> +    body: 
> +      string: |
> +        <?xml version="1.0" encoding="UTF-8"?>
> +        <GetVDiskStatusResponse xmlns="http://apioviss.jp.fujitsu.com">
> +          <responseMessage>Processing was completed.</responseMessage>
> +          <responseStatus>SUCCESS</responseStatus>
> +          <vdiskStatus>NORMAL</vdiskStatus>
> +        </GetVDiskStatusResponse>
> +        
> +
> +    http_version: 
> +  recorded_at: Tue, 19 Feb 2013 05:06:24 GMT
> diff --git a/server/tests/drivers/fgcp/storage_volumes_test.rb b/server/tests/drivers/fgcp/storage_volumes_test.rb
> new file mode 100644
> index 0000000..ed51278
> --- /dev/null
> +++ b/server/tests/drivers/fgcp/storage_volumes_test.rb
> @@ -0,0 +1,58 @@
> +require 'rubygems'
> +require 'require_relative' if RUBY_VERSION < '1.9'
> +
> +require_relative 'common'
> +
> +describe 'FGCPDriver StorageVolumes' do
> +
> +  before do
> +    @driver = Deltacloud::new(:fgcp, credentials)
> +    VCR.insert_cassette __name__
> +  end
> +
> +  after do
> +    VCR.eject_cassette
> +  end
> +
> +  it 'must throw error when wrong credentials' do
> +    Proc.new do
> +      @driver.backend.storage_volumes(OpenStruct.new(:user => 'unknown', :password
=> 'wrong'))
> +    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
> +  end
> +
> +  it 'must return list of storage_volumes' do
> +    @driver.storage_volumes.wont_be_empty
> +    @driver.storage_volumes.first.must_be_kind_of StorageVolume
> +  end
> +
> +  it 'must allow to filter storage_volumes' do
> +    storage_volumes = @driver.storage_volumes(:id => 'UZXC0GRT-ZG8ZJCJ07-D-0039')
> +    storage_volumes.wont_be_empty
> +    storage_volumes.must_be_kind_of Array
> +    storage_volumes.size.must_equal 1
> +    storage_volumes.first.id.must_equal 'UZXC0GRT-ZG8ZJCJ07-D-0039'
> +    @driver.storage_volumes(:id => 'unknown').must_be_empty
> +  end
> +
> +  it 'must allow to retrieve single storage_volume' do
> +    storage_volume = @driver.storage_volume(:id => 'UZXC0GRT-ZG8ZJCJ07-D-0039')
> +    storage_volume.wont_be_nil
> +    storage_volume.must_be_kind_of StorageVolume
> +    storage_volume.id.must_equal 'UZXC0GRT-ZG8ZJCJ07-D-0039'
> +    @driver.storage_volume(:id => 'unknown').must_be_nil
> +  end
> +
> +  it 'must allow to create the storage volume' do
> +    volume = @driver.create_storage_volume(:name => 'Test Volume', :capacity =>
'2')
> +    volume.must_be_kind_of StorageVolume
> +    volume.name.must_equal 'Test Volume'
> +    volume.capacity.must_equal '10.0' # note that it's rounded up to a multiple of ten
> +    volume2 = @driver.storage_volume(:id => volume.id)
> +    volume2.wont_be_nil
> +    volume2.must_be_kind_of StorageVolume
> +    volume2.id.must_equal volume.id
> +    volume2.name.must_equal volume.name
> +    volume2.capacity.must_equal volume.capacity
> +  end
> +
> +end
> -- 
> 1.8.0.msysgit.0
> 
> 

-- 
Michal Fojtik <mfojtik@redhat.com>
Deltacloud API, CloudForms

Mime
View raw message