fog-oraclecloud 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +12 -10
- data/Gemfile +4 -4
- data/LICENSE +20 -20
- data/README.md +153 -153
- data/Rakefile +2 -2
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/fog-oracle.gemspec +32 -31
- data/lib/fog/oraclecloud.rb +29 -29
- data/lib/fog/oraclecloud/compute.rb +184 -184
- data/lib/fog/oraclecloud/database.rb +129 -129
- data/lib/fog/oraclecloud/java.rb +123 -115
- data/lib/fog/oraclecloud/models/compute/image.rb +43 -43
- data/lib/fog/oraclecloud/models/compute/image_list.rb +39 -39
- data/lib/fog/oraclecloud/models/compute/image_lists.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/images.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/instance.rb +74 -69
- data/lib/fog/oraclecloud/models/compute/instances.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/object_plan.rb +16 -16
- data/lib/fog/oraclecloud/models/compute/object_plans.rb +12 -12
- data/lib/fog/oraclecloud/models/compute/orchestration.rb +89 -89
- data/lib/fog/oraclecloud/models/compute/orchestrations.rb +20 -20
- data/lib/fog/oraclecloud/models/compute/security_application.rb +42 -42
- data/lib/fog/oraclecloud/models/compute/security_applications.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/security_list.rb +26 -26
- data/lib/fog/oraclecloud/models/compute/security_lists.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/security_rule.rb +41 -41
- data/lib/fog/oraclecloud/models/compute/security_rules.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/ssh_key.rb +37 -37
- data/lib/fog/oraclecloud/models/compute/ssh_keys.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/volume.rb +47 -47
- data/lib/fog/oraclecloud/models/compute/volumes.rb +20 -20
- data/lib/fog/oraclecloud/models/database/backup.rb +37 -37
- data/lib/fog/oraclecloud/models/database/backups.rb +30 -30
- data/lib/fog/oraclecloud/models/database/instance.rb +331 -331
- data/lib/fog/oraclecloud/models/database/instances.rb +25 -25
- data/lib/fog/oraclecloud/models/database/patch.rb +34 -34
- data/lib/fog/oraclecloud/models/database/patches.rb +18 -18
- data/lib/fog/oraclecloud/models/database/recoveries.rb +26 -26
- data/lib/fog/oraclecloud/models/database/recovery.rb +43 -43
- data/lib/fog/oraclecloud/models/database/server.rb +28 -28
- data/lib/fog/oraclecloud/models/database/servers.rb +18 -18
- data/lib/fog/oraclecloud/models/database/snapshot.rb +60 -60
- data/lib/fog/oraclecloud/models/database/snapshots.rb +22 -22
- data/lib/fog/oraclecloud/models/java/database.rb +17 -17
- data/lib/fog/oraclecloud/models/java/databases.rb +17 -17
- data/lib/fog/oraclecloud/models/java/instance.rb +269 -265
- data/lib/fog/oraclecloud/models/java/instances.rb +23 -23
- data/lib/fog/oraclecloud/models/java/server.rb +62 -62
- data/lib/fog/oraclecloud/models/java/servers.rb +25 -25
- data/lib/fog/oraclecloud/models/soa/instance.rb +163 -163
- data/lib/fog/oraclecloud/models/soa/instances.rb +54 -54
- data/lib/fog/oraclecloud/models/storage/container.rb +33 -33
- data/lib/fog/oraclecloud/models/storage/containers.rb +24 -24
- data/lib/fog/oraclecloud/models/storage/object.rb +27 -27
- data/lib/fog/oraclecloud/models/storage/objects.rb +27 -27
- data/lib/fog/oraclecloud/requests/compute/create_image.rb +30 -30
- data/lib/fog/oraclecloud/requests/compute/create_image_list.rb +27 -27
- data/lib/fog/oraclecloud/requests/compute/create_instance.rb +53 -53
- data/lib/fog/oraclecloud/requests/compute/create_orchestration.rb +82 -82
- data/lib/fog/oraclecloud/requests/compute/create_security_application.rb +28 -28
- data/lib/fog/oraclecloud/requests/compute/create_security_rule.rb +29 -29
- data/lib/fog/oraclecloud/requests/compute/create_ssh_key.rb +46 -46
- data/lib/fog/oraclecloud/requests/compute/create_volume.rb +28 -28
- data/lib/fog/oraclecloud/requests/compute/delete_image.rb +19 -19
- data/lib/fog/oraclecloud/requests/compute/delete_image_list.rb +19 -19
- data/lib/fog/oraclecloud/requests/compute/delete_instance.rb +33 -33
- data/lib/fog/oraclecloud/requests/compute/delete_orchestration.rb +36 -36
- data/lib/fog/oraclecloud/requests/compute/delete_security_application.rb +20 -20
- data/lib/fog/oraclecloud/requests/compute/delete_security_rule.rb +20 -20
- data/lib/fog/oraclecloud/requests/compute/delete_ssh_key.rb +32 -32
- data/lib/fog/oraclecloud/requests/compute/get_image.rb +21 -21
- data/lib/fog/oraclecloud/requests/compute/get_image_list.rb +21 -21
- data/lib/fog/oraclecloud/requests/compute/get_instance.rb +45 -45
- data/lib/fog/oraclecloud/requests/compute/get_orchestration.rb +39 -39
- data/lib/fog/oraclecloud/requests/compute/get_security_application.rb +20 -20
- data/lib/fog/oraclecloud/requests/compute/get_security_rule.rb +20 -20
- data/lib/fog/oraclecloud/requests/compute/get_ssh_key.rb +39 -39
- data/lib/fog/oraclecloud/requests/compute/list_image_lists.rb +29 -29
- data/lib/fog/oraclecloud/requests/compute/list_images.rb +16 -16
- data/lib/fog/oraclecloud/requests/compute/list_instances.rb +28 -28
- data/lib/fog/oraclecloud/requests/compute/list_orchestrations.rb +28 -28
- data/lib/fog/oraclecloud/requests/compute/list_security_applications.rb +21 -21
- data/lib/fog/oraclecloud/requests/compute/list_security_lists.rb +16 -16
- data/lib/fog/oraclecloud/requests/compute/list_security_rules.rb +21 -21
- data/lib/fog/oraclecloud/requests/compute/list_ssh_keys.rb +29 -29
- data/lib/fog/oraclecloud/requests/compute/list_volumes.rb +16 -16
- data/lib/fog/oraclecloud/requests/compute/start_orchestration.rb +39 -39
- data/lib/fog/oraclecloud/requests/compute/stop_orchestration.rb +39 -39
- data/lib/fog/oraclecloud/requests/compute/update_image.rb +27 -27
- data/lib/fog/oraclecloud/requests/compute/update_image_list.rb +27 -27
- data/lib/fog/oraclecloud/requests/compute/update_orchestration.rb +80 -80
- data/lib/fog/oraclecloud/requests/compute/update_ssh_key.rb +49 -49
- data/lib/fog/oraclecloud/requests/database/backup_instance.rb +45 -45
- data/lib/fog/oraclecloud/requests/database/create_instance.rb +101 -101
- data/lib/fog/oraclecloud/requests/database/create_snapshot.rb +50 -50
- data/lib/fog/oraclecloud/requests/database/delete_instance.rb +26 -26
- data/lib/fog/oraclecloud/requests/database/delete_snapshot.rb +26 -26
- data/lib/fog/oraclecloud/requests/database/get_instance.rb +62 -62
- data/lib/fog/oraclecloud/requests/database/get_instance_from_job.rb +31 -31
- data/lib/fog/oraclecloud/requests/database/get_snapshot.rb +43 -43
- data/lib/fog/oraclecloud/requests/database/list_backups.rb +39 -39
- data/lib/fog/oraclecloud/requests/database/list_instances.rb +29 -29
- data/lib/fog/oraclecloud/requests/database/list_patches.rb +51 -51
- data/lib/fog/oraclecloud/requests/database/list_recoveries.rb +40 -40
- data/lib/fog/oraclecloud/requests/database/list_servers.rb +27 -27
- data/lib/fog/oraclecloud/requests/database/list_snapshots.rb +27 -27
- data/lib/fog/oraclecloud/requests/database/recover_instance.rb +83 -83
- data/lib/fog/oraclecloud/requests/database/scale_instance.rb +40 -40
- data/lib/fog/oraclecloud/requests/java/create_instance.rb +156 -87
- data/lib/fog/oraclecloud/requests/java/delete_instance.rb +37 -37
- data/lib/fog/oraclecloud/requests/java/get_instance.rb +43 -43
- data/lib/fog/oraclecloud/requests/java/get_server.rb +42 -42
- data/lib/fog/oraclecloud/requests/java/list_instances.rb +29 -29
- data/lib/fog/oraclecloud/requests/java/list_servers.rb +30 -30
- data/lib/fog/oraclecloud/requests/java/scale_a_node.rb +45 -45
- data/lib/fog/oraclecloud/requests/java/scale_in_a_cluster.rb +35 -35
- data/lib/fog/oraclecloud/requests/java/scale_out_a_cluster.rb +38 -38
- data/lib/fog/oraclecloud/requests/soa/create_instance.rb +71 -71
- data/lib/fog/oraclecloud/requests/soa/delete_instance.rb +35 -35
- data/lib/fog/oraclecloud/requests/soa/get_instance.rb +42 -42
- data/lib/fog/oraclecloud/requests/soa/get_job_status.rb +22 -22
- data/lib/fog/oraclecloud/requests/soa/list_instances.rb +29 -29
- data/lib/fog/oraclecloud/requests/storage/create_container.rb +41 -41
- data/lib/fog/oraclecloud/requests/storage/delete_container.rb +15 -15
- data/lib/fog/oraclecloud/requests/storage/get_container.rb +63 -63
- data/lib/fog/oraclecloud/requests/storage/list_containers.rb +27 -27
- data/lib/fog/oraclecloud/soa.rb +106 -106
- data/lib/fog/oraclecloud/storage.rb +98 -98
- data/lib/fog/oraclecloud/version.rb +5 -5
- data/tests/helper.rb +5 -3
- data/tests/helpers/mock_helper.rb +14 -14
- data/tests/requests/compute_tests.rb +9 -9
- data/tests/requests/database_tests.rb +241 -241
- data/tests/requests/instance_tests.rb +68 -61
- data/tests/requests/java_tests.rb +149 -109
- data/tests/requests/orchestrations_tests.rb +90 -90
- data/tests/requests/soa_tests.rb +151 -151
- data/tests/requests/ssh_keys_tests.rb +53 -53
- data/tests/requests/storage_tests.rb +54 -54
- metadata +17 -3
data/tests/requests/soa_tests.rb
CHANGED
@@ -1,152 +1,152 @@
|
|
1
|
-
require 'pp'
|
2
|
-
|
3
|
-
Shindo.tests('Fog::Soa[oraclecloud] | SOA requests', 'soa') do
|
4
|
-
|
5
|
-
tests("#soa-create", "create") do
|
6
|
-
instance = Fog::OracleCloud[:soa].instances.create(
|
7
|
-
:service_name => 'TestSOA',
|
8
|
-
:description => 'A new weblogic instance',
|
9
|
-
:dba_name => 'SYS',
|
10
|
-
:dba_password => 'password',
|
11
|
-
:db_service_name => 'TestDB',
|
12
|
-
:admin_password => 'Welcome1$',
|
13
|
-
:admin_username => 'weblogic',
|
14
|
-
:shape => 'oc3m',
|
15
|
-
:version => '12.2.1',
|
16
|
-
:ssh_key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlinstanceUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ==',
|
17
|
-
:cloud_storage_container => 'Test123',
|
18
|
-
:topology => 'osb'
|
19
|
-
)
|
20
|
-
test "can create a soa instance" do
|
21
|
-
instance.is_a? Fog::OracleCloud::SOA::Instance
|
22
|
-
end
|
23
|
-
|
24
|
-
test "is being built" do
|
25
|
-
!instance.ready?
|
26
|
-
end
|
27
|
-
instance.wait_for { ready? }
|
28
|
-
|
29
|
-
test "is built" do
|
30
|
-
instance.ready?
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
tests("#soa-and-db-create", "create") do
|
35
|
-
instance = Fog::OracleCloud[:soa].instances.create({
|
36
|
-
:service_name => 'TestSOA2',
|
37
|
-
:description => 'A new weblogic instance',
|
38
|
-
:admin_password => 'Welcome1$',
|
39
|
-
:admin_username => 'weblogic',
|
40
|
-
:shape => 'oc3m',
|
41
|
-
:version => '12.2.1',
|
42
|
-
:ssh_key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlinstanceUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ==',
|
43
|
-
:topology => 'osb'
|
44
|
-
})
|
45
|
-
test "can create a soa instance" do
|
46
|
-
instance.is_a? Fog::OracleCloud::SOA::Instance
|
47
|
-
end
|
48
|
-
|
49
|
-
test "is being built" do
|
50
|
-
!instance.ready?
|
51
|
-
end
|
52
|
-
instance.wait_for { ready? }
|
53
|
-
|
54
|
-
test "is built" do
|
55
|
-
instance.ready?
|
56
|
-
end
|
57
|
-
|
58
|
-
test "shoud have created a database instance" do
|
59
|
-
db = Fog::OracleCloud[:database].instances.get('TestSOA2-DB')
|
60
|
-
db.is_a? Fog::OracleCloud::Database::Instance
|
61
|
-
end
|
62
|
-
|
63
|
-
test "should have created a storage container" do
|
64
|
-
container = Fog::Storage[:oraclecloud].containers.get('TestSOA2_Backup')
|
65
|
-
container.is_a? Fog::Storage::OracleCloud::Container
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
tests('#soa-validation') do
|
70
|
-
tests("should ensure service name doesn't have underscore").raises(ArgumentError) do
|
71
|
-
instance = Fog::OracleCloud[:soa].instances.new({
|
72
|
-
:service_name => 'Has_Underscore'
|
73
|
-
})
|
74
|
-
end
|
75
|
-
tests("should ensure service name doesn't have number as first letter").raises(ArgumentError) do
|
76
|
-
instance = Fog::OracleCloud[:soa].instances.new({
|
77
|
-
:service_name => '1NotFirstLetter'
|
78
|
-
})
|
79
|
-
end
|
80
|
-
tests("should ensure service name isn't too long").raises(ArgumentError) do
|
81
|
-
instance = Fog::OracleCloud[:soa].instances.new({
|
82
|
-
:service_name => 'ReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName'
|
83
|
-
})
|
84
|
-
end
|
85
|
-
tests("should ensure service name doesn't contain special characters").raises(ArgumentError) do
|
86
|
-
instance = Fog::OracleCloud[:soa].instances.new({
|
87
|
-
:service_name => 'Special$characters'
|
88
|
-
})
|
89
|
-
end
|
90
|
-
tests("should ensure admin password starts with a letter").raises(ArgumentError) do
|
91
|
-
instance = Fog::OracleCloud[:soa].instances.new({
|
92
|
-
:service_name => 'Test',
|
93
|
-
:admin_password => '1NotFirstLetter'
|
94
|
-
})
|
95
|
-
end
|
96
|
-
tests("should ensure admin password is not too long").raises(ArgumentError) do
|
97
|
-
instance = Fog::OracleCloud[:soa].instances.new({
|
98
|
-
:service_name => 'Test',
|
99
|
-
:admin_password => 'ReallyReallyReallyReallyReallyReallyReallyReallyPassword1$'
|
100
|
-
})
|
101
|
-
end
|
102
|
-
tests("should ensure admin password has special chars").raises(ArgumentError) do
|
103
|
-
instance = Fog::OracleCloud[:soa].instances.new({
|
104
|
-
:service_name => 'Test',
|
105
|
-
:admin_password => 'WelcomePassword1'
|
106
|
-
})
|
107
|
-
end
|
108
|
-
tests("should ensure admin password has numbers").raises(ArgumentError) do
|
109
|
-
instance = Fog::OracleCloud[:soa].instances.new({
|
110
|
-
:service_name => 'Test',
|
111
|
-
:admin_password => 'WelcomePassword$'
|
112
|
-
})
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
tests('#soa-read') do
|
117
|
-
instances = Fog::OracleCloud[:soa].instances
|
118
|
-
test "returns an Array" do
|
119
|
-
instances.is_a? Array
|
120
|
-
end
|
121
|
-
|
122
|
-
test "should return records" do
|
123
|
-
instances.size >= 1
|
124
|
-
end
|
125
|
-
|
126
|
-
test "should return a valid name" do
|
127
|
-
instances.first.service_name.is_a? String
|
128
|
-
end
|
129
|
-
|
130
|
-
instance = Fog::OracleCloud[:soa].instances.get(instances.first.service_name)
|
131
|
-
test "should return an instance" do
|
132
|
-
instance.service_name.is_a? String
|
133
|
-
end
|
134
|
-
|
135
|
-
test "get job status" do
|
136
|
-
status = instance.job_status
|
137
|
-
status.is_a? Array
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
tests("#soa-delete", "create") do
|
142
|
-
instance = Fog::OracleCloud[:soa].instances.get('TestSOA')
|
143
|
-
instance.destroy('SYS', 'password')
|
144
|
-
instance.wait_for { stopping? }
|
145
|
-
tests("should actually delete instance").raises(Fog::OracleCloud::SOA::NotFound) do
|
146
|
-
instance.wait_for { stopped? }
|
147
|
-
end
|
148
|
-
# Clean up
|
149
|
-
instance = Fog::OracleCloud[:soa].instances.get('TestSOA2')
|
150
|
-
instance.destroy('SYS', 'Welcome1$')
|
151
|
-
end
|
1
|
+
require 'pp'
|
2
|
+
|
3
|
+
Shindo.tests('Fog::Soa[oraclecloud] | SOA requests', 'soa') do
|
4
|
+
|
5
|
+
tests("#soa-create", "create") do
|
6
|
+
instance = Fog::OracleCloud[:soa].instances.create(
|
7
|
+
:service_name => 'TestSOA',
|
8
|
+
:description => 'A new weblogic instance',
|
9
|
+
:dba_name => 'SYS',
|
10
|
+
:dba_password => 'password',
|
11
|
+
:db_service_name => 'TestDB',
|
12
|
+
:admin_password => 'Welcome1$',
|
13
|
+
:admin_username => 'weblogic',
|
14
|
+
:shape => 'oc3m',
|
15
|
+
:version => '12.2.1',
|
16
|
+
:ssh_key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlinstanceUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ==',
|
17
|
+
:cloud_storage_container => 'Test123',
|
18
|
+
:topology => 'osb'
|
19
|
+
)
|
20
|
+
test "can create a soa instance" do
|
21
|
+
instance.is_a? Fog::OracleCloud::SOA::Instance
|
22
|
+
end
|
23
|
+
|
24
|
+
test "is being built" do
|
25
|
+
!instance.ready?
|
26
|
+
end
|
27
|
+
instance.wait_for { ready? }
|
28
|
+
|
29
|
+
test "is built" do
|
30
|
+
instance.ready?
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
tests("#soa-and-db-create", "create") do
|
35
|
+
instance = Fog::OracleCloud[:soa].instances.create({
|
36
|
+
:service_name => 'TestSOA2',
|
37
|
+
:description => 'A new weblogic instance',
|
38
|
+
:admin_password => 'Welcome1$',
|
39
|
+
:admin_username => 'weblogic',
|
40
|
+
:shape => 'oc3m',
|
41
|
+
:version => '12.2.1',
|
42
|
+
:ssh_key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlinstanceUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ==',
|
43
|
+
:topology => 'osb'
|
44
|
+
})
|
45
|
+
test "can create a soa instance" do
|
46
|
+
instance.is_a? Fog::OracleCloud::SOA::Instance
|
47
|
+
end
|
48
|
+
|
49
|
+
test "is being built" do
|
50
|
+
!instance.ready?
|
51
|
+
end
|
52
|
+
instance.wait_for { ready? }
|
53
|
+
|
54
|
+
test "is built" do
|
55
|
+
instance.ready?
|
56
|
+
end
|
57
|
+
|
58
|
+
test "shoud have created a database instance" do
|
59
|
+
db = Fog::OracleCloud[:database].instances.get('TestSOA2-DB')
|
60
|
+
db.is_a? Fog::OracleCloud::Database::Instance
|
61
|
+
end
|
62
|
+
|
63
|
+
test "should have created a storage container" do
|
64
|
+
container = Fog::Storage[:oraclecloud].containers.get('TestSOA2_Backup')
|
65
|
+
container.is_a? Fog::Storage::OracleCloud::Container
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
tests('#soa-validation') do
|
70
|
+
tests("should ensure service name doesn't have underscore").raises(ArgumentError) do
|
71
|
+
instance = Fog::OracleCloud[:soa].instances.new({
|
72
|
+
:service_name => 'Has_Underscore'
|
73
|
+
})
|
74
|
+
end
|
75
|
+
tests("should ensure service name doesn't have number as first letter").raises(ArgumentError) do
|
76
|
+
instance = Fog::OracleCloud[:soa].instances.new({
|
77
|
+
:service_name => '1NotFirstLetter'
|
78
|
+
})
|
79
|
+
end
|
80
|
+
tests("should ensure service name isn't too long").raises(ArgumentError) do
|
81
|
+
instance = Fog::OracleCloud[:soa].instances.new({
|
82
|
+
:service_name => 'ReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName'
|
83
|
+
})
|
84
|
+
end
|
85
|
+
tests("should ensure service name doesn't contain special characters").raises(ArgumentError) do
|
86
|
+
instance = Fog::OracleCloud[:soa].instances.new({
|
87
|
+
:service_name => 'Special$characters'
|
88
|
+
})
|
89
|
+
end
|
90
|
+
tests("should ensure admin password starts with a letter").raises(ArgumentError) do
|
91
|
+
instance = Fog::OracleCloud[:soa].instances.new({
|
92
|
+
:service_name => 'Test',
|
93
|
+
:admin_password => '1NotFirstLetter'
|
94
|
+
})
|
95
|
+
end
|
96
|
+
tests("should ensure admin password is not too long").raises(ArgumentError) do
|
97
|
+
instance = Fog::OracleCloud[:soa].instances.new({
|
98
|
+
:service_name => 'Test',
|
99
|
+
:admin_password => 'ReallyReallyReallyReallyReallyReallyReallyReallyPassword1$'
|
100
|
+
})
|
101
|
+
end
|
102
|
+
tests("should ensure admin password has special chars").raises(ArgumentError) do
|
103
|
+
instance = Fog::OracleCloud[:soa].instances.new({
|
104
|
+
:service_name => 'Test',
|
105
|
+
:admin_password => 'WelcomePassword1'
|
106
|
+
})
|
107
|
+
end
|
108
|
+
tests("should ensure admin password has numbers").raises(ArgumentError) do
|
109
|
+
instance = Fog::OracleCloud[:soa].instances.new({
|
110
|
+
:service_name => 'Test',
|
111
|
+
:admin_password => 'WelcomePassword$'
|
112
|
+
})
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
tests('#soa-read') do
|
117
|
+
instances = Fog::OracleCloud[:soa].instances
|
118
|
+
test "returns an Array" do
|
119
|
+
instances.is_a? Array
|
120
|
+
end
|
121
|
+
|
122
|
+
test "should return records" do
|
123
|
+
instances.size >= 1
|
124
|
+
end
|
125
|
+
|
126
|
+
test "should return a valid name" do
|
127
|
+
instances.first.service_name.is_a? String
|
128
|
+
end
|
129
|
+
|
130
|
+
instance = Fog::OracleCloud[:soa].instances.get(instances.first.service_name)
|
131
|
+
test "should return an instance" do
|
132
|
+
instance.service_name.is_a? String
|
133
|
+
end
|
134
|
+
|
135
|
+
test "get job status" do
|
136
|
+
status = instance.job_status
|
137
|
+
status.is_a? Array
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
tests("#soa-delete", "create") do
|
142
|
+
instance = Fog::OracleCloud[:soa].instances.get('TestSOA')
|
143
|
+
instance.destroy('SYS', 'password')
|
144
|
+
instance.wait_for { stopping? }
|
145
|
+
tests("should actually delete instance").raises(Fog::OracleCloud::SOA::NotFound) do
|
146
|
+
instance.wait_for { stopped? }
|
147
|
+
end
|
148
|
+
# Clean up
|
149
|
+
instance = Fog::OracleCloud[:soa].instances.get('TestSOA2')
|
150
|
+
instance.destroy('SYS', 'Welcome1$')
|
151
|
+
end
|
152
152
|
end
|
@@ -1,54 +1,54 @@
|
|
1
|
-
Shindo.tests('Fog::Compute[oraclecloud] | ssh_keys requests', 'ssh_keys') do
|
2
|
-
|
3
|
-
tests("#sshkeys-create", "create") do
|
4
|
-
sshkey = Fog::Compute[:oraclecloud].ssh_keys.create(
|
5
|
-
:name => 'TestSSHKey2',
|
6
|
-
:enabled => false,
|
7
|
-
:key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlDbUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ=='
|
8
|
-
)
|
9
|
-
|
10
|
-
test "can create an sshkey" do
|
11
|
-
sshkey.is_a? Fog::Compute::OracleCloud::SshKey
|
12
|
-
sshkey.uri.is_a? String
|
13
|
-
end
|
14
|
-
|
15
|
-
check = Fog::Compute[:oraclecloud].ssh_keys.get(sshkey.name)
|
16
|
-
test "can get ssh key" do
|
17
|
-
check.uri == sshkey.uri
|
18
|
-
end
|
19
|
-
|
20
|
-
sshkey.enabled = true
|
21
|
-
sshkey.save()
|
22
|
-
test "can update ssh key" do
|
23
|
-
check = Fog::Compute[:oraclecloud].ssh_keys.get(sshkey.name)
|
24
|
-
check.enabled == true
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
tests("#sshkeys-read") do
|
30
|
-
sshkeys = Fog::Compute[:oraclecloud].ssh_keys
|
31
|
-
test "returns an Array" do
|
32
|
-
sshkeys.is_a? Array
|
33
|
-
end
|
34
|
-
test "should return keys" do
|
35
|
-
sshkeys.size >= 1
|
36
|
-
end
|
37
|
-
test "should return a valid name" do
|
38
|
-
sshkeys.first.name.is_a? String
|
39
|
-
end
|
40
|
-
|
41
|
-
sshkey = Fog::Compute[:oraclecloud].ssh_keys.get(sshkeys.first.name)
|
42
|
-
test "should return a key" do
|
43
|
-
sshkey.name.is_a? String
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
tests("#sshkeys-delete", "create") do
|
48
|
-
sshkey = Fog::Compute[:oraclecloud].ssh_keys.get('TestSSHKey2')
|
49
|
-
sshkey.destroy()
|
50
|
-
tests("should delete key").raises(Fog::Compute::OracleCloud::NotFound) do
|
51
|
-
sshkey = Fog::Compute[:oraclecloud].ssh_keys.get('TestSSHKey2')
|
52
|
-
end
|
53
|
-
end
|
1
|
+
Shindo.tests('Fog::Compute[oraclecloud] | ssh_keys requests', 'ssh_keys') do
|
2
|
+
|
3
|
+
tests("#sshkeys-create", "create") do
|
4
|
+
sshkey = Fog::Compute[:oraclecloud].ssh_keys.create(
|
5
|
+
:name => 'TestSSHKey2',
|
6
|
+
:enabled => false,
|
7
|
+
:key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlDbUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ=='
|
8
|
+
)
|
9
|
+
|
10
|
+
test "can create an sshkey" do
|
11
|
+
sshkey.is_a? Fog::Compute::OracleCloud::SshKey
|
12
|
+
sshkey.uri.is_a? String
|
13
|
+
end
|
14
|
+
|
15
|
+
check = Fog::Compute[:oraclecloud].ssh_keys.get(sshkey.name)
|
16
|
+
test "can get ssh key" do
|
17
|
+
check.uri == sshkey.uri
|
18
|
+
end
|
19
|
+
|
20
|
+
sshkey.enabled = true
|
21
|
+
sshkey.save()
|
22
|
+
test "can update ssh key" do
|
23
|
+
check = Fog::Compute[:oraclecloud].ssh_keys.get(sshkey.name)
|
24
|
+
check.enabled == true
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
tests("#sshkeys-read") do
|
30
|
+
sshkeys = Fog::Compute[:oraclecloud].ssh_keys
|
31
|
+
test "returns an Array" do
|
32
|
+
sshkeys.is_a? Array
|
33
|
+
end
|
34
|
+
test "should return keys" do
|
35
|
+
sshkeys.size >= 1
|
36
|
+
end
|
37
|
+
test "should return a valid name" do
|
38
|
+
sshkeys.first.name.is_a? String
|
39
|
+
end
|
40
|
+
|
41
|
+
sshkey = Fog::Compute[:oraclecloud].ssh_keys.get(sshkeys.first.name)
|
42
|
+
test "should return a key" do
|
43
|
+
sshkey.name.is_a? String
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
tests("#sshkeys-delete", "create") do
|
48
|
+
sshkey = Fog::Compute[:oraclecloud].ssh_keys.get('TestSSHKey2')
|
49
|
+
sshkey.destroy()
|
50
|
+
tests("should delete key").raises(Fog::Compute::OracleCloud::NotFound) do
|
51
|
+
sshkey = Fog::Compute[:oraclecloud].ssh_keys.get('TestSSHKey2')
|
52
|
+
end
|
53
|
+
end
|
54
54
|
end
|
@@ -1,55 +1,55 @@
|
|
1
|
-
Shindo.tests('Fog::Storage[oraclecloud] | storage requests', 'storage') do
|
2
|
-
|
3
|
-
tests("#storage-create", "create") do
|
4
|
-
container = Fog::Storage[:oraclecloud].containers.create(
|
5
|
-
:name => 'TestContainer1',
|
6
|
-
)
|
7
|
-
test "can create a storage container" do
|
8
|
-
container.is_a? Fog::Storage::OracleCloud::Container
|
9
|
-
container.name.is_a? String
|
10
|
-
end
|
11
|
-
pp container
|
12
|
-
check = Fog::Storage[:oraclecloud].containers.get(container.name)
|
13
|
-
test "can get container" do
|
14
|
-
check.name == container.name
|
15
|
-
end
|
16
|
-
|
17
|
-
# Can't destroy immediately, as the cloud won't have replicated in time and will give us an error
|
18
|
-
# when we try to delete. No way to find out if the cloud has finished this replication though
|
19
|
-
# container.destroy()
|
20
|
-
# tests("can delete container").raises(Excon::Error::NotFound) do
|
21
|
-
# check = Fog::Storage[:oracle].containers.get(container.name)
|
22
|
-
# end
|
23
|
-
end
|
24
|
-
|
25
|
-
tests("#storage-read") do
|
26
|
-
containers = Fog::Storage[:oraclecloud].containers
|
27
|
-
|
28
|
-
test "returns an Array" do
|
29
|
-
containers.is_a? Array
|
30
|
-
end
|
31
|
-
test "should return keys" do
|
32
|
-
containers.size >= 1
|
33
|
-
end
|
34
|
-
test "should return a valid name" do
|
35
|
-
containers.first.name.is_a? String
|
36
|
-
end
|
37
|
-
container = Fog::Storage[:oraclecloud].containers.get(containers.first.name)
|
38
|
-
test "should return a key" do
|
39
|
-
container.name.is_a? String
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
tests("#object-read") do
|
44
|
-
objects = Fog::Storage[:oraclecloud].containers.first.objects
|
45
|
-
test "returns an Array" do
|
46
|
-
objects.is_a? Array
|
47
|
-
end
|
48
|
-
test "should return multiple" do
|
49
|
-
objects.size >= 1
|
50
|
-
end
|
51
|
-
test "should return an object" do
|
52
|
-
objects.first.name.is_a? String
|
53
|
-
end
|
54
|
-
end
|
1
|
+
Shindo.tests('Fog::Storage[oraclecloud] | storage requests', 'storage') do
|
2
|
+
|
3
|
+
tests("#storage-create", "create") do
|
4
|
+
container = Fog::Storage[:oraclecloud].containers.create(
|
5
|
+
:name => 'TestContainer1',
|
6
|
+
)
|
7
|
+
test "can create a storage container" do
|
8
|
+
container.is_a? Fog::Storage::OracleCloud::Container
|
9
|
+
container.name.is_a? String
|
10
|
+
end
|
11
|
+
pp container
|
12
|
+
check = Fog::Storage[:oraclecloud].containers.get(container.name)
|
13
|
+
test "can get container" do
|
14
|
+
check.name == container.name
|
15
|
+
end
|
16
|
+
|
17
|
+
# Can't destroy immediately, as the cloud won't have replicated in time and will give us an error
|
18
|
+
# when we try to delete. No way to find out if the cloud has finished this replication though
|
19
|
+
# container.destroy()
|
20
|
+
# tests("can delete container").raises(Excon::Error::NotFound) do
|
21
|
+
# check = Fog::Storage[:oracle].containers.get(container.name)
|
22
|
+
# end
|
23
|
+
end
|
24
|
+
|
25
|
+
tests("#storage-read") do
|
26
|
+
containers = Fog::Storage[:oraclecloud].containers
|
27
|
+
|
28
|
+
test "returns an Array" do
|
29
|
+
containers.is_a? Array
|
30
|
+
end
|
31
|
+
test "should return keys" do
|
32
|
+
containers.size >= 1
|
33
|
+
end
|
34
|
+
test "should return a valid name" do
|
35
|
+
containers.first.name.is_a? String
|
36
|
+
end
|
37
|
+
container = Fog::Storage[:oraclecloud].containers.get(containers.first.name)
|
38
|
+
test "should return a key" do
|
39
|
+
container.name.is_a? String
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
tests("#object-read") do
|
44
|
+
objects = Fog::Storage[:oraclecloud].containers.first.objects
|
45
|
+
test "returns an Array" do
|
46
|
+
objects.is_a? Array
|
47
|
+
end
|
48
|
+
test "should return multiple" do
|
49
|
+
objects.size >= 1
|
50
|
+
end
|
51
|
+
test "should return an object" do
|
52
|
+
objects.first.name.is_a? String
|
53
|
+
end
|
54
|
+
end
|
55
55
|
end
|