azure 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.txt +7 -1
- data/README.md +32 -0
- data/lib/azure/version.rb +1 -1
- data/lib/azure/virtual_machine_image_management/serialization.rb +3 -0
- data/lib/azure/virtual_machine_image_management/virtual_machine_disk.rb +1 -1
- data/lib/azure/virtual_machine_image_management/virtual_machine_image_management_service.rb +5 -0
- data/lib/azure/virtual_machine_management/serialization.rb +179 -63
- data/lib/azure/virtual_machine_management/virtual_machine.rb +1 -0
- data/lib/azure/virtual_machine_management/virtual_machine_management_service.rb +206 -40
- data/test/fixtures/list_images.xml +1 -1
- data/test/fixtures/virtual_machine.xml +5 -0
- data/test/integration/vm/VM_Create_test.rb +46 -44
- data/test/integration/vm/VM_Delete_test.rb +19 -19
- data/test/integration/vm/VM_Operations_test.rb +174 -0
- data/test/support/virtual_machine_name_generator.rb +19 -34
- data/test/unit/virtual_machine_image_management/virtual_machine_image_management_service_test.rb +8 -3
- data/test/unit/virtual_machine_management/serialization_test.rb +127 -40
- data/test/unit/virtual_machine_management/virtual_machine_management_service_test.rb +205 -153
- metadata +3 -4
- data/test/integration/vm/VM_List_test.rb +0 -71
- data/test/integration/vm/VM_ShutDown_test.rb +0 -59
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-03-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -387,8 +387,7 @@ files:
|
|
387
387
|
- test/integration/test_helper.rb
|
388
388
|
- test/integration/vm/VM_Create_test.rb
|
389
389
|
- test/integration/vm/VM_Delete_test.rb
|
390
|
-
- test/integration/vm/
|
391
|
-
- test/integration/vm/VM_ShutDown_test.rb
|
390
|
+
- test/integration/vm/VM_Operations_test.rb
|
392
391
|
- test/integration/vm_image/virtual_machine_disk_test.rb
|
393
392
|
- test/integration/vm_image/virtual_machine_image_test.rb
|
394
393
|
- test/integration/vnet/Virtual_Network_Create_test.rb
|
@@ -1,71 +0,0 @@
|
|
1
|
-
#-------------------------------------------------------------------------
|
2
|
-
# # Copyright (c) Microsoft and contributors. All rights reserved.
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
#--------------------------------------------------------------------------
|
15
|
-
require "integration/test_helper"
|
16
|
-
|
17
|
-
describe Azure::VirtualMachineManagementService do
|
18
|
-
|
19
|
-
subject { Azure::VirtualMachineManagementService.new }
|
20
|
-
|
21
|
-
describe "#list_virtual_machines" do
|
22
|
-
let(:names) { VirtualMachineNameHelper.name }
|
23
|
-
let(:virtual_machine_name) { names.first}
|
24
|
-
let(:cloud_service_name) { names.last }
|
25
|
-
|
26
|
-
before {
|
27
|
-
Loggerx.expects(:puts).at_least_once.returns(nil)
|
28
|
-
params = {
|
29
|
-
:vm_name => virtual_machine_name,
|
30
|
-
:vm_user => 'user',
|
31
|
-
:image => LinuxImage.name,
|
32
|
-
:password => 'User123',
|
33
|
-
:location => LinuxImageLocation
|
34
|
-
}
|
35
|
-
options = {
|
36
|
-
:storage_account_name => StorageAccountName,
|
37
|
-
:cloud_service_name => cloud_service_name,
|
38
|
-
}
|
39
|
-
subject.create_virtual_machine(params,options)
|
40
|
-
sleep 60
|
41
|
-
}
|
42
|
-
|
43
|
-
it "returns a list of virtual machine images" do
|
44
|
-
virtualmachines = subject.list_virtual_machines
|
45
|
-
virtualmachine = virtualmachines.select {|x| x.vm_name == virtual_machine_name && x.cloud_service_name == cloud_service_name}.first
|
46
|
-
|
47
|
-
virtualmachines.wont_be_nil
|
48
|
-
virtualmachines.must_be_kind_of Array
|
49
|
-
virtualmachine.must_be_kind_of Azure::VirtualMachineManagement::VirtualMachine
|
50
|
-
virtualmachine.hostname.must_equal virtual_machine_name unless virtualmachine.hostname.empty?
|
51
|
-
%w[RoleStateUnknown ReadyRole Provisioning BusyRole CreatingVM].must_include virtualmachine.status
|
52
|
-
|
53
|
-
assert_equal(virtualmachine.vm_name, virtual_machine_name, "difference in VM name")
|
54
|
-
assert_equal(virtualmachine.role_size, 'Small', "difference in VM rolesize")
|
55
|
-
assert_equal(virtualmachine.cloud_service_name, cloud_service_name, "difference in cludservicename")
|
56
|
-
assert_equal(virtualmachine.deployment_name, cloud_service_name, "difference in dployment")
|
57
|
-
assert_equal(virtualmachine.deployment_status, 'Running', "difference in dployment status")
|
58
|
-
|
59
|
-
refute_equal(virtualmachine.vm_name, 'abctest', "VM names must not same")
|
60
|
-
refute_equal(virtualmachine.status, 'StoppedVM'," VM status must not same")
|
61
|
-
refute_equal(virtualmachine.role_size, 'big', "VM rolesizes must not same")
|
62
|
-
refute_equal(virtualmachine.hostname, 'abctest3', "VM hostname must not same")
|
63
|
-
refute_equal(virtualmachine.cloud_service_name, 'service1', "cloudservice name must not same")
|
64
|
-
refute_equal(virtualmachine.deployment_name, 'xyz123', "VM deployment name must not same")
|
65
|
-
refute_equal(virtualmachine.deployment_status, 'Stopped', "VM deployment_status must not same")
|
66
|
-
refute_equal(virtualmachine.ipaddress, '157.56.164.134', "VM ipaddress must not same")
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
#-------------------------------------------------------------------------
|
2
|
-
# Copyright 2013 Microsoft Open Technologies, Inc.
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
#--------------------------------------------------------------------------
|
15
|
-
require "integration/test_helper"
|
16
|
-
|
17
|
-
describe Azure::VirtualMachineManagementService do
|
18
|
-
let(:names) { VirtualMachineNameHelper.name }
|
19
|
-
let(:virtual_machine_name) { names.first}
|
20
|
-
let(:cloud_service_name) { names.last }
|
21
|
-
|
22
|
-
subject {Azure::VirtualMachineManagementService.new }
|
23
|
-
|
24
|
-
before :all do
|
25
|
-
Loggerx.expects(:puts).at_least_once.returns(nil)
|
26
|
-
params = {
|
27
|
-
:vm_name => virtual_machine_name,
|
28
|
-
:vm_user => 'user',
|
29
|
-
:image => LinuxImage.name,
|
30
|
-
:password => 'User123',
|
31
|
-
:location => LinuxImageLocation
|
32
|
-
}
|
33
|
-
options = {
|
34
|
-
:storage_account_name => StorageAccountName,
|
35
|
-
:cloud_service_name => cloud_service_name,
|
36
|
-
}
|
37
|
-
subject.create_virtual_machine(params, options)
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "#shutdown_virtual_machine" do
|
41
|
-
|
42
|
-
it "shuts down virtual machine if it exists in service" do
|
43
|
-
subject.shutdown_virtual_machine(virtual_machine_name, cloud_service_name ) rescue nil
|
44
|
-
virtualmachine = subject.get_virtual_machine(virtual_machine_name, cloud_service_name )
|
45
|
-
["StoppedVM","StoppedDeallocated"].must_include virtualmachine.status
|
46
|
-
|
47
|
-
#raises an error if virtual machine doesn't exist under give cloud service name.
|
48
|
-
vm_name = 'test-shutdown'
|
49
|
-
msg = subject.shutdown_virtual_machine(vm_name, cloud_service_name )
|
50
|
-
assert_match(/Cannot find virtual machine \"#{vm_name}\" under cloud service \"#{cloud_service_name}\"/, msg)
|
51
|
-
|
52
|
-
#raises an error if virtual machine is already in stopped state.
|
53
|
-
msg = subject.shutdown_virtual_machine(virtual_machine_name, cloud_service_name )
|
54
|
-
assert_match(/Cannot perform the shutdown operation on a stopped virtual machine./, msg)
|
55
|
-
end
|
56
|
-
|
57
|
-
end #shutdown_virtual_machine
|
58
|
-
end #end
|
59
|
-
|