aeolus-image 0.0.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +161 -0
- data/Rakefile +32 -19
- data/lib/aeolus_image.rb +35 -0
- data/lib/aeolus_image/active_resource_oauth_client.rb +62 -0
- data/lib/aeolus_image/import.rb +44 -0
- data/lib/aeolus_image/model/factory/base.rb +93 -0
- data/lib/aeolus_image/model/factory/build.rb +23 -0
- data/lib/aeolus_image/model/factory/builder.rb +46 -0
- data/lib/aeolus_image/model/factory/image.rb +23 -0
- data/lib/aeolus_image/model/factory/provider_image.rb +35 -0
- data/lib/aeolus_image/model/factory/target_image.rb +45 -0
- data/lib/aeolus_image/model/warehouse/icicle.rb +60 -0
- data/lib/aeolus_image/model/warehouse/image.rb +135 -0
- data/lib/aeolus_image/model/warehouse/image_build.rb +60 -0
- data/lib/aeolus_image/model/warehouse/provider_image.rb +36 -0
- data/lib/aeolus_image/model/warehouse/target_image.rb +53 -0
- data/lib/aeolus_image/model/warehouse/template.rb +35 -0
- data/lib/aeolus_image/model/warehouse/warehouse_client.rb +201 -0
- data/lib/aeolus_image/model/warehouse/warehouse_model.rb +236 -0
- data/spec/aeolus_image/model/factory/provider_image_spec.rb +12 -0
- data/spec/models/factory/base_spec.rb +94 -0
- data/spec/models/factory/builder_spec.rb +31 -0
- data/spec/models/factory/provider_image_spec.rb +21 -0
- data/spec/models/factory/target_image_spec.rb +21 -0
- data/spec/models/warehouse/image_build_spec.rb +189 -0
- data/spec/models/warehouse/image_spec.rb +241 -0
- data/spec/models/warehouse/provider_image_spec.rb +115 -0
- data/spec/models/warehouse/target_image_spec.rb +180 -0
- data/spec/models/warehouse/template_spec.rb +76 -0
- data/spec/models/warehouse/warehouse_client_spec.rb +445 -0
- data/spec/models/warehouse/warehouse_model_spec.rb +94 -0
- data/spec/spec_helper.rb +34 -47
- data/spec/vcr/cassettes/builder.yml +24 -0
- data/spec/vcr/cassettes/oauth.yml +80 -0
- data/spec/vcr/cassettes/oauth_fail_invalid.yml +30 -0
- data/spec/vcr/cassettes/oauth_fail_no.yml +22 -0
- data/spec/vcr/cassettes/oauth_success_valid.yml +30 -0
- data/spec/vcr_setup.rb +26 -0
- metadata +70 -46
- data/bin/aeolus-image +0 -6
- data/examples/aeolus-cli +0 -9
- data/examples/custom_repo.tdl +0 -18
- data/examples/image_description.xml +0 -3
- data/examples/tdl.rng +0 -207
- data/lib/base_command.rb +0 -134
- data/lib/build_command.rb +0 -68
- data/lib/config_parser.rb +0 -212
- data/lib/delete_command.rb +0 -9
- data/lib/import_command.rb +0 -44
- data/lib/list_command.rb +0 -141
- data/lib/push_command.rb +0 -72
- data/man/aeolus-image-build.1 +0 -36
- data/man/aeolus-image-import.1 +0 -57
- data/man/aeolus-image-list.1 +0 -80
- data/man/aeolus-image-push.1 +0 -40
- data/man/aeolus-image.1 +0 -16
- data/spec/base_command_spec.rb +0 -76
- data/spec/build_command_spec.rb +0 -63
- data/spec/config_parser_spec.rb +0 -82
- data/spec/import_command_spec.rb +0 -43
- data/spec/list_command_spec.rb +0 -21
- data/spec/push_command_spec.rb +0 -56
- data/spec/spec.opts +0 -3
data/spec/import_command_spec.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Aeolus
|
4
|
-
module Image
|
5
|
-
describe ImportCommand do
|
6
|
-
before(:each) do
|
7
|
-
@options[:id] = "ami-test"
|
8
|
-
@options[:target] = "ec2"
|
9
|
-
@options[:provider] = "ec2-us-east-1"
|
10
|
-
end
|
11
|
-
|
12
|
-
describe "#import_image" do
|
13
|
-
it "should import an image with default description values" do
|
14
|
-
importc = ImportCommand.new(@options)
|
15
|
-
begin
|
16
|
-
importc.import_image
|
17
|
-
rescue SystemExit => e
|
18
|
-
e.status.should == 0
|
19
|
-
end
|
20
|
-
$stdout.string.should include("Image:")
|
21
|
-
$stdout.string.should include("Target Image:")
|
22
|
-
$stdout.string.should include("Build:")
|
23
|
-
$stdout.string.should include("Provider Image:")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should import an image with file description" do
|
27
|
-
@options[:description] = 'spec/sample_data/image_description.xml'
|
28
|
-
importc = ImportCommand.new(@options)
|
29
|
-
begin
|
30
|
-
importc.import_image
|
31
|
-
rescue SystemExit => e
|
32
|
-
e.status.should == 0
|
33
|
-
end
|
34
|
-
$stdout.string.should include("Image:")
|
35
|
-
$stdout.string.should include("Target Image:")
|
36
|
-
$stdout.string.should include("Build:")
|
37
|
-
$stdout.string.should include("Provider Image:")
|
38
|
-
#TODO: Add test to check that file was uploaded properly (when we have implemented a show/view image command)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/spec/list_command_spec.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Aeolus
|
4
|
-
module Image
|
5
|
-
describe ListCommand do
|
6
|
-
it "should return a list of images" do
|
7
|
-
regexp = Regexp.new('[uuid:\s][\w]{8}[-][\w]{4}[-][\w]{4}[-][\w]{4}[-][\w]{12}')
|
8
|
-
listc = ListCommand.new(:subcommand => 'images')
|
9
|
-
images = listc.images
|
10
|
-
images.each do |image|
|
11
|
-
regexp.match(image.to_s).should_not == nil
|
12
|
-
end
|
13
|
-
end
|
14
|
-
it "should return not implemented for unimplemented subcommands" do
|
15
|
-
l = ListCommand.new()
|
16
|
-
r = l.targets
|
17
|
-
r.should eql("This option or combination is not yet implemented")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
data/spec/push_command_spec.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Aeolus
|
4
|
-
module Image
|
5
|
-
describe PushCommand do
|
6
|
-
|
7
|
-
before(:each) do
|
8
|
-
@options[:provider] = ['mock']
|
9
|
-
@options[:user] = 'admin'
|
10
|
-
@options[:password] = 'password'
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "#run" do
|
14
|
-
before(:each) do
|
15
|
-
options = {}
|
16
|
-
options[:target] = ['mock','ec2']
|
17
|
-
options[:template] = "#{File.dirname(__FILE__)}" + "/../examples/custom_repo.tdl"
|
18
|
-
b = BuildCommand.new(options)
|
19
|
-
sleep(5)
|
20
|
-
tmpl_str = b.send(:read_file, options[:template])
|
21
|
-
b.console.build(tmpl_str, ['mock','ec2']).each do |adaptor|
|
22
|
-
@build_id = adaptor.image
|
23
|
-
end
|
24
|
-
b.console.shutdown
|
25
|
-
@options[:id] = @build_id
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should push an image with valid options" do
|
29
|
-
p = PushCommand.new(@options, @output)
|
30
|
-
begin
|
31
|
-
p.run
|
32
|
-
rescue SystemExit => e
|
33
|
-
e.status.should == 0
|
34
|
-
end
|
35
|
-
$stdout.string.should include("Image:")
|
36
|
-
$stdout.string.should include("Provider Image:")
|
37
|
-
$stdout.string.should include("Build:")
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe "#combo_implemented?" do
|
42
|
-
it "should give useful feedback if no template or target is specified" do
|
43
|
-
@options.delete(:id)
|
44
|
-
@options.delete(:provider)
|
45
|
-
b = PushCommand.new(@options, @output)
|
46
|
-
begin
|
47
|
-
b.combo_implemented?
|
48
|
-
rescue SystemExit => e
|
49
|
-
e.status.should == 1
|
50
|
-
end
|
51
|
-
$stdout.string.should include("This combination of parameters is not currently supported")
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
data/spec/spec.opts
DELETED