fog-oraclecloud 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -1,62 +1,69 @@
|
|
1
|
-
require 'pp'
|
2
|
-
|
3
|
-
Shindo.tests('Fog::Compute[oraclecloud] | instance requests', 'instances') do
|
4
|
-
|
5
|
-
tests("#instance-create", "create") do
|
6
|
-
#sshkey = Fog::Compute[:oraclecloud].ssh_keys.first.name
|
7
|
-
begin
|
8
|
-
sshkey = Fog::Compute[:oraclecloud].ssh_keys.get('Test123Key')
|
9
|
-
rescue Fog::Compute::OracleCloud::NotFound
|
10
|
-
sshkey = Fog::Compute[:oraclecloud].ssh_keys.create(
|
11
|
-
:name => 'TestSSHKey2',
|
12
|
-
:enabled => false,
|
13
|
-
:key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlDbUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ=='
|
14
|
-
)
|
15
|
-
end
|
16
|
-
|
17
|
-
new_instance = Fog::Compute[:oraclecloud].instances.create(
|
18
|
-
:name=>'Test123',
|
19
|
-
:shape=>'oc3',
|
20
|
-
:imagelist=>'/oracle/public/oel_6.4_2GB_v1',
|
21
|
-
:label=>'dev-vm',
|
22
|
-
:sshkeys=>[sshkey.name]
|
23
|
-
)
|
24
|
-
test "can create an instance" do
|
25
|
-
new_instance.is_a? Fog::Compute::OracleCloud::Instance
|
26
|
-
end
|
27
|
-
new_instance.wait_for { ready? }
|
28
|
-
|
29
|
-
test "is built" do
|
30
|
-
new_instance.state == 'running'
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
instance = Fog::Compute[:oraclecloud].instances.get(
|
56
|
-
instance
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
1
|
+
require 'pp'
|
2
|
+
|
3
|
+
Shindo.tests('Fog::Compute[oraclecloud] | instance requests', 'instances') do
|
4
|
+
|
5
|
+
tests("#instance-create", "create") do
|
6
|
+
#sshkey = Fog::Compute[:oraclecloud].ssh_keys.first.name
|
7
|
+
begin
|
8
|
+
sshkey = Fog::Compute[:oraclecloud].ssh_keys.get('Test123Key')
|
9
|
+
rescue Fog::Compute::OracleCloud::NotFound
|
10
|
+
sshkey = Fog::Compute[:oraclecloud].ssh_keys.create(
|
11
|
+
:name => 'TestSSHKey2',
|
12
|
+
:enabled => false,
|
13
|
+
:key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlDbUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ=='
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
new_instance = Fog::Compute[:oraclecloud].instances.create(
|
18
|
+
:name=>'Test123',
|
19
|
+
:shape=>'oc3',
|
20
|
+
:imagelist=>'/oracle/public/oel_6.4_2GB_v1',
|
21
|
+
:label=>'dev-vm',
|
22
|
+
:sshkeys=>[sshkey.name]
|
23
|
+
)
|
24
|
+
test "can create an instance" do
|
25
|
+
new_instance.is_a? Fog::Compute::OracleCloud::Instance
|
26
|
+
end
|
27
|
+
new_instance.wait_for { ready? }
|
28
|
+
|
29
|
+
test "is built" do
|
30
|
+
new_instance.state == 'running'
|
31
|
+
end
|
32
|
+
|
33
|
+
test "can create with minimum attributes" do
|
34
|
+
min_instance = Fog::Compute[:oraclecloud].instances.create
|
35
|
+
min_instance.is_a? Fog::Compute::OracleCloud::Instance
|
36
|
+
min_instance.wait_for { ready? }
|
37
|
+
min_instance.state == 'running'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
tests('#instances-read') do
|
42
|
+
instances = Fog::Compute[:oraclecloud].instances
|
43
|
+
test "returns an Array" do
|
44
|
+
instances.is_a? Array
|
45
|
+
end
|
46
|
+
|
47
|
+
test "should return records" do
|
48
|
+
instances.size >= 1
|
49
|
+
end
|
50
|
+
|
51
|
+
test "should return a valid name" do
|
52
|
+
instances.first.name.is_a? String
|
53
|
+
end
|
54
|
+
|
55
|
+
instance = Fog::Compute[:oraclecloud].instances.get(instances.first.name)
|
56
|
+
test "should return an instance" do
|
57
|
+
instance.name.is_a? String
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
tests("#instance-delete", "create") do
|
62
|
+
instance = Fog::Compute[:oraclecloud].instances.get('Test123')
|
63
|
+
instance.destroy()
|
64
|
+
instance.wait_for { state == 'stopping' }
|
65
|
+
tests("should actually delete instance").raises(Fog::Compute::OracleCloud::NotFound) do
|
66
|
+
instance.wait_for { state == 'stopped' }
|
67
|
+
end
|
68
|
+
end
|
62
69
|
end
|
@@ -1,110 +1,150 @@
|
|
1
|
-
require 'pp'
|
2
|
-
|
3
|
-
Shindo.tests('Fog::Java[oraclecloud] | java requests', 'java') do
|
4
|
-
|
5
|
-
tests("#java-create", "create") do
|
6
|
-
instance = Fog::OracleCloud[:java].instances.create(
|
7
|
-
:service_name => 'TestWLS',
|
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 => 'oc3',
|
15
|
-
:version => '12.2.1',
|
16
|
-
:ssh_key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlinstanceUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ==',
|
17
|
-
)
|
18
|
-
test "can create a java instance" do
|
19
|
-
instance.is_a? Fog::OracleCloud::Java::Instance
|
20
|
-
end
|
21
|
-
|
22
|
-
test "is being built" do
|
23
|
-
!instance.ready?
|
24
|
-
end
|
25
|
-
instance.wait_for { ready? }
|
26
|
-
|
27
|
-
test "is built" do
|
28
|
-
instance.ready?
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
tests('#java-read') do
|
33
|
-
instances = Fog::OracleCloud[:java].instances
|
34
|
-
test "returns an Array" do
|
35
|
-
instances.is_a? Array
|
36
|
-
end
|
37
|
-
|
38
|
-
test "should return records" do
|
39
|
-
instances.size >= 1
|
40
|
-
end
|
41
|
-
|
42
|
-
test "should return a valid name" do
|
43
|
-
instances.first.service_name.is_a? String
|
44
|
-
end
|
45
|
-
|
46
|
-
instance = Fog::OracleCloud[:java].instances.get(instances.first.service_name)
|
47
|
-
test "should return an instance" do
|
48
|
-
instance.service_name.is_a? String
|
49
|
-
end
|
50
|
-
|
51
|
-
servers = instance.servers
|
52
|
-
test "should have compute nodes" do
|
53
|
-
servers.is_a? Array
|
54
|
-
servers.size >= 1
|
55
|
-
servers.first.status.is_a? String
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
tests('test jcs scaling ') do
|
60
|
-
scale_out_server_name = 'TestWLS_server_1'
|
61
|
-
test_service_name = 'TestWLS'
|
62
|
-
|
63
|
-
test "scale out a cluster" do
|
64
|
-
instance = Fog::OracleCloud[:java].instances.get(test_service_name)
|
65
|
-
instance.scale_out_a_cluster('testcluster',false)
|
66
|
-
Fog::OracleCloud[:java].instances.get(test_service_name).wait_for(1800) { ready? }
|
67
|
-
Fog::OracleCloud[:java].instances.get(test_service_name).ready?
|
68
|
-
end
|
69
|
-
|
70
|
-
test('get server') do
|
71
|
-
instance = Fog::OracleCloud[:java].instances.get(test_service_name)
|
72
|
-
instance.ready?
|
73
|
-
server = instance.servers.get(test_service_name,scale_out_server_name)
|
74
|
-
server.ready?
|
75
|
-
end
|
76
|
-
|
77
|
-
test "scale a node" do
|
78
|
-
instance = Fog::OracleCloud[:java].instances.get(test_service_name)
|
79
|
-
instance.ready?
|
80
|
-
server = instance.servers.get(test_service_name,scale_out_server_name)
|
81
|
-
server.scale('oc4')
|
82
|
-
Fog::OracleCloud[:java].instances.get(test_service_name).wait_for(1800) { ready? }
|
83
|
-
server = instance.servers.get(test_service_name,scale_out_server_name)
|
84
|
-
server.ready?
|
85
|
-
server.shape == 'oc4'
|
86
|
-
end
|
87
|
-
|
88
|
-
test "scale in a cluster" do
|
89
|
-
instance = Fog::OracleCloud[:java].instances.get(test_service_name)
|
90
|
-
instance.ready?
|
91
|
-
instance.servers.get(test_service_name,scale_out_server_name).scale_in_a_cluster
|
92
|
-
Fog::OracleCloud[:java].instances.get(test_service_name).wait_for(1800) { ready? }
|
93
|
-
Fog::OracleCloud[:java].instances.get(test_service_name).ready?
|
94
|
-
end
|
95
|
-
|
96
|
-
end
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
1
|
+
require 'pp'
|
2
|
+
|
3
|
+
Shindo.tests('Fog::Java[oraclecloud] | java requests', 'java') do
|
4
|
+
|
5
|
+
tests("#java-create", "create") do
|
6
|
+
instance = Fog::OracleCloud[:java].instances.create(
|
7
|
+
:service_name => 'TestWLS',
|
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 => 'oc3',
|
15
|
+
:version => '12.2.1',
|
16
|
+
:ssh_key => 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkNNQ4ri2oUW46mBO/4CHMGCOALciumwGvFEMDLGNnlinstanceUSqU4IRrqgj+znLClfb29Oer0devdarM6DilsZVgZ2YbI5ZD5vICR/O9J0c28dArwbtFeIjcV2TCWyj5xKEXF1r+OrJMexHQa0fW1URGrU8QODpJNC/9eCVGcEXddL31xTZYpjoVOCVx66kNa6lSHEVV3T4zaCby9Oe5QI4gZe1+xyxHPNEW5wogwS3dlKSyL2CfBP0aUKOmJ5Nrl8+y0GqJQXdGjZ9FIknmwWueRW/6qPQvZocjOZ8YiPZgAP0RNy6lL+u8mnAazj/mrEdmB5QUzpDAllIr5Tn/xaddZQ==',
|
17
|
+
)
|
18
|
+
test "can create a java instance" do
|
19
|
+
instance.is_a? Fog::OracleCloud::Java::Instance
|
20
|
+
end
|
21
|
+
|
22
|
+
test "is being built" do
|
23
|
+
!instance.ready?
|
24
|
+
end
|
25
|
+
instance.wait_for { ready? }
|
26
|
+
|
27
|
+
test "is built" do
|
28
|
+
instance.ready?
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
tests('#java-read') do
|
33
|
+
instances = Fog::OracleCloud[:java].instances
|
34
|
+
test "returns an Array" do
|
35
|
+
instances.is_a? Array
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should return records" do
|
39
|
+
instances.size >= 1
|
40
|
+
end
|
41
|
+
#
|
42
|
+
test "should return a valid name" do
|
43
|
+
instances.first.service_name.is_a? String
|
44
|
+
end
|
45
|
+
#
|
46
|
+
instance = Fog::OracleCloud[:java].instances.get(instances.first.service_name)
|
47
|
+
test "should return an instance" do
|
48
|
+
instance.service_name.is_a? String
|
49
|
+
end
|
50
|
+
#
|
51
|
+
servers = instance.servers
|
52
|
+
test "should have compute nodes" do
|
53
|
+
servers.is_a? Array
|
54
|
+
servers.size >= 1
|
55
|
+
servers.first.status.is_a? String
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
tests('test jcs scaling', 'create') do
|
60
|
+
scale_out_server_name = 'TestWLS_server_1'
|
61
|
+
test_service_name = 'TestWLS'
|
62
|
+
|
63
|
+
test "scale out a cluster" do
|
64
|
+
instance = Fog::OracleCloud[:java].instances.get(test_service_name)
|
65
|
+
instance.scale_out_a_cluster('testcluster',false)
|
66
|
+
Fog::OracleCloud[:java].instances.get(test_service_name).wait_for(1800) { ready? }
|
67
|
+
Fog::OracleCloud[:java].instances.get(test_service_name).ready?
|
68
|
+
end
|
69
|
+
|
70
|
+
test('get server') do
|
71
|
+
instance = Fog::OracleCloud[:java].instances.get(test_service_name)
|
72
|
+
instance.ready?
|
73
|
+
server = instance.servers.get(test_service_name,scale_out_server_name)
|
74
|
+
server.ready?
|
75
|
+
end
|
76
|
+
|
77
|
+
test "scale a node" do
|
78
|
+
instance = Fog::OracleCloud[:java].instances.get(test_service_name)
|
79
|
+
instance.ready?
|
80
|
+
server = instance.servers.get(test_service_name,scale_out_server_name)
|
81
|
+
server.scale('oc4')
|
82
|
+
Fog::OracleCloud[:java].instances.get(test_service_name).wait_for(1800) { ready? }
|
83
|
+
server = instance.servers.get(test_service_name,scale_out_server_name)
|
84
|
+
server.ready?
|
85
|
+
server.shape == 'oc4'
|
86
|
+
end
|
87
|
+
|
88
|
+
test "scale in a cluster" do
|
89
|
+
instance = Fog::OracleCloud[:java].instances.get(test_service_name)
|
90
|
+
instance.ready?
|
91
|
+
instance.servers.get(test_service_name,scale_out_server_name).scale_in_a_cluster
|
92
|
+
Fog::OracleCloud[:java].instances.get(test_service_name).wait_for(1800) { ready? }
|
93
|
+
Fog::OracleCloud[:java].instances.get(test_service_name).ready?
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
tests("#java-access-rules") do
|
99
|
+
instance = Fog::OracleCloud[:java].instances.first
|
100
|
+
|
101
|
+
test "list access rules" do
|
102
|
+
rules = instance.access_rules
|
103
|
+
rules.is_a? Array
|
104
|
+
!rules.first.rule_name.nil?
|
105
|
+
end
|
106
|
+
|
107
|
+
rule_name = "my_corp_vnc_#{rand(100)}"
|
108
|
+
test "create access rule" do
|
109
|
+
rule = instance.access_rules.create({
|
110
|
+
:rule_name => rule_name,
|
111
|
+
:description => 'Corporate VNC to Admin Server',
|
112
|
+
:ports => '5900',
|
113
|
+
:protocol => 'tcp',
|
114
|
+
:status => 'disabled',
|
115
|
+
:source => '192.123.45.6/32',
|
116
|
+
:destination => 'WLS_ADMIN_SERVER'
|
117
|
+
})
|
118
|
+
rule.is_a? Fog::OracleCloud::Java::AccessRule
|
119
|
+
rule.status == 'disabled'
|
120
|
+
end
|
121
|
+
|
122
|
+
test "enable access rule" do
|
123
|
+
rule = instance.access_rules.get(rule_name)
|
124
|
+
rule.enable()
|
125
|
+
rule.status == 'enabled'
|
126
|
+
end
|
127
|
+
|
128
|
+
test "delete access rule" do
|
129
|
+
rule = instance.access_rules.get(rule_name)
|
130
|
+
rule.destroy()
|
131
|
+
tests("should delete key").raises(Fog::OracleCloud::Java::NotFound) do
|
132
|
+
rule = instance.access_rules.get(rule_name)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
end
|
137
|
+
|
138
|
+
tests("#java-delete", "create") do
|
139
|
+
instance = Fog::OracleCloud[:java].instances.get('TestWLS')
|
140
|
+
instance.dba_name = 'Admin',
|
141
|
+
instance.dba_password = 'password'
|
142
|
+
instance.destroy()
|
143
|
+
instance.wait_for { stopping? }
|
144
|
+
tests("should actually delete instance").raises(Fog::OracleCloud::Java::NotFound) do
|
145
|
+
instance.wait_for { stopped? }
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
|
110
150
|
end
|
@@ -1,91 +1,91 @@
|
|
1
|
-
require 'pp'
|
2
|
-
|
3
|
-
Shindo.tests('Fog::Compute[oraclecloud] | orchestration requests', 'orchestrations') do
|
4
|
-
orch_name = "OrchestrationTest-#{rand(100)}"
|
5
|
-
|
6
|
-
tests("#orchestrations-create", "create") do
|
7
|
-
orchestration = Fog::Compute[:oraclecloud].orchestrations.create(
|
8
|
-
:name => orch_name,
|
9
|
-
:oplans => [{
|
10
|
-
'label' =>"WebServer",
|
11
|
-
'obj_type' => "launchplan",
|
12
|
-
'objects' => [{
|
13
|
-
'instances' =>[{
|
14
|
-
'shape' => 'oc3',
|
15
|
-
'label' => "vm-1",
|
16
|
-
'imagelist' =>'/oracle/public/oel_6.4_2GB_v1',
|
17
|
-
'name' => "WebServer"
|
18
|
-
}]
|
19
|
-
}]
|
20
|
-
}]
|
21
|
-
)
|
22
|
-
|
23
|
-
test "can create an orchestration" do
|
24
|
-
orchestration.is_a? Fog::Compute::OracleCloud::Orchestration
|
25
|
-
end
|
26
|
-
|
27
|
-
check = Fog::Compute[:oraclecloud].orchestrations.get(orchestration.name)
|
28
|
-
test "can get created orchestration" do
|
29
|
-
check.uri == orchestration.uri
|
30
|
-
end
|
31
|
-
|
32
|
-
orchestration.oplans << {
|
33
|
-
'label' => "Database Server",
|
34
|
-
'obj_type' => "launchplan",
|
35
|
-
'objects' => [{
|
36
|
-
'instances' => [{
|
37
|
-
'shape' => 'oc3',
|
38
|
-
'label' => 'vm-2',
|
39
|
-
'imagelist' => '/oracle/public/oel_6.4_2GB_v1',
|
40
|
-
'name' => 'DatabaseServer'
|
41
|
-
}]
|
42
|
-
}]
|
43
|
-
}
|
44
|
-
orchestration.save()
|
45
|
-
#orchestration.wait_for { ready? }
|
46
|
-
test "can update orchestration" do
|
47
|
-
check = Fog::Compute[:oraclecloud].orchestrations.get(orchestration.name)
|
48
|
-
check.oplans.size == 2
|
49
|
-
end
|
50
|
-
|
51
|
-
orchestration.start()
|
52
|
-
orchestration.wait_for { running? }
|
53
|
-
test "can start" do
|
54
|
-
orchestration.status == 'running'
|
55
|
-
end
|
56
|
-
orchestration.stop()
|
57
|
-
orchestration.wait_for { stopped? }
|
58
|
-
test "can stop" do
|
59
|
-
orchestration.status == 'stopped'
|
60
|
-
end
|
61
|
-
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
tests("#orchestrations-read") do
|
66
|
-
orchestrations = Fog::Compute[:oraclecloud].orchestrations
|
67
|
-
test "returns an Array" do
|
68
|
-
orchestrations.is_a? Array
|
69
|
-
end
|
70
|
-
|
71
|
-
test "should return keys" do
|
72
|
-
orchestrations.size >= 1
|
73
|
-
end
|
74
|
-
test "should return a valid name" do
|
75
|
-
orchestrations.first.name.is_a? String
|
76
|
-
end
|
77
|
-
|
78
|
-
orchestrations = Fog::Compute[:oraclecloud].orchestrations.get(orchestrations.first.name)
|
79
|
-
test "should return a key" do
|
80
|
-
orchestrations.name.is_a? String
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
tests("#orchestrations-delete", "create") do
|
85
|
-
orchestration = Fog::Compute[:oraclecloud].orchestrations.get(orch_name)
|
86
|
-
orchestration.destroy()
|
87
|
-
tests("can delete orchestration").raises(Fog::Compute::OracleCloud::NotFound) do
|
88
|
-
check = Fog::Compute[:oraclecloud].orchestrations.get(orchestration.name)
|
89
|
-
end
|
90
|
-
end
|
1
|
+
require 'pp'
|
2
|
+
|
3
|
+
Shindo.tests('Fog::Compute[oraclecloud] | orchestration requests', 'orchestrations') do
|
4
|
+
orch_name = "OrchestrationTest-#{rand(100)}"
|
5
|
+
|
6
|
+
tests("#orchestrations-create", "create") do
|
7
|
+
orchestration = Fog::Compute[:oraclecloud].orchestrations.create(
|
8
|
+
:name => orch_name,
|
9
|
+
:oplans => [{
|
10
|
+
'label' =>"WebServer",
|
11
|
+
'obj_type' => "launchplan",
|
12
|
+
'objects' => [{
|
13
|
+
'instances' =>[{
|
14
|
+
'shape' => 'oc3',
|
15
|
+
'label' => "vm-1",
|
16
|
+
'imagelist' =>'/oracle/public/oel_6.4_2GB_v1',
|
17
|
+
'name' => "WebServer"
|
18
|
+
}]
|
19
|
+
}]
|
20
|
+
}]
|
21
|
+
)
|
22
|
+
|
23
|
+
test "can create an orchestration" do
|
24
|
+
orchestration.is_a? Fog::Compute::OracleCloud::Orchestration
|
25
|
+
end
|
26
|
+
|
27
|
+
check = Fog::Compute[:oraclecloud].orchestrations.get(orchestration.name)
|
28
|
+
test "can get created orchestration" do
|
29
|
+
check.uri == orchestration.uri
|
30
|
+
end
|
31
|
+
|
32
|
+
orchestration.oplans << {
|
33
|
+
'label' => "Database Server",
|
34
|
+
'obj_type' => "launchplan",
|
35
|
+
'objects' => [{
|
36
|
+
'instances' => [{
|
37
|
+
'shape' => 'oc3',
|
38
|
+
'label' => 'vm-2',
|
39
|
+
'imagelist' => '/oracle/public/oel_6.4_2GB_v1',
|
40
|
+
'name' => 'DatabaseServer'
|
41
|
+
}]
|
42
|
+
}]
|
43
|
+
}
|
44
|
+
orchestration.save()
|
45
|
+
#orchestration.wait_for { ready? }
|
46
|
+
test "can update orchestration" do
|
47
|
+
check = Fog::Compute[:oraclecloud].orchestrations.get(orchestration.name)
|
48
|
+
check.oplans.size == 2
|
49
|
+
end
|
50
|
+
|
51
|
+
orchestration.start()
|
52
|
+
orchestration.wait_for { running? }
|
53
|
+
test "can start" do
|
54
|
+
orchestration.status == 'running'
|
55
|
+
end
|
56
|
+
orchestration.stop()
|
57
|
+
orchestration.wait_for { stopped? }
|
58
|
+
test "can stop" do
|
59
|
+
orchestration.status == 'stopped'
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
tests("#orchestrations-read") do
|
66
|
+
orchestrations = Fog::Compute[:oraclecloud].orchestrations
|
67
|
+
test "returns an Array" do
|
68
|
+
orchestrations.is_a? Array
|
69
|
+
end
|
70
|
+
|
71
|
+
test "should return keys" do
|
72
|
+
orchestrations.size >= 1
|
73
|
+
end
|
74
|
+
test "should return a valid name" do
|
75
|
+
orchestrations.first.name.is_a? String
|
76
|
+
end
|
77
|
+
|
78
|
+
orchestrations = Fog::Compute[:oraclecloud].orchestrations.get(orchestrations.first.name)
|
79
|
+
test "should return a key" do
|
80
|
+
orchestrations.name.is_a? String
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
tests("#orchestrations-delete", "create") do
|
85
|
+
orchestration = Fog::Compute[:oraclecloud].orchestrations.get(orch_name)
|
86
|
+
orchestration.destroy()
|
87
|
+
tests("can delete orchestration").raises(Fog::Compute::OracleCloud::NotFound) do
|
88
|
+
check = Fog::Compute[:oraclecloud].orchestrations.get(orchestration.name)
|
89
|
+
end
|
90
|
+
end
|
91
91
|
end
|