rumm 0.0.22 → 0.0.23
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 +14 -6
- data/.gitignore +2 -1
- data/app/controllers/attachments_controller.rb +21 -11
- data/app/controllers/containers_controller.rb +8 -2
- data/app/controllers/databases_controller.rb +7 -2
- data/app/controllers/files_controller.rb +13 -2
- data/app/controllers/instances_controller.rb +10 -4
- data/app/controllers/nodes_controller.rb +11 -5
- data/app/controllers/volumes_controller.rb +9 -5
- data/app/forms/attachments/attach_detach_show_form.rb +8 -0
- data/app/forms/containers/create_form.rb +5 -0
- data/app/forms/databases/create_form.rb +6 -0
- data/app/forms/files/create_form.rb +5 -0
- data/app/forms/files/download_form.rb +5 -0
- data/app/forms/instances/create_form.rb +11 -0
- data/app/forms/loadbalancers/create_form.rb +2 -2
- data/app/forms/nodes/create_form.rb +12 -0
- data/app/forms/users/create_form.rb +1 -1
- data/app/forms/volumes/create_form.rb +10 -0
- data/app/help/create_attachment_on_server.txt +14 -0
- data/app/help/create_container.txt +1 -0
- data/app/help/{create_database.txt → create_database_on_dbinstance.txt} +3 -3
- data/app/help/create_dbinstance.txt +3 -3
- data/app/help/create_file_in_container.txt +14 -0
- data/app/help/create_node_on_loadbalancer.txt +17 -0
- data/app/help/create_server.txt +4 -4
- data/app/help/{create_user.txt → create_user_on_dbinstance.txt} +0 -0
- data/app/help/create_volume.txt +4 -2
- data/app/help/destroy_attachment_on_server.txt +14 -0
- data/app/help/{destroy_database.txt → destroy_database_on_dbinstance.txt} +0 -0
- data/app/help/{destroy_file.txt → destroy_file_in_container.txt} +0 -0
- data/app/help/{destroy_node.txt → destroy_node_on_loadbalancer.txt} +0 -0
- data/app/help/destroy_user_on_dbinstance.txt +15 -0
- data/app/help/download_file_in_container.txt +15 -0
- data/app/help/routes.rb +4 -3
- data/app/help/show_attachment_on_server.txt +14 -0
- data/app/help/{show_attachments.txt → show_attachments_on_server.txt} +0 -0
- data/app/help/{show_database.txt → show_database_on_dbinstance.txt} +0 -0
- data/app/help/{show_databases.txt → show_databases_on_dbinstance.txt} +0 -0
- data/app/help/{show_file.txt → show_file_in_container.txt} +0 -0
- data/app/help/{show_files.txt → show_files_in_container.txt} +0 -0
- data/app/help/{show_node.txt → show_node_in_loadbalancer.txt} +0 -0
- data/app/help/show_user_on_dbinstance.txt +15 -0
- data/app/help/{show_users.txt → show_users_on_dbinstance.txt} +0 -0
- data/app/providers/compute_provider.rb +2 -1
- data/app/providers/containers_provider.rb +2 -1
- data/app/providers/databases_provider.rb +2 -1
- data/app/providers/instances_provider.rb +2 -1
- data/app/providers/loadbalancers_provider.rb +2 -1
- data/app/providers/nodes_provider.rb +2 -1
- data/app/providers/volumes_provider.rb +2 -1
- data/app/routes.rb +5 -4
- data/app/views/attachments/attach.txt.erb +4 -1
- data/app/views/attachments/detach.txt.erb +1 -1
- data/app/views/attachments/index.txt.erb +10 -2
- data/app/views/attachments/show.txt.erb +3 -1
- data/app/views/containers/create.txt.erb +1 -1
- data/app/views/containers/destroy.txt.erb +1 -1
- data/app/views/containers/index.txt.erb +7 -1
- data/app/views/databases/create.txt.erb +1 -1
- data/app/views/databases/destroy.txt.erb +1 -1
- data/app/views/databases/index.txt.erb +2 -1
- data/app/views/files/create.txt.erb +1 -2
- data/app/views/files/destroy.txt.erb +1 -1
- data/app/views/files/download.txt.erb +1 -1
- data/app/views/files/index.txt.erb +9 -1
- data/app/views/files/show.txt.erb +2 -1
- data/app/views/instances/create.txt.erb +1 -1
- data/app/views/instances/destroy.txt.erb +1 -1
- data/app/views/instances/index.txt.erb +2 -1
- data/app/views/instances/show.txt.erb +4 -1
- data/app/views/loadbalancers/create.txt.erb +1 -1
- data/app/views/loadbalancers/destroy.txt.erb +1 -1
- data/app/views/loadbalancers/index.txt.erb +1 -0
- data/app/views/nodes/create.txt.erb +1 -1
- data/app/views/nodes/destroy.txt.erb +1 -1
- data/app/views/nodes/index.txt.erb +7 -2
- data/app/views/nodes/show.txt.erb +6 -1
- data/app/views/users/index.txt.erb +4 -3
- data/app/views/volumes/create.txt.erb +1 -1
- data/app/views/volumes/destroy.txt.erb +1 -1
- data/app/views/volumes/index.txt.erb +8 -1
- data/app/views/volumes/show.txt.erb +7 -1
- data/lib/rumm/version.rb +1 -1
- data/rumm.gemspec +3 -3
- data/spec/features/attachments_spec.rb +33 -0
- data/spec/features/containers_spec.rb +30 -0
- data/spec/features/databases_spec.rb +29 -0
- data/spec/features/dbinstances_spec.rb +30 -0
- data/spec/features/files_spec.rb +50 -0
- data/spec/features/help_spec.rb +2 -2
- data/spec/features/loadbalancers_spec.rb +30 -0
- data/spec/features/login_spec.rb +21 -17
- data/spec/features/nodes_spec.rb +35 -0
- data/spec/features/servers_spec.rb +7 -13
- data/spec/features/volumes_spec.rb +29 -0
- data/spec/fixtures/cassettes/attachments/create.yml +305 -0
- data/spec/fixtures/cassettes/attachments/destroy.yml +342 -0
- data/spec/fixtures/cassettes/attachments/show-all.yml +145 -0
- data/spec/fixtures/cassettes/attachments/show.yml +309 -0
- data/spec/fixtures/cassettes/authentication/successful-login.yml +78 -0
- data/spec/fixtures/cassettes/{unsuccessful-login.yml → authentication/unsuccessful-login.yml} +3 -3
- data/spec/fixtures/cassettes/containers/create.yml +212 -0
- data/spec/fixtures/cassettes/containers/destroy.yml +211 -0
- data/spec/fixtures/cassettes/containers/show-all.yml +92 -0
- data/spec/fixtures/cassettes/containers/show.yml +92 -0
- data/spec/fixtures/cassettes/databases/create.yml +171 -0
- data/spec/fixtures/cassettes/databases/destroy.yml +206 -0
- data/spec/fixtures/cassettes/databases/show-all.yml +171 -0
- data/spec/fixtures/cassettes/databases/show.yml +171 -0
- data/spec/fixtures/cassettes/files/create.yml +129 -0
- data/spec/fixtures/cassettes/files/destroy.yml +166 -0
- data/spec/fixtures/cassettes/files/download.yml +132 -0
- data/spec/fixtures/cassettes/files/show-all.yml +175 -0
- data/spec/fixtures/cassettes/files/show.yml +133 -0
- data/spec/fixtures/cassettes/instances/create.yml +87 -0
- data/spec/fixtures/cassettes/instances/destroy.yml +128 -0
- data/spec/fixtures/cassettes/instances/show-all.yml +87 -0
- data/spec/fixtures/cassettes/instances/show.yml +128 -0
- data/spec/fixtures/cassettes/loadbalancers/create.yml +81 -0
- data/spec/fixtures/cassettes/loadbalancers/destroy.yml +114 -0
- data/spec/fixtures/cassettes/loadbalancers/show-all.yml +81 -0
- data/spec/fixtures/cassettes/loadbalancers/show.yml +81 -0
- data/spec/fixtures/cassettes/nodes/create.yml +159 -0
- data/spec/fixtures/cassettes/nodes/destroy.yml +192 -0
- data/spec/fixtures/cassettes/nodes/show-all.yml +159 -0
- data/spec/fixtures/cassettes/nodes/show.yml +159 -0
- data/spec/fixtures/cassettes/{create-server.yml → servers/create.yml} +2452 -3032
- data/spec/fixtures/cassettes/servers/destroy.yml +130 -0
- data/spec/fixtures/cassettes/servers/show-all.yml +81 -0
- data/spec/fixtures/cassettes/servers/show.yml +183 -0
- data/spec/fixtures/cassettes/volumes/create.yml +83 -0
- data/spec/fixtures/cassettes/volumes/destroy.yml +114 -0
- data/spec/fixtures/cassettes/volumes/show-all.yml +83 -0
- data/spec/fixtures/cassettes/volumes/show.yml +83 -0
- data/spec/spec_helper.rb +37 -7
- metadata +135 -62
- data/app/help/attach_volume.txt +0 -15
- data/app/help/create_node.txt +0 -14
- data/app/help/detach_volume.txt +0 -15
- data/spec/fixtures/cassettes/destroy-server.yml +0 -130
- data/spec/fixtures/cassettes/show-server.yml +0 -183
- data/spec/fixtures/cassettes/show-servers.yml +0 -81
- data/spec/fixtures/cassettes/successful-login.yml +0 -78
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<% if this.empty? %>
|
|
2
|
-
|
|
2
|
+
you don't have any users on this dbinstance, but you can create one by running:
|
|
3
|
+
rumm create user on dbinstance <dbinstance_name>
|
|
3
4
|
<% else %>
|
|
4
5
|
<% this.each do |user| %>
|
|
5
|
-
<%= user.name %>, <%= user.databases.inspect %>
|
|
6
|
+
<%= user.name %>, <%= user.databases.inspect %>
|
|
7
|
+
<% end %>
|
|
6
8
|
<% end %>
|
|
7
|
-
<% end %>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Created volume: <%= this.display_name %>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Requested destruction of volume <%= this %>
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
Volumes:
|
|
1
2
|
<% this.each do |volume| %>
|
|
2
|
-
id: <%= volume.
|
|
3
|
+
id: <%= volume.id %>
|
|
4
|
+
display name: <%= volume.display_name %>
|
|
5
|
+
display description: <%= volume.display_description %>
|
|
6
|
+
size: <%= volume.size %>
|
|
7
|
+
volume type: <%= volume.volume_type %>
|
|
8
|
+
attachments: <%= volume.attachments %>
|
|
9
|
+
created at: <%= volume.created_at %>
|
|
3
10
|
<% end %>
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
<%= this.
|
|
1
|
+
id: <%= this.id %>
|
|
2
|
+
display name: <%= this.display_name %>
|
|
3
|
+
display description: <%= this.display_description %>
|
|
4
|
+
size: <%= this.size %>
|
|
5
|
+
volume type: <%= this.volume_type %>
|
|
6
|
+
attachments: <%= this.attachments %>
|
|
7
|
+
created at: <%= this.created_at %>
|
data/lib/rumm/version.rb
CHANGED
data/rumm.gemspec
CHANGED
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.email = ["cowboyd@thefrontside.net"]
|
|
11
11
|
spec.description = %q{Lift heavy things inside your Rackspace}
|
|
12
12
|
spec.summary = %q{CLI and API for managing Rackspace infrastructure}
|
|
13
|
-
spec.homepage = "https://github.com/
|
|
13
|
+
spec.homepage = "https://github.com/rackspace/rumm"
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
|
|
21
21
|
spec.required_ruby_version = ">= 1.9.3"
|
|
22
22
|
|
|
23
|
-
spec.add_dependency "mvcli", "~> 0.0.
|
|
24
|
-
spec.add_dependency "fog", "~> 1.
|
|
23
|
+
spec.add_dependency "mvcli", "~> 0.0.16"
|
|
24
|
+
spec.add_dependency "fog", "~> 1.15.0"
|
|
25
25
|
spec.add_dependency "netrc"
|
|
26
26
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe "using the attachments api" do
|
|
4
|
+
context "with credentials are present" do
|
|
5
|
+
|
|
6
|
+
include_context "netrc"
|
|
7
|
+
|
|
8
|
+
context "to create" do
|
|
9
|
+
When { VCR.use_cassette('attachments/create') { run "rumm create attachment on server silly-saffron --volume jumping-jellybean" }}
|
|
10
|
+
Then { all_stdout =~ /Attached volume/ }
|
|
11
|
+
And { last_exit_status.should eql 0 }
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
context "to show" do
|
|
15
|
+
When { VCR.use_cassette('attachments/show') { run "rumm show attachment on server silly-saffron --volume jumping-jellybean" }}
|
|
16
|
+
Then { all_stdout =~ /device/ }
|
|
17
|
+
And { last_exit_status.should eql 0 }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
context "to show all" do
|
|
21
|
+
#Given { pending "Not working, some sort of error in forms" }
|
|
22
|
+
When { VCR.use_cassette('attachments/show-all') { run "rumm show attachments on server silly-saffron" }}
|
|
23
|
+
Then { all_stdout =~ /Attachments/}
|
|
24
|
+
And { last_exit_status.should eql 0 }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
context "to destroy" do
|
|
28
|
+
When { VCR.use_cassette('attachments/destroy') { run "rumm destroy attachment on server silly-saffron --volume jumping-jellybean" }}
|
|
29
|
+
Then { all_stdout =~ /Detached volume/}
|
|
30
|
+
And { last_exit_status.should eql 0 }
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe "using the containers api" do
|
|
4
|
+
|
|
5
|
+
include_context "netrc"
|
|
6
|
+
|
|
7
|
+
context "to create" do
|
|
8
|
+
When { VCR.use_cassette('containers/create') { run "rumm create container --name cruising-crouton" }}
|
|
9
|
+
Then { all_stdout =~ /Created container/ }
|
|
10
|
+
And { last_exit_status.should eql 0 }
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
context "to show" do
|
|
14
|
+
When { VCR.use_cassette('containers/show') { run "rumm show container cruising-crouton" }}
|
|
15
|
+
Then { all_stdout =~ /cruising-crouton/ }
|
|
16
|
+
And { last_exit_status.should eql 0 }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
context "to show all" do
|
|
20
|
+
When { VCR.use_cassette('containers/show-all') { run "rumm show containers" }}
|
|
21
|
+
Then { all_stdout =~ /Containers:/}
|
|
22
|
+
And { last_exit_status.should eql 0 }
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
context "to destroy" do
|
|
26
|
+
When { VCR.use_cassette('containers/destroy') { run "rumm destroy container cruising-crouton" }}
|
|
27
|
+
Then { all_stdout =~ /Requested destruction/}
|
|
28
|
+
And { last_exit_status.should eql 0 }
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe "using the databases api" do
|
|
4
|
+
include_context "netrc"
|
|
5
|
+
|
|
6
|
+
context "to create" do
|
|
7
|
+
When { VCR.use_cassette('databases/create') { run "rumm create database on dbinstance decided-irony --name dancing-bear" }}
|
|
8
|
+
Then { all_stdout =~ /Created database/ }
|
|
9
|
+
And { last_exit_status.should eql 0 }
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
context "to show" do
|
|
13
|
+
When { VCR.use_cassette('databases/show') { run "rumm show database dancing-bear on dbinstance decided-irony" }}
|
|
14
|
+
Then { all_stdout =~ /dancing-bear/ }
|
|
15
|
+
And { last_exit_status.should eql 0 }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
context "to show all" do
|
|
19
|
+
When { VCR.use_cassette('databases/show-all') { run "rumm show databases on dbinstance decided-irony" }}
|
|
20
|
+
Then { all_stdout =~ /Databases/}
|
|
21
|
+
And { last_exit_status.should eql 0 }
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
context "to destroy" do
|
|
25
|
+
When { VCR.use_cassette('databases/destroy') { run "rumm destroy database dancing-bear on dbinstance decided-irony" }}
|
|
26
|
+
Then { all_stdout =~ /Destroyed/}
|
|
27
|
+
And { last_exit_status.should eql 0 }
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe "using the instance api" do
|
|
4
|
+
|
|
5
|
+
include_context "netrc"
|
|
6
|
+
|
|
7
|
+
context "to create" do
|
|
8
|
+
When { VCR.use_cassette('instances/create') { run "rumm create dbinstance --name dancing-idol" }}
|
|
9
|
+
Then { all_stdout =~ /Created database instance/ }
|
|
10
|
+
And { last_exit_status.should eql 0 }
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
context "to show" do
|
|
14
|
+
When { VCR.use_cassette('instances/show') { run "rumm show dbinstance dancing-idol" }}
|
|
15
|
+
Then { all_stdout =~ /dancing-idol/ }
|
|
16
|
+
And { last_exit_status.should eql 0 }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
context "to show all" do
|
|
20
|
+
When { VCR.use_cassette('instances/show-all') { run "rumm show dbinstances" }}
|
|
21
|
+
Then { all_stdout =~ /Database instances:/}
|
|
22
|
+
And { last_exit_status.should eql 0 }
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
context "to destroy" do
|
|
26
|
+
When { VCR.use_cassette('instances/destroy') { run "rumm destroy dbinstance dancing-idol" }}
|
|
27
|
+
Then { all_stdout =~ /Requested destruction/}
|
|
28
|
+
And { last_exit_status.should eql 0 }
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe "using the files api" do
|
|
4
|
+
|
|
5
|
+
include_context "netrc"
|
|
6
|
+
|
|
7
|
+
context "to create" do
|
|
8
|
+
Given do
|
|
9
|
+
`touch ~/test`
|
|
10
|
+
`echo "the cake is a lie" >> ~/test`
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
When { VCR.use_cassette('files/create') { run "rumm create file test in container colorful-cat --file \"#{File.expand_path "~" + "/test" }\"" }}
|
|
14
|
+
Then { all_stderr == "" }
|
|
15
|
+
Then { all_stdout =~ /Created file/ }
|
|
16
|
+
And { last_exit_status.should eql 0 }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
context "to show" do
|
|
20
|
+
When { VCR.use_cassette('files/show') { run "rumm show file test in container colorful-cat" }}
|
|
21
|
+
Then { all_stderr == "" }
|
|
22
|
+
Then { all_stdout =~ /test/ }
|
|
23
|
+
And { last_exit_status.should eql 0 }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
context "to show all" do
|
|
27
|
+
When { VCR.use_cassette('files/show-all') { run "rumm show files in container colorful-cat" }}
|
|
28
|
+
Then { all_stderr == ""}
|
|
29
|
+
Then { all_stdout =~ /Files:/}
|
|
30
|
+
And { last_exit_status.should eql 0 }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
context "to download" do
|
|
34
|
+
When { VCR.use_cassette('files/download') { run "rumm download file test in container colorful-cat --destination download-test" }}
|
|
35
|
+
Then { all_stderr == "" }
|
|
36
|
+
Then { all_stdout =~ /Downloaded/ }
|
|
37
|
+
And { last_exit_status.should eql 0 }
|
|
38
|
+
|
|
39
|
+
after do
|
|
40
|
+
`rm #{File.expand_path '~'}/download-test`
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
context "to destroy" do
|
|
45
|
+
When { VCR.use_cassette('files/destroy') { run "rumm destroy file test in container colorful-cat" }}
|
|
46
|
+
Then { all_stderr == "" }
|
|
47
|
+
Then { all_stdout =~ /Requested destruction/}
|
|
48
|
+
And { last_exit_status.should eql 0 }
|
|
49
|
+
end
|
|
50
|
+
end
|
data/spec/features/help_spec.rb
CHANGED
|
@@ -134,8 +134,8 @@ describe "interactive learning" do
|
|
|
134
134
|
# --nodes[1][address]: 'xxx' -> IPAddr::InvalidAddressError: invalid address
|
|
135
135
|
|
|
136
136
|
Given {rumm "create loadbalancer --node 10.0.0.1:999999 --node %%^:80 --port=-1"}
|
|
137
|
-
Then { stderr.match "port:
|
|
138
|
-
Then { stderr.match /nodes\[0\].port:
|
|
137
|
+
Then { stderr.match "port: must be between 0 and 65,535" }
|
|
138
|
+
Then { stderr.match /nodes\[0\].port: must be between 0 and 65,535/ }
|
|
139
139
|
Then { stderr.match /nodes\[1\].address:/}
|
|
140
140
|
end
|
|
141
141
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe "using the load balancers api" do
|
|
4
|
+
|
|
5
|
+
include_context "netrc"
|
|
6
|
+
|
|
7
|
+
context "to create" do
|
|
8
|
+
When { VCR.use_cassette('loadbalancers/create') { run "rumm create loadbalancer --name likable-bear --node 166.78.114.25:80" }}
|
|
9
|
+
Then { all_stdout =~ /Created load balancer/ }
|
|
10
|
+
And { last_exit_status.should eql 0 }
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
context "to show" do
|
|
14
|
+
When { VCR.use_cassette('loadbalancers/show') { run "rumm show loadbalancer likable-bear" }}
|
|
15
|
+
Then { all_stdout =~ /likable-bear/ }
|
|
16
|
+
And { last_exit_status.should eql 0 }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
context "to show all" do
|
|
20
|
+
When { VCR.use_cassette('loadbalancers/show-all') { run "rumm show loadbalancers" }}
|
|
21
|
+
Then { all_stdout =~ /Loadbalancers:/}
|
|
22
|
+
And { last_exit_status.should eql 0 }
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
context "to destroy" do
|
|
26
|
+
When { VCR.use_cassette('loadbalancers/destroy') { run "rumm destroy loadbalancer likable-bear" }}
|
|
27
|
+
Then { all_stdout =~ /Requested destruction/}
|
|
28
|
+
And { last_exit_status.should eql 0 }
|
|
29
|
+
end
|
|
30
|
+
end
|
data/spec/features/login_spec.rb
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
require "spec_helper"
|
|
2
2
|
require "netrc"
|
|
3
|
+
require 'io/console'
|
|
3
4
|
|
|
4
5
|
describe "logging in" do
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
#@announce_env = true
|
|
9
|
-
#@announce_stdout = true
|
|
10
|
-
#@announce_stderr = true
|
|
11
|
-
@home = Pathname(set_env "HOME", File.expand_path(current_dir))
|
|
6
|
+
include_context "netrc"
|
|
7
|
+
before do
|
|
8
|
+
run "rumm logout"
|
|
12
9
|
end
|
|
13
10
|
context "interactively with valid credentials" do
|
|
14
11
|
When do
|
|
15
|
-
VCR.use_cassette('successful-login') do
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
VCR.use_cassette('authentication/successful-login') do
|
|
13
|
+
if VCR.current_cassette.recording?
|
|
14
|
+
print "\nUsername: "
|
|
15
|
+
username = $stdin.gets.chomp
|
|
16
|
+
print "Password: "
|
|
17
|
+
password = $stdin.noecho(&:gets).chomp
|
|
18
|
+
end
|
|
19
|
+
will_type username || "<username>"
|
|
20
|
+
will_type password || "<password>"
|
|
18
21
|
run_interactive "rumm login"
|
|
19
22
|
stop_process @interactive
|
|
20
23
|
end
|
|
@@ -22,16 +25,17 @@ describe "logging in" do
|
|
|
22
25
|
Then {last_exit_status == 0}
|
|
23
26
|
|
|
24
27
|
context "places your login credentials in your .netrc" do
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
Given(:netrc) { Netrc.read["api.rackspace.com"] }
|
|
29
|
+
Given(:user) {netrc.first}
|
|
30
|
+
Given(:password) {netrc.last}
|
|
31
|
+
|
|
32
|
+
Then { user != nil }
|
|
33
|
+
And { password != nil }
|
|
30
34
|
end
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
context "logging out" do
|
|
34
|
-
When {
|
|
38
|
+
When {run "rumm logout"}
|
|
35
39
|
Then {last_exit_status == 0}
|
|
36
40
|
|
|
37
41
|
context "removes your login credentials from .netrc" do
|
|
@@ -43,7 +47,7 @@ describe "logging in" do
|
|
|
43
47
|
end
|
|
44
48
|
context "interactively with invalid credentials" do
|
|
45
49
|
When do
|
|
46
|
-
VCR.use_cassette("unsuccessful-login") do
|
|
50
|
+
VCR.use_cassette("authentication/unsuccessful-login") do
|
|
47
51
|
will_type "nil"
|
|
48
52
|
will_type "nil"
|
|
49
53
|
run_interactive "rum login"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe "using the nodes api" do
|
|
4
|
+
$id = "test"
|
|
5
|
+
include_context "netrc"
|
|
6
|
+
|
|
7
|
+
context "to create" do
|
|
8
|
+
When { VCR.use_cassette('nodes/create') { run "rumm create node on loadbalancer laughing-barrel --address 198.61.221.220 --condition ENABLED --port: 80" }}
|
|
9
|
+
Then { all_stdout =~ /Created node/ }
|
|
10
|
+
And { last_exit_status.should eql 0 }
|
|
11
|
+
|
|
12
|
+
after do
|
|
13
|
+
$id = all_stdout.match(/\d+/)[0]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
context "to show" do
|
|
19
|
+
When { VCR.use_cassette('nodes/show') { run "rumm show node #{$id} on loadbalancer laughing-barrel" }}
|
|
20
|
+
Then { all_stdout =~ /id:/ }
|
|
21
|
+
And { last_exit_status.should eql 0 }
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
context "to show all" do
|
|
25
|
+
When { VCR.use_cassette('nodes/show-all') { run "rumm show nodes on loadbalancer laughing-barrel" }}
|
|
26
|
+
Then { all_stdout =~ /Nodes/}
|
|
27
|
+
And { last_exit_status.should eql 0 }
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
context "to destroy" do
|
|
31
|
+
When { VCR.use_cassette('nodes/destroy') { run "rumm destroy node #{$id} on loadbalancer laughing-barrel" }}
|
|
32
|
+
Then { all_stdout =~ /Destroyed/}
|
|
33
|
+
And { last_exit_status.should eql 0 }
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -2,17 +2,11 @@ require "spec_helper"
|
|
|
2
2
|
|
|
3
3
|
describe "using the server api" do
|
|
4
4
|
context "with credentials are present" do
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
f.chmod 0600
|
|
9
|
-
f.puts "machine api.rackspace.com"
|
|
10
|
-
f.puts " login #{ENV['RACKSPACE_USERNAME'] || '<rackspace-username>'}"
|
|
11
|
-
f.puts " password #{ENV['RACKSPACE_API_KEY'] || '<rackspace-api-key>'}"
|
|
12
|
-
end
|
|
13
|
-
end
|
|
5
|
+
|
|
6
|
+
include_context "netrc"
|
|
7
|
+
|
|
14
8
|
context "when I list all my servers (and I don't have any')" do
|
|
15
|
-
When {VCR.use_cassette('show-
|
|
9
|
+
When {VCR.use_cassette('servers/show-all') {run "rumm show servers"}}
|
|
16
10
|
Then {all_stdout =~ /you don't have any servers/}
|
|
17
11
|
And {last_exit_status.should eql 0}
|
|
18
12
|
end
|
|
@@ -23,16 +17,16 @@ describe "using the server api" do
|
|
|
23
17
|
FileUtils.mkdir_p private_key.dirname, mode: 0700
|
|
24
18
|
`echo -e "y\n" | ssh-keygen -t rsa -C "test@example.com" -N "testing" -f "#{private_key}"`
|
|
25
19
|
end
|
|
26
|
-
When {VCR.use_cassette('create
|
|
20
|
+
When {VCR.use_cassette('servers/create') {run "rumm create server --name silly-saffron"}}
|
|
27
21
|
Then {all_stdout =~ /created server/}
|
|
28
22
|
And {last_exit_status.should eql 0}
|
|
29
23
|
end
|
|
30
24
|
context "when I show a server" do
|
|
31
|
-
When {VCR.use_cassette('show
|
|
25
|
+
When {VCR.use_cassette('servers/show') {run "rumm show server silly-saffron"}}
|
|
32
26
|
Then {last_exit_status.should eql 0}
|
|
33
27
|
end
|
|
34
28
|
context "when I destroy a server that exists" do
|
|
35
|
-
When {VCR.use_cassette('destroy
|
|
29
|
+
When {VCR.use_cassette('servers/destroy') {run "rumm destroy server silly-saffron"}}
|
|
36
30
|
Then {all_stdout =~ /destruction/}
|
|
37
31
|
And {last_exit_status.should eql 0}
|
|
38
32
|
end
|