azure 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/azure.gemspec +1 -1
  3. data/lib/azure.rb +1 -0
  4. data/lib/azure/blob/blob.rb +1 -1
  5. data/lib/azure/blob/blob_service.rb +14 -9
  6. data/lib/azure/blob/block.rb +2 -2
  7. data/lib/azure/blob/serialization.rb +6 -6
  8. data/lib/azure/configurable.rb +8 -0
  9. data/lib/azure/core/filtered_service.rb +1 -1
  10. data/lib/azure/core/http/debug_filter.rb +2 -2
  11. data/lib/azure/core/http/http_error.rb +1 -1
  12. data/lib/azure/core/http/http_filter.rb +15 -15
  13. data/lib/azure/core/http/http_request.rb +6 -6
  14. data/lib/azure/core/http/http_response.rb +1 -1
  15. data/lib/azure/core/http/retry_policy.rb +12 -12
  16. data/lib/azure/core/http/signer_filter.rb +1 -1
  17. data/lib/azure/core/service.rb +1 -1
  18. data/lib/azure/queue/queue_service.rb +91 -91
  19. data/lib/azure/queue/serialization.rb +1 -1
  20. data/lib/azure/service/cors.rb +1 -1
  21. data/lib/azure/service/logging.rb +1 -1
  22. data/lib/azure/service/metrics.rb +1 -1
  23. data/lib/azure/service/serialization.rb +10 -10
  24. data/lib/azure/service/signed_identifier.rb +1 -1
  25. data/lib/azure/service/storage_service.rb +2 -2
  26. data/lib/azure/service_bus/auth/wrap_service.rb +2 -2
  27. data/lib/azure/service_bus/brokered_message.rb +6 -6
  28. data/lib/azure/service_bus/interval.rb +2 -2
  29. data/lib/azure/service_bus/queue.rb +11 -11
  30. data/lib/azure/service_bus/relay.rb +4 -4
  31. data/lib/azure/service_bus/resource.rb +1 -1
  32. data/lib/azure/service_bus/rule.rb +1 -1
  33. data/lib/azure/service_bus/serialization.rb +2 -2
  34. data/lib/azure/service_bus/service_bus_service.rb +92 -92
  35. data/lib/azure/service_bus/sql_filter.rb +1 -1
  36. data/lib/azure/service_bus/sql_rule_action.rb +3 -3
  37. data/lib/azure/service_bus/subscription.rb +1 -1
  38. data/lib/azure/service_bus/topic.rb +11 -11
  39. data/lib/azure/storage_management/storage_management_service.rb +2 -2
  40. data/lib/azure/table/batch.rb +28 -28
  41. data/lib/azure/table/batch_response.rb +5 -5
  42. data/lib/azure/table/edmtype.rb +1 -1
  43. data/lib/azure/table/entity.rb +2 -2
  44. data/lib/azure/table/query.rb +6 -6
  45. data/lib/azure/table/serialization.rb +4 -4
  46. data/lib/azure/table/table_service.rb +30 -30
  47. data/lib/azure/version.rb +1 -1
  48. data/lib/azure/virtual_machine_management/virtual_machine_management_service.rb +5 -4
  49. data/lib/azure/virtual_network_management/serialization.rb +2 -2
  50. data/test/fixtures/list_os_images.xml +1 -1
  51. data/test/fixtures/list_virtual_networks.xml +0 -1
  52. data/test/fixtures/management_certificate.pem +55 -0
  53. data/test/fixtures/management_certificate.publishsettings +12 -0
  54. data/test/fixtures/updated_storage_accounts.xml +8 -8
  55. data/test/integration/blob/blob_metadata_test.rb +5 -5
  56. data/test/integration/blob/blob_pages_test.rb +5 -5
  57. data/test/integration/blob/blob_properties_test.rb +3 -3
  58. data/test/integration/blob/block_blob_test.rb +64 -15
  59. data/test/integration/blob/container/container_acl_test.rb +2 -2
  60. data/test/integration/blob/container/container_metadata_test.rb +2 -2
  61. data/test/integration/blob/container/create_container_test.rb +3 -3
  62. data/test/integration/blob/container/delete_container_test.rb +1 -1
  63. data/test/integration/blob/container/get_container_properties_test.rb +2 -2
  64. data/test/integration/blob/container/list_containers_test.rb +3 -3
  65. data/test/integration/blob/copy_blob_test.rb +4 -4
  66. data/test/integration/blob/create_blob_snapshot_test.rb +2 -2
  67. data/test/integration/blob/create_page_blob_test.rb +2 -2
  68. data/test/integration/blob/delete_blob_test.rb +4 -4
  69. data/test/integration/blob/get_blob_test.rb +7 -7
  70. data/test/integration/blob/informative_errors_test.rb +2 -2
  71. data/test/integration/blob/lease/acquire_lease_test.rb +1 -1
  72. data/test/integration/blob/lease/break_lease_test.rb +2 -2
  73. data/test/integration/blob/lease/release_lease_test.rb +2 -2
  74. data/test/integration/blob/lease/renew_lease_test.rb +2 -2
  75. data/test/integration/blob/list_blobs_test.rb +1 -1
  76. data/test/integration/database/delete_sql_server_firewall_test.rb +0 -1
  77. data/test/integration/database/delete_sql_server_test.rb +0 -1
  78. data/test/integration/location/Location_List_test.rb +0 -1
  79. data/test/integration/location/RoleSize_List_test.rb +0 -1
  80. data/test/integration/queue/clear_messages_test.rb +3 -3
  81. data/test/integration/queue/create_message_test.rb +5 -5
  82. data/test/integration/queue/create_queue_test.rb +1 -1
  83. data/test/integration/queue/delete_message_test.rb +4 -4
  84. data/test/integration/queue/delete_queue_test.rb +1 -1
  85. data/test/integration/queue/informative_errors_test.rb +2 -2
  86. data/test/integration/queue/list_messages_encoded_test.rb +2 -2
  87. data/test/integration/queue/list_messages_test.rb +3 -3
  88. data/test/integration/queue/list_queues_test.rb +1 -1
  89. data/test/integration/queue/peek_messages_test.rb +3 -3
  90. data/test/integration/queue/queue_metadata_test.rb +4 -4
  91. data/test/integration/queue/update_message_test.rb +4 -4
  92. data/test/integration/service_bus/informative_errors_test.rb +1 -1
  93. data/test/integration/service_bus/queues_test.rb +6 -6
  94. data/test/integration/service_bus/relay_test.rb +3 -3
  95. data/test/integration/service_bus/rules_test.rb +2 -2
  96. data/test/integration/service_bus/subscriptions_test.rb +4 -4
  97. data/test/integration/service_bus/topics_test.rb +2 -2
  98. data/test/integration/table/delete_entity_batch_test.rb +3 -3
  99. data/test/integration/table/delete_entity_test.rb +3 -3
  100. data/test/integration/table/delete_table_test.rb +1 -1
  101. data/test/integration/table/get_table_test.rb +4 -4
  102. data/test/integration/table/informative_errors_test.rb +2 -2
  103. data/test/integration/table/insert_entity_batch_test.rb +3 -3
  104. data/test/integration/table/insert_entity_test.rb +3 -3
  105. data/test/integration/table/insert_or_merge_entity_batch_test.rb +7 -7
  106. data/test/integration/table/insert_or_merge_entity_test.rb +8 -8
  107. data/test/integration/table/insert_or_replace_entity_batch_test.rb +7 -7
  108. data/test/integration/table/insert_or_replace_entity_test.rb +7 -7
  109. data/test/integration/table/merge_entity_batch_test.rb +1 -1
  110. data/test/integration/table/merge_entity_test.rb +1 -1
  111. data/test/integration/table/query_entities_test.rb +21 -21
  112. data/test/integration/table/query_tables_test.rb +2 -2
  113. data/test/integration/table/query_test.rb +21 -21
  114. data/test/integration/table/table_acl_test.rb +4 -4
  115. data/test/integration/table/update_entity_batch_test.rb +6 -6
  116. data/test/integration/table/update_entity_test.rb +8 -8
  117. data/test/unit/config/azure_test.rb +19 -0
  118. data/test/unit/core/auth/shared_key_lite_test.rb +3 -3
  119. data/test/unit/core/auth/shared_key_test.rb +2 -2
  120. data/test/unit/service/serialization_test.rb +44 -44
  121. metadata +4 -6
  122. data/.gitignore +0 -30
  123. data/.travis.yml +0 -13
  124. data/ChangeLog.txt +0 -56
  125. data/README.md +0 -702
@@ -17,7 +17,7 @@ module Azure
17
17
  class Version
18
18
  MAJOR = 0 unless defined? MAJOR
19
19
  MINOR = 7 unless defined? MINOR
20
- UPDATE = 0 unless defined? UPDATE
20
+ UPDATE = 1 unless defined? UPDATE
21
21
  PRE = nil unless defined? PRE
22
22
 
23
23
  class << self
@@ -174,8 +174,8 @@ module Azure
174
174
  image = get_image(params[:image])
175
175
  options[:os_type] = image.os_type
176
176
  validate_deployment_params(params, options, true)
177
- cloud_service = client.cloud_service_management
178
- cloud_service = cloud_service.get_cloud_service_properties(params[:cloud_service_name])
177
+ cloud_services = client.cloud_service_management
178
+ cloud_service = cloud_services.get_cloud_service_properties(params[:cloud_service_name])
179
179
  deployment_name = cloud_service.deployment_name
180
180
  Azure::Loggerx.error_with_exit "Deployment doesn't exists." if cloud_service && deployment_name.empty?
181
181
  others = {}
@@ -195,6 +195,7 @@ module Azure
195
195
  existing_ports << endpoint[:public_port]
196
196
  end
197
197
  end
198
+ cloud_services.upload_certificate(options[:cloud_service_name], params[:certificate]) unless params[:certificate].empty?
198
199
  options[:existing_ports] = existing_ports
199
200
  body = Serialization.role_to_xml(params, image, options).to_xml
200
201
  path = "/services/hostedservices/#{cloud_service.name}/deployments/#{deployment_name}/roles"
@@ -235,10 +236,10 @@ module Azure
235
236
  # Wait for 180s for disk to be released.
236
237
  disk = nil
237
238
  18.times do
238
- print '# '
239
+ Azure::Loggerx.info '# '
239
240
  disk = disk_management_service.get_virtual_machine_disk(disk_name)
240
241
  unless disk.attached
241
- print "Disk released.\n"
242
+ Azure::Loggerx.info "Disk released.\n"
242
243
  break
243
244
  end
244
245
  sleep 10
@@ -171,7 +171,7 @@ module Azure
171
171
  dns_list = {}
172
172
  dns_list.merge!(merge_dns(new_dns_servers))
173
173
  dns_list.merge!(merge_dns(dns_servers))
174
-
174
+
175
175
  dns_list.each do |name, ip_address|
176
176
  xml.DnsServer('name' => name, 'IPAddress' => ip_address)
177
177
  end
@@ -179,7 +179,7 @@ module Azure
179
179
 
180
180
  def self.merge_dns(dns_list)
181
181
  new_dns_list = {}
182
-
182
+
183
183
  dns_list.each do |dns|
184
184
  unless dns_list.include?(dns[:name])
185
185
  new_dns_list.merge!(dns[:name] => dns[:ip_address])
@@ -61,7 +61,7 @@
61
61
  <Eula>http://www.ubuntu.com/project/about-ubuntu/licensing;http://www.ubuntu.com/aboutus/privacypolicy;http://www.ubuntu.com/aboutus/privacypolicy</Eula>
62
62
  <Description>Ubuntu Server 12.04.2 LTS (amd64 20130325) for Microsoft Azure. Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu 12.04.2 LTS will be available until 2017-04-26. Ubuntu Server is the perfect platform for all workloads from web applications to NoSQL databases and Hadoop. More information can be found at:
63
63
  http://www.ubuntu.com/business/server</Description>
64
- </OSImage>
64
+ </OSImage>
65
65
  <OSImage>
66
66
  <Category>SUSE</Category>
67
67
  <Label>SUSE Linux Enterprise Server 11 Service Pack 2</Label>
@@ -89,4 +89,3 @@
89
89
  </Subnets>
90
90
  </VirtualNetworkSite>
91
91
  </VirtualNetworkSites>
92
-
@@ -0,0 +1,55 @@
1
+ Bag Attributes
2
+ localKeyID: 01 00 00 00
3
+ friendlyName: {D4417DE0-CB19-4947-B5B4-DE6D7F72171D}
4
+ Microsoft CSP Name: Microsoft Software Key Storage Provider
5
+ Key Attributes: <No Attributes>
6
+ -----BEGIN PRIVATE KEY-----
7
+ MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDlVqp43jiBkO2M
8
+ YOpCqofHsFHaooZCmYSAxyZGyxQLPEc4Zvft0uzIdQy6QnzN+MQkQ8hWrL+BNp2S
9
+ NYPFIXY9HYz5BZBMomM/lTsZltLgJSQENE6jTomznCgRy4GNg0hkaGkuhSSbWmBC
10
+ jmlfJXkbZgfGuc5Lz8BZYPWO5hvP23XIRnVIW44oKcQfvkS80qyyzFNa0vdp3rov
11
+ WdKV3QfScDIgTr0FQDANYTYWBV/r4xnXndjLOxgVwU3Kp0WPUkCz3uloMRGWs974
12
+ bpWGwnOblJb4j0X7Q46rTZ4f4HGZlKbeRV/MtPcrZJ+V6ovQ9tz1sUbbCbn4ABag
13
+ m+6NCcqRAgMBAAECggEAHHRMidsOeTrlUke7AQL9/j9o5H7KOCyqdTzgSaPMLJmx
14
+ v3R9GeeT48osBlcV+4a8MMCtNF3SE+LWGYwkuXptnGcUdNglH3D9befi0Ym2R8Or
15
+ 7I6d3CK0MJH1IcIVZJyviG+w7ynrURAdRdy8A6dXV5go6lXm296co3ZFeVGhDUCR
16
+ 838zthk0Ltf347nLerhJUhJAIOX7Ct21xMOrbT5KfOVThgTxrZKmP29ORMoqnXN8
17
+ 8SdpHsdqdNro8uSEARyG80g4ZZVPVqZqRLr+cX080lJ4p8GPf/nPOWGGrtGCCEgI
18
+ 1FCX8aWH3PGOSLqo3boSiZfrLHT5BhJsXD/OXJZPzQKBgQD9vl+jiZSHPoo63/JO
19
+ uKS0kGos6ZZc4WvjXx6JBrtnsOdw9YBAPKEY9VYyKi3fnv1v1gIB65e9rfeF+PmI
20
+ KXKLwLcZWFRbaaB3xs3Bxo0Yn1tRRvANDAKR8Xfl77B06j2kKrPmfdEbmd3hHJqN
21
+ ZYG4hj+PR1SQ+0jvwSg7cPtwrQKBgQDnYLxxoejm+JrEVGebvKv3AWDshBN+91dX
22
+ iM4u5zke4qzocp0RYpjIjkUIb6Y/jwxscZmgetu9keDBAFCPU2ReTjFGmHZiip72
23
+ xxQLF2dxlqgcSzURW9SjbstB0LUyxbTwIYTTOavHBrvnkw9S4rgLVHTVWzzInWag
24
+ iw4lbfBp9QKBgC7KTS6F7zqlQK4sn6z+hXi6bKnNhSmpc9CguKvB7wrm5zbAPp8Z
25
+ zwcgLn3fo0fqNIfL6eDaxcd3bf5pc/I02meE6P6meB/HMY0Fe72w1FHnCNrK/vcY
26
+ 8Nxir55Z/asBis5cBYKKTuYNEIozURij0DDrqIrON3zoqYF0l+umIOedAoGAYiTn
27
+ ai/qkeaMB5Fh7W6HZxvfmBOiDW4vT0MJal3MHey6uVK8iz5OXmvynlR1qWotM+av
28
+ 6qGSigPR2Swf/9u4rEPwpOhQ9xWjvjvNpbLEvyrPnkjMdtOEC9sYPo+f/KxeRqmB
29
+ JPPGiIKzu9PmYRsoRC4L7OBplRMnEBxL4NaUbu0CgYEA2z7BuOzuE3QmxaNzbP7+
30
+ PWkRg0JEFksN/8bRo6fuVMaosEs4jZunCyPk0ne//p+dcKE8cInC9/jGJs5XutUi
31
+ L8KuTu3ljFOLE/y+8FHR/Hxpvzp8k6iDPl7mvvZJ7gt2aO9IZq3XHoRLbgSUPo2X
32
+ YlXoh+vo+SQVRQtbxpuk1gM=
33
+ -----END PRIVATE KEY-----
34
+ Bag Attributes
35
+ localKeyID: 01 00 00 00
36
+ friendlyName: Ruby SDK
37
+ subject=/CN=Windows Azure Tools
38
+ issuer=/CN=Windows Azure Tools
39
+ -----BEGIN CERTIFICATE-----
40
+ MIICxDCCAaygAwIBAgIQQ86pQDjNkolP6pILfxFhITANBgkqhkiG9w0BAQUFADAe
41
+ MRwwGgYDVQQDExNXaW5kb3dzIEF6dXJlIFRvb2xzMB4XDTEzMDUxNjA0NDgzNloX
42
+ DTE0MDUxNjA0NDgzNlowHjEcMBoGA1UEAxMTV2luZG93cyBBenVyZSBUb29sczCC
43
+ ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOVWqnjeOIGQ7Yxg6kKqh8ew
44
+ UdqihkKZhIDHJkbLFAs8Rzhm9+3S7Mh1DLpCfM34xCRDyFasv4E2nZJ1g8Uhdj0d
45
+ jPkFkEyiYz+VOxmW0uAlJCQ0TqNOibOcKBHLgY2DSGRoaS6FJJtaYEKOaV8leRtm
46
+ B8a5zkvPsFlg9Y7mG8/bdchGdUhbjigpxB++RLzSrLLMU1rS92neui9Z0pXdB9Jw
47
+ MiBOvQVAMA1hNhYFX+vjGded2Ms7GBXBTcqnRY9SQLPe6WgxEZaz3vaulYbCc5uU
48
+ lviPRftDjqtNnh/gcZmUpt5FX8y09ytkn5Xqi9D23PWxRtsJufgAFqCb7o0JypEC
49
+ AwEAATANBgkqhkiG9w0BAQUFAAOCAQEAFkhTUWZN3xvh50zvDBRJgvc83kx61Npl
50
+ J1G6F98aa+mdZmkbXLdNt+dHR+aGg/0RAs97yPoSc9km5uedEpQQD0xDh9X84jSv
51
+ GnrGTsmjBMJvE8jhT0P/zGfTKfncQOx00cVcNm5F1GdWsni7OcVuOLQ+0se8VHsR
52
+ JSQBBWQVZOXJp2zYs935jrI47bCCNSNFQ1sAvxFdMeBZKwtmvhp1c6Zl3j/KVbvL
53
+ S0Izpu1vXvozNDo6HmJPhpONU6qlMfU2iSzUQN21PRt82vMOVx4xyBzbm6vPc50g
54
+ PR10SWXaXL/UmBlxfJ3nhD1YgqIQtWMdbSQ81j3MzrGrrlIdjPUFOw==
55
+ -----END CERTIFICATE-----
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <PublishData>
3
+ <PublishProfile
4
+ SchemaVersion="2.0"
5
+ PublishMethod="AzureServiceManagementAPI">
6
+ <Subscription
7
+ ServiceManagementUrl="https://management.core.windows.net"
8
+ Id="subscription-id"
9
+ Name="Fixtures Publish Settings"
10
+ ManagementCertificate="MIIKJAIBAzCCCeQGCSqGSIb3DQEHAaCCCdUEggnRMIIJzTCCBe4GCSqGSIb3DQEHAaCCBd8EggXbMIIF1zCCBdMGCyqGSIb3DQEMCgECoIIE7jCCBOowHAYKKoZIhvcNAQwBAzAOBAhkKi7sehIQSQICB9AEggTIrbgAmwk2hP+b9ij1ZyumDglDcDhNhGbhr8mZJVoRy9mCXcHTx9EcfwZSQBggxsUFEFvhbrSbqqm75KYRcn3hM9KKE/JsS1PvVA2BzT0QWB7xg7TIRtW8wzaisT2HTrIJzyf+J4DEUVAEqm1QmEarGVBKNWhlJkzR46w43o1IyqPI4+WqhU/PwFL36QIoK+sha8t2K2ujltnXJ0K6Dk93L+ViukqM5RMq92op3hG04w138IDgI1hN6QAY6JgqDuSlQMiy3eacBKXltQ1C8q7q4pk+bvtGVbhR0BiU5tVJLoSmCyRgQGmsau2soQ7oKfbwLGIHtfGbqrIIm+i0qm9BftFAQ5LZMhISrXWIULh4l52AXynkF16R9QPMc7Ia/ZN9pt/qas+oC6Lb5ZQlwL5EZstSaSKfka+aF1XVI5u9Cok/ovDenowCGCv07yXlO17YbNer3IZvPi15khXoVeQL1Kf8v7Ln6RLi0vpMK8kNcWTBzYPiHZgmsFIArxEWA6cfH1ipHfjw475xBKpvJK18MPolezawq6YKlYmkxRo6198nhTYw/yB8K1tZG1DnvoRJxGK+Xn6m8mp+ED08LnVe6ThKw1N4AtL2zJ1USDKgJZY/lbGhkSU1ShfNSGsHIH1jKe//W+sy+qL4y/c7onLKTS+AwFyr3Pv3W2wVuROsbo6hv5r3qZVtwFvRxxZGLMplDWUFjOECHxnjzcP75lALRuwkVk+tZ1/C+laYOWQ0R5nQO5/b6OMRTx7Mv1aSGK7x0/OTxV2Qzn8ovDiDPid1g3bgyGNupgymTibIENYrpBwiTV+DULrgCb6KvQhydsLRiqkfJQHMChzbl5h0/INr3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QJE38Uf/F4XyFfo95GQrIYPIHMUUTFHIKz+6DH5uFyHoxUborfcSDJV8WsOK7fjLVfVpXnXyawW4rlew0ka1NVRWI/JZ82/NK5ANrI7gQ2fI3gkSeSrsgz8PaFWnIsckORBRvNgrxnpsoxA/ah4eRG4DQnSLnxikWkHNIsj4f+X/5dUdlVeG20mUHWaXMtox7C8wNzAfMAcGBSsOAwIaBBQtUTr50mNJJsPft6WiX1yeoI5OPgQUW3CTjHm9GpuoAT8vkw/MVBiSEDc=" />
11
+ </PublishProfile>
12
+ </PublishData>
@@ -42,14 +42,14 @@
42
42
  <AccountType>Standard_GRS</AccountType>
43
43
  </StorageServiceProperties>
44
44
  <ExtendedProperties>
45
- <ExtendedProperty>
46
- <Name>prop_1_name</Name>
47
- <Value>prop_1_value</Value>
48
- </ExtendedProperty>
49
- <ExtendedProperty>
50
- <Name>prop_2_name</Name>
51
- <Value>prop_2_value</Value>
52
- </ExtendedProperty>
45
+ <ExtendedProperty>
46
+ <Name>prop_1_name</Name>
47
+ <Value>prop_1_value</Value>
48
+ </ExtendedProperty>
49
+ <ExtendedProperty>
50
+ <Name>prop_2_name</Name>
51
+ <Value>prop_2_value</Value>
52
+ </ExtendedProperty>
53
53
  </ExtendedProperties>
54
54
  </StorageService>
55
55
  </StorageServices>
@@ -18,13 +18,13 @@ require "azure/blob/blob_service"
18
18
  describe Azure::Blob::BlobService do
19
19
  subject { Azure::Blob::BlobService.new }
20
20
  after { TableNameHelper.clean }
21
-
21
+
22
22
  describe '#set/get_blob_metadata' do
23
23
  let(:container_name) { ContainerNameHelper.name }
24
24
  let(:blob_name) { "blobname" }
25
25
  let(:length) { 1024 }
26
26
  let(:metadata){ {"custommetadata" => "CustomMetadataValue"} }
27
- before {
27
+ before {
28
28
  subject.create_container container_name
29
29
  subject.create_page_blob container_name, blob_name, length
30
30
  }
@@ -40,7 +40,7 @@ describe Azure::Blob::BlobService do
40
40
  }
41
41
  end
42
42
 
43
- describe 'when a blob has a snapshot' do
43
+ describe 'when a blob has a snapshot' do
44
44
  let(:snapshot) { subject.create_blob_snapshot container_name, blob_name, {:metadata => metadata }}
45
45
  before { s = snapshot }
46
46
 
@@ -53,7 +53,7 @@ describe Azure::Blob::BlobService do
53
53
  blob.metadata.must_include k
54
54
  blob.metadata[k].must_equal v
55
55
  }
56
-
56
+
57
57
  end
58
58
 
59
59
  it 'errors if the snapshot does not exist' do
@@ -62,7 +62,7 @@ describe Azure::Blob::BlobService do
62
62
  end
63
63
  end
64
64
  end
65
-
65
+
66
66
  it 'errors if the blob name does not exist' do
67
67
  assert_raises(Azure::Core::Http::HTTPError) do
68
68
  subject.get_blob_metadata container_name, "thisblobdoesnotexist"
@@ -18,17 +18,17 @@ require 'azure/blob/blob_service'
18
18
  describe Azure::Blob::BlobService do
19
19
  subject { Azure::Blob::BlobService.new }
20
20
  after { TableNameHelper.clean }
21
-
21
+
22
22
  let(:container_name) { ContainerNameHelper.name }
23
23
  let(:blob_name) { 'blobname' }
24
24
  let(:blob_name2) { 'blobname2' }
25
25
  let(:length) { 2560 }
26
- before {
26
+ before {
27
27
  subject.create_container container_name
28
28
  subject.create_page_blob container_name, blob_name, length
29
29
  subject.create_page_blob container_name, blob_name2, length
30
30
  }
31
-
31
+
32
32
  describe '#create_blob_pages' do
33
33
  it 'creates pages in a page blob' do
34
34
  content = ''
@@ -67,7 +67,7 @@ describe Azure::Blob::BlobService do
67
67
  end
68
68
 
69
69
  describe '#clear_blob_pages' do
70
- before {
70
+ before {
71
71
  content = ''
72
72
  512.times.each{|i| content << '@' }
73
73
 
@@ -100,7 +100,7 @@ describe Azure::Blob::BlobService do
100
100
  end
101
101
 
102
102
  describe '#list_page_blob_ranges' do
103
- before {
103
+ before {
104
104
  content = ''
105
105
  512.times.each{|i| content << '@' }
106
106
 
@@ -23,7 +23,7 @@ describe Azure::Blob::BlobService do
23
23
  let(:container_name) { ContainerNameHelper.name }
24
24
  let(:blob_name) { "blobname" }
25
25
  let(:length) { 1024 }
26
- before {
26
+ before {
27
27
  subject.create_container container_name
28
28
  subject.create_page_blob container_name, blob_name, length
29
29
  }
@@ -47,7 +47,7 @@ describe Azure::Blob::BlobService do
47
47
  before {
48
48
  subject.set_blob_properties container_name, blob_name, options
49
49
  }
50
-
50
+
51
51
  it 'gets properties for a blob snapshot' do
52
52
  snapshot = subject.create_blob_snapshot container_name, blob_name
53
53
  blob = subject.get_blob_properties container_name, blob_name, { :snapshot => snapshot }
@@ -64,7 +64,7 @@ describe Azure::Blob::BlobService do
64
64
  end
65
65
  end
66
66
  end
67
-
67
+
68
68
  it 'errors if the blob name does not exist' do
69
69
  assert_raises(Azure::Core::Http::HTTPError) do
70
70
  subject.get_blob_properties container_name, "thisblobdoesnotexist"
@@ -18,19 +18,68 @@ require 'base64'
18
18
 
19
19
  describe Azure::Blob::BlobService do
20
20
  subject { Azure::Blob::BlobService.new }
21
- after { TableNameHelper.clean }
22
21
 
23
22
  let(:container_name) { ContainerNameHelper.name }
24
23
  let(:blob_name) { "blobname" }
25
24
  let(:content) { content = ""; 512.times.each{|i| content << "@" }; content }
26
- before {
27
- subject.create_container container_name
28
- }
29
-
25
+ let(:file_path) { "/tmp/azure-sdk-for-ruby-blob.txt" }
26
+
27
+ before { subject.create_container container_name }
28
+ after { ContainerNameHelper.clean }
29
+
30
30
  describe '#create_block_blob' do
31
- it 'creates a page blob' do
32
- blob = subject.create_block_blob container_name, blob_name, content
31
+ it 'creates a block blob with String body (default encoding)' do
32
+ subject.create_block_blob container_name, blob_name, content
33
+ blob = subject.get_blob_properties container_name, blob_name
34
+ blob.name.must_equal blob_name
35
+ blob.properties[:content_encoding].must_equal content.encoding.to_s.downcase
36
+ end
37
+
38
+ it 'creates a block blob with String body (content-encoding)' do
39
+ options = {
40
+ :content_encoding=>"ascii"
41
+ }
42
+
43
+ subject.create_block_blob container_name, blob_name, content, options
44
+ blob = subject.get_blob_properties container_name, blob_name
33
45
  blob.name.must_equal blob_name
46
+ blob.properties[:content_encoding].must_equal options[:content_encoding]
47
+ end
48
+
49
+ it 'creates a block blob with IO body (default encoding)' do
50
+ begin
51
+ File.delete(file_path) if File.exist?(file_path)
52
+ File.write(file_path, content);
53
+ file = File.open(file_path)
54
+
55
+ subject.create_block_blob container_name, blob_name, file
56
+ blob = subject.get_blob_properties container_name, blob_name
57
+ blob.name.must_equal blob_name
58
+ blob.properties[:content_encoding].must_equal file.external_encoding.to_s.downcase
59
+ ensure
60
+ file.close if file
61
+ File.delete(file_path) if File.exist?(file_path)
62
+ end
63
+ end
64
+
65
+ it 'creates a block blob with IO body (content-encoding)' do
66
+ begin
67
+ options = {
68
+ :content_encoding=>"ascii"
69
+ }
70
+
71
+ File.delete(file_path) if File.exist?(file_path)
72
+ File.write(file_path, content);
73
+ file = File.open(file_path)
74
+
75
+ subject.create_block_blob container_name, blob_name, file, options
76
+ blob = subject.get_blob_properties container_name, blob_name
77
+ blob.name.must_equal blob_name
78
+ blob.properties[:content_encoding].must_equal options[:content_encoding]
79
+ ensure
80
+ file.close if file
81
+ File.delete(file_path) if File.exist?(file_path)
82
+ end
34
83
  end
35
84
 
36
85
  it 'sets additional properties when the options hash is used' do
@@ -78,7 +127,7 @@ describe Azure::Blob::BlobService do
78
127
 
79
128
  describe '#commit_blob_blocks' do
80
129
  let(:blocklist) { [["anyblockid0"], ["anyblockid1"]] }
81
- before {
130
+ before {
82
131
  blocklist.each { |block_entry|
83
132
  subject.create_blob_block container_name, blob_name, block_entry[0], content
84
133
  }
@@ -111,8 +160,8 @@ describe Azure::Blob::BlobService do
111
160
 
112
161
  describe '#list_blob_blocks' do
113
162
  let(:blocklist) { [["anyblockid0"], ["anyblockid1"], ["anyblockid2"], ["anyblockid3"]] }
114
- before {
115
-
163
+ before {
164
+
116
165
  subject.create_blob_block container_name, blob_name, blocklist[0][0], content
117
166
  subject.create_blob_block container_name, blob_name, blocklist[1][0], content
118
167
 
@@ -140,7 +189,7 @@ describe Azure::Blob::BlobService do
140
189
 
141
190
  uncommitted = result[:uncommitted]
142
191
  uncommitted.length.must_equal 2
143
-
192
+
144
193
  expected_blocks = blocklist.slice(2..3).each
145
194
 
146
195
  uncommitted.each { |block|
@@ -156,10 +205,10 @@ describe Azure::Blob::BlobService do
156
205
 
157
206
  committed = result[:committed]
158
207
  committed.length.must_equal 0
159
-
208
+
160
209
  uncommitted = result[:uncommitted]
161
210
  uncommitted.length.must_equal 2
162
-
211
+
163
212
  expected_blocks = blocklist.slice(2..3).each
164
213
 
165
214
  uncommitted.each { |block|
@@ -168,13 +217,13 @@ describe Azure::Blob::BlobService do
168
217
  block.size.must_equal 512
169
218
  }
170
219
  end
171
-
220
+
172
221
  it 'lists committed blocks only if :committed is passed' do
173
222
  result = subject.list_blob_blocks container_name, blob_name, { :blocklist_type => :committed }
174
223
 
175
224
  committed = result[:committed]
176
225
  committed.length.must_equal 2
177
-
226
+
178
227
  expected_blocks = blocklist.slice(0..1).each
179
228
 
180
229
  committed.each { |block|
@@ -19,7 +19,7 @@ require "azure/service/signed_identifier"
19
19
  describe Azure::Blob::BlobService do
20
20
  subject { Azure::Blob::BlobService.new }
21
21
  after { TableNameHelper.clean }
22
-
22
+
23
23
  describe '#set/get_container_acl' do
24
24
  let(:container_name) { ContainerNameHelper.name }
25
25
  let(:public_access_level) { :container.to_s }
@@ -31,7 +31,7 @@ describe Azure::Blob::BlobService do
31
31
  identifier.access_policy.permission = "rwd"
32
32
  [identifier]
33
33
  }
34
- before {
34
+ before {
35
35
  subject.create_container container_name
36
36
  }
37
37
 
@@ -18,11 +18,11 @@ require "azure/blob/blob_service"
18
18
  describe Azure::Blob::BlobService do
19
19
  subject { Azure::Blob::BlobService.new }
20
20
  after { TableNameHelper.clean }
21
-
21
+
22
22
  describe '#set/get_container_metadata' do
23
23
  let(:container_name) { ContainerNameHelper.name }
24
24
  let(:metadata) { { "CustomMetadataProperty"=>"CustomMetadataValue" } }
25
- before {
25
+ before {
26
26
  subject.create_container container_name
27
27
  }
28
28
 
@@ -32,7 +32,7 @@ describe Azure::Blob::BlobService do
32
32
  metadata = { 'CustomMetadataProperty' => 'CustomMetadataValue'}
33
33
 
34
34
  container = subject.create_container container_name, { :metadata => metadata }
35
-
35
+
36
36
  container.name.must_equal container_name
37
37
  container.metadata.must_equal metadata
38
38
  container = subject.get_container_metadata container_name
@@ -45,12 +45,12 @@ describe Azure::Blob::BlobService do
45
45
 
46
46
  it 'errors if the container already exists' do
47
47
  subject.create_container container_name
48
-
48
+
49
49
  assert_raises(Azure::Core::Http::HTTPError) do
50
50
  subject.create_container container_name
51
51
  end
52
52
  end
53
-
53
+
54
54
  it 'errors if the container name is invalid' do
55
55
  assert_raises(Azure::Core::Http::HTTPError) do
56
56
  subject.create_container 'this_container.cannot-exist!'