boxgrinder-build 0.9.8 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/CHANGELOG +15 -0
  2. data/Manifest +7 -22
  3. data/Rakefile +3 -1
  4. data/bin/boxgrinder-build +1 -1
  5. data/boxgrinder-build.gemspec +17 -13
  6. data/integ/appliances/jeos-centos6.appl +4 -0
  7. data/lib/boxgrinder-build/appliance.rb +61 -23
  8. data/lib/boxgrinder-build/helpers/ec2-helper.rb +18 -0
  9. data/lib/boxgrinder-build/helpers/linux-helper.rb +41 -2
  10. data/lib/boxgrinder-build/helpers/plugin-helper.rb +3 -0
  11. data/lib/boxgrinder-build/helpers/s3-helper.rb +18 -0
  12. data/lib/boxgrinder-build/helpers/sftp-helper.rb +124 -0
  13. data/lib/boxgrinder-build/managers/plugin-manager.rb +5 -3
  14. data/lib/boxgrinder-build/plugins/base-plugin.rb +2 -22
  15. data/lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb +26 -15
  16. data/lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb +2 -1
  17. data/lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb +164 -0
  18. data/lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin.rb +313 -0
  19. data/lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb +2 -1
  20. data/lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb +133 -0
  21. data/lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb +15 -2
  22. data/lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb +20 -106
  23. data/lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb +3 -3
  24. data/lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb +2 -1
  25. data/lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb +2 -1
  26. data/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb +6 -64
  27. data/lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb +2 -1
  28. data/lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb +1 -2
  29. data/lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb +15 -1
  30. data/lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb +2 -1
  31. data/lib/boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb +58 -0
  32. data/lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb +2 -1
  33. data/rubygem-boxgrinder-build.spec +25 -1
  34. data/spec/appliance-spec.rb +1 -58
  35. data/spec/helpers/linux-helper-spec.rb +70 -0
  36. data/spec/managers/plugin-manager-spec.rb +4 -13
  37. data/spec/plugins/delivery/ebs/ebs-plugin-spec.rb +6 -14
  38. data/spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb +5 -6
  39. data/spec/plugins/delivery/libvirt/libvirt-plugin-spec.rb +300 -0
  40. data/spec/plugins/delivery/libvirt/libvirt_modified.xml +25 -0
  41. data/spec/plugins/delivery/libvirt/libvirt_modify.sh +18 -0
  42. data/spec/plugins/delivery/libvirt/libvirt_test.xml +24 -0
  43. data/spec/plugins/delivery/local/local-plugin-spec.rb +3 -6
  44. data/spec/plugins/delivery/openstack/openstack-plugin-spec.rb +103 -0
  45. data/spec/plugins/delivery/s3/s3-plugin-spec.rb +16 -5
  46. data/spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb +2 -80
  47. data/spec/plugins/platform/ec2/ec2-plugin-spec.rb +15 -1
  48. data/spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb +6 -6
  49. data/spec/plugins/platform/virtualpc/virtualpc-plugin-spec.rb +90 -0
  50. data/spec/plugins/platform/vmware/vmware-plugin-spec.rb +5 -9
  51. data/spec/rspec-plugin-helper.rb +47 -0
  52. metadata +54 -10
@@ -49,9 +49,10 @@ module BoxGrinder
49
49
  @appliance_config.stub!(:os).and_return(OpenCascade.new({:name => 'fedora', :version => '14'}))
50
50
  @appliance_config.stub!(:hardware).and_return(OpenCascade.new({:arch => 'x86_64', :base_arch => 'x86_64'}))
51
51
 
52
- @plugin = S3Plugin.new
53
- @plugin.stub!(:asset_bucket)
54
- @plugin.init(@config, @appliance_config, {:class => BoxGrinder::S3Plugin, :type => :delivery, :name => :s3, :full_name => "Amazon Simple Storage Service (Amazon S3)", :types => [:s3, :cloudfront, :ami]}, :log => LogHelper.new(:level => :trace, :type => :stdout), :type => :s3)
52
+ @plugin = RSpecPluginHelper.new(S3Plugin).prepare(@config, @appliance_config,
53
+ :previous_plugin => OpenCascade.new(:type => :os, :deliverables => {:disk => "a_disk.raw", :metadata => 'metadata.xml'}),
54
+ :plugin_info => {:class => BoxGrinder::S3Plugin, :type => :delivery, :name => :s3, :full_name => "Amazon Simple Storage Service (Amazon S3)", :types => [:s3, :cloudfront, :ami]}
55
+ ) { |plugin| plugin.stub!(:asset_bucket) }
55
56
 
56
57
  #Set convenient dummies
57
58
  @ec2 = mock(AWS::EC2)
@@ -174,6 +175,14 @@ module BoxGrinder
174
175
  @plugin.bundle_image(:disk => "a/path/to/disk.ec2")
175
176
  end
176
177
 
178
+ it "should bundle image with user-selected ramdisk and kernel when set" do
179
+ @config.plugins['s3'].merge!('ramdisk' => '101010101', 'kernel' => '2020202')
180
+ File.should_receive(:exists?).with('build/path/s3-plugin/ami').and_return(false)
181
+ FileUtils.stub!(:mkdir_p)
182
+ @exec_helper.should_receive(:execute).with(/euca-bundle-image --ec2cert (.*)src\/cert-ec2\.pem -i a\/path\/to\/disk\.ec2 --kernel 2020202 -c \/path\/to\/cert\/file -k \/path\/to\/key\/file -u 000000000000 -r x86_64 -d build\/path\/s3-plugin\/ami --ramdisk 101010101/, :redacted=>["000000000000", "/path/to/key/file", "/path/to/cert/file"])
183
+ @plugin.bundle_image(:disk => "a/path/to/disk.ec2")
184
+ end
185
+
177
186
  describe ".execute" do
178
187
  before(:each) do
179
188
  @s3obj = mock(AWS::S3::S3Object)
@@ -249,6 +258,8 @@ module BoxGrinder
249
258
  @plugin.should_receive(:set_default_config_value).with('overwrite', false)
250
259
  @plugin.should_receive(:set_default_config_value).with('path', '/')
251
260
  @plugin.should_receive(:set_default_config_value).with('region', 'us-east-1')
261
+ @plugin.should_receive(:set_default_config_value).with('ramdisk', false)
262
+ @plugin.should_receive(:set_default_config_value).with('kernel', false)
252
263
  end
253
264
 
254
265
  it "should validate only basic params" do
@@ -316,7 +327,7 @@ module BoxGrinder
316
327
  it "should raise an error if an invalid region is specified" do
317
328
  @plugin.instance_variable_set(:@type, :ami)
318
329
 
319
- @config.plugins['s3']['region'] = 'near-spain-1'
330
+ @config.plugins['s3'].merge!('region' => 'near-spain-1')
320
331
 
321
332
  @plugin.should_receive(:set_default_config_value).with('snapshot', false)
322
333
 
@@ -330,7 +341,7 @@ module BoxGrinder
330
341
  File.should_receive(:expand_path).with('/path/to/key/file').and_return('path2')
331
342
  File.should_receive(:exists?).with('path2').and_return(true)
332
343
 
333
- lambda { @plugin.validate }.should raise_error(PluginValidationError, "Invalid region specified: near-spain-1. This plugin is only aware of the following regions: us-west-1, ap-southeast-1, eu-west-1, us-east-1, ap-northeast-1.")
344
+ lambda { @plugin.validate }.should raise_error(PluginValidationError, /Invalid region specified: near-spain-1.*/)
334
345
  end
335
346
  end
336
347
 
@@ -31,6 +31,7 @@ module BoxGrinder
31
31
  @config.stub!(:[]).with(:plugins).and_return(plugins)
32
32
  @config.stub!(:dir).and_return(OpenCascade.new(:tmp => 'tmpdir', :cache => 'cachedir'))
33
33
  @config.stub!(:os).and_return(OpenCascade.new(:name => 'fedora', :version => '14'))
34
+ @config.stub!(:os_config).and_return({})
34
35
 
35
36
  @appliance_config.stub!(:name).and_return('full')
36
37
  @appliance_config.stub!(:version).and_return(1)
@@ -41,11 +42,7 @@ module BoxGrinder
41
42
  @appliance_config.stub!(:path).and_return(OpenCascade.new(:build => 'build/path', :main => 'mainpath'))
42
43
  @appliance_config.stub!(:files).and_return({})
43
44
 
44
- @plugin = RPMBasedOSPlugin.new
45
-
46
- @plugin.stub!(:merge_plugin_config)
47
-
48
- @plugin.init(@config, @appliance_config, {:name => :rpm_based}, :log => LogHelper.new(:level => :trace, :type => :stdout))
45
+ @plugin = RSpecPluginHelper.new(RPMBasedOSPlugin).prepare(@config, @appliance_config, :plugin_info => {:class => BoxGrinder::RPMBasedOSPlugin, :type => :os, :name => :rpm_based})
49
46
 
50
47
  @config = @plugin.instance_variable_get(:@config)
51
48
  @appliance_config = @plugin.instance_variable_get(:@appliance_config)
@@ -81,81 +78,6 @@ module BoxGrinder
81
78
  @plugin.install_repos(guestfs)
82
79
  end
83
80
 
84
- it "should read kickstart definition file" do
85
- @plugin.should_receive(:read_kickstart).with('file.ks')
86
- @plugin.read_file('file.ks')
87
- end
88
-
89
- it "should read other definition file" do
90
- @plugin.should_not_receive(:read_kickstart)
91
- @plugin.read_file('file.other')
92
- end
93
-
94
- describe ".read_kickstart" do
95
- it "should read and parse valid kickstart file with bg comments" do
96
- appliance_config = @plugin.read_kickstart("#{File.dirname(__FILE__)}/src/jeos-f13.ks")
97
- appliance_config.should be_an_instance_of(ApplianceConfig)
98
- appliance_config.os.name.should == 'fedora'
99
- appliance_config.os.version.should == '13'
100
- end
101
-
102
- it "should raise while parsing kickstart file *without* bg comments" do
103
- lambda {
104
- @plugin.read_kickstart("#{File.dirname(__FILE__)}/src/jeos-f13-plain.ks")
105
- }.should raise_error("No operating system name specified, please add comment to you kickstrt file like this: # bg_os_name: fedora")
106
- end
107
-
108
- it "should raise while parsing kickstart file *without* bg version comment" do
109
- lambda {
110
- @plugin.read_kickstart("#{File.dirname(__FILE__)}/src/jeos-f13-without-version.ks")
111
- }.should raise_error("No operating system version specified, please add comment to you kickstrt file like this: # bg_os_version: 14")
112
- end
113
-
114
- it "should read kickstart and populate partitions" do
115
- appliance_config = @plugin.read_kickstart("#{File.dirname(__FILE__)}/src/jeos-f13.ks")
116
- appliance_config.should be_an_instance_of(ApplianceConfig)
117
- appliance_config.hardware.partitions.should == {'/' => {'size' => 2.0, 'type' => 'ext4'}, '/home' => {'size' => 3.0, 'type' => 'ext3', "options" => "abc,def,gef"}}
118
- end
119
-
120
- it "should read kickstart and populate partitions" do
121
- appliance_config = @plugin.read_kickstart("#{File.dirname(__FILE__)}/src/jeos-f13.ks")
122
- appliance_config.should be_an_instance_of(ApplianceConfig)
123
- appliance_config.hardware.partitions.should == {'/' => {'size' => 2.0, 'type' => 'ext4'}, '/home' => {'size' => 3.0, 'type' => 'ext3', "options" => "abc,def,gef"}}
124
- end
125
-
126
- it "should read kickstart and raise because of no partition size specified" do
127
- File.should_receive(:read).with("jeos-f13.ks").and_return("# bg_os_name: fedora\n# bg_os_version: 14\npart /")
128
-
129
- lambda {
130
- @plugin.read_kickstart("jeos-f13.ks")
131
- }.should raise_error("Partition size not specified for / partition in jeos-f13.ks")
132
- end
133
-
134
- it "should read kickstart and raise because no os name is specified" do
135
- File.should_receive(:read).with("jeos-f13.ks").and_return("")
136
-
137
- lambda {
138
- @plugin.read_kickstart("jeos-f13.ks")
139
- }.should raise_error("No operating system name specified, please add comment to you kickstrt file like this: # bg_os_name: fedora")
140
- end
141
-
142
- it "should read kickstart and raise because no os version is specified" do
143
- File.should_receive(:read).with("jeos-f13.ks").and_return("# bg_os_name: rhel")
144
-
145
- lambda {
146
- @plugin.read_kickstart("jeos-f13.ks")
147
- }.should raise_error("No operating system version specified, please add comment to you kickstrt file like this: # bg_os_version: 14")
148
- end
149
-
150
- it "should read kickstart and raise because no partitions are specified" do
151
- File.should_receive(:read).with("jeos-f13.ks").and_return("# bg_os_name: fedora\n# bg_os_version: 14")
152
-
153
- lambda {
154
- @plugin.read_kickstart("jeos-f13.ks")
155
- }.should raise_error("No partitions specified in your kickstart file jeos-f13.ks")
156
- end
157
- end
158
-
159
81
  describe ".use_labels_for_partitions" do
160
82
  it "should use labels for partitions instead of paths" do
161
83
  guestfs = mock("guestfs")
@@ -56,7 +56,10 @@ module BoxGrinder
56
56
  })
57
57
  )
58
58
 
59
- @plugin = EC2Plugin.new.init(@config, @appliance_config, {:class => BoxGrinder::EC2Plugin, :type => :platform, :name => :ec2, :full_name => "Amazon Elastic Compute Cloud (Amazon EC2)"}, :previous_plugin => OpenCascade.new(:deliverables => {:disk => 'a/disk.raw'}), :log => LogHelper.new(:level => :trace, :type => :stdout))
59
+ @plugin = RSpecPluginHelper.new(EC2Plugin).prepare(@config, @appliance_config,
60
+ :previous_plugin => OpenCascade.new(:deliverables => {:disk => 'a/disk.raw'}),
61
+ :plugin_info => {:class => BoxGrinder::EC2Plugin, :type => :platform, :name => :ec2, :full_name => "Amazon Elastic Compute Cloud (Amazon EC2)"}
62
+ )
60
63
 
61
64
  @config = @plugin.instance_variable_get(:@config)
62
65
  @appliance_config = @plugin.instance_variable_get(:@appliance_config)
@@ -218,12 +221,23 @@ module BoxGrinder
218
221
  it "should add ec2-user account" do
219
222
  guestfs = mock("guestfs")
220
223
 
224
+ guestfs.should_receive(:fgrep).with("ec2-user", "/etc/passwd").and_return([])
221
225
  guestfs.should_receive(:sh).with("useradd ec2-user")
222
226
  guestfs.should_receive(:sh).with("echo -e 'ec2-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers")
223
227
 
224
228
  @plugin.add_ec2_user(guestfs)
225
229
  end
226
230
 
231
+ it "should NOT add ec2-user account if it already exists" do
232
+ guestfs = mock("guestfs")
233
+
234
+ guestfs.should_receive(:fgrep).with("ec2-user", "/etc/passwd").and_return(['ec2-user'])
235
+ guestfs.should_not_receive(:sh).with("useradd ec2-user")
236
+ guestfs.should_not_receive(:sh).with("echo -e 'ec2-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers")
237
+
238
+ @plugin.add_ec2_user(guestfs)
239
+ end
240
+
227
241
  describe ".execute" do
228
242
  it "should convert the appliance to EC2 format" do
229
243
  linux_helper = mock(LinuxHelper)
@@ -20,6 +20,7 @@ require 'rubygems'
20
20
  require 'rspec'
21
21
  require 'boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin'
22
22
  require 'hashery/opencascade'
23
+ require 'spec/rspec-plugin-helper.rb'
23
24
 
24
25
  module BoxGrinder
25
26
  describe VirtualBoxPlugin do
@@ -27,6 +28,7 @@ module BoxGrinder
27
28
  @config = mock('Config')
28
29
  @config.stub!(:version).and_return('0.1.2')
29
30
  @config.stub!(:platform_config).and_return({})
31
+ @config.stub!(:[]).with(:plugins).and_return({})
30
32
 
31
33
  @appliance_config = mock('ApplianceConfig')
32
34
 
@@ -52,12 +54,10 @@ module BoxGrinder
52
54
  })
53
55
  )
54
56
 
55
- options[:log] = LogHelper.new(:level => :trace, :type => :stdout)
56
- options[:previous_plugin] = OpenCascade.new(:deliverables => {:disk => 'a/base/image/path.raw'})
57
- @plugin = VirtualBoxPlugin.new
58
-
59
- @plugin.should_receive(:read_plugin_config)
60
- @plugin.init(@config, @appliance_config, {:class => BoxGrinder::VirtualBoxPlugin, :type => :platform, :name => :virtualbox, :full_name => "VirtualBox"}, options)
57
+ @plugin = RSpecPluginHelper.new(VirtualBoxPlugin).prepare(@config, @appliance_config,
58
+ :previous_plugin => OpenCascade.new(:deliverables => {:disk => 'a/base/image/path.raw'}),
59
+ :plugin_info => {:class => BoxGrinder::VirtualBoxPlugin, :type => :platform, :name => :virtualbox, :full_name => "VirtualBox"}
60
+ )
61
61
 
62
62
  @exec_helper = @plugin.instance_variable_get(:@exec_helper)
63
63
  @image_helper = @plugin.instance_variable_get(:@image_helper)
@@ -0,0 +1,90 @@
1
+ #
2
+ # Copyright 2010 Red Hat, Inc.
3
+ #
4
+ # This is free software; you can redistribute it and/or modify it
5
+ # under the terms of the GNU Lesser General Public License as
6
+ # published by the Free Software Foundation; either version 3 of
7
+ # the License, or (at your option) any later version.
8
+ #
9
+ # This software is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this software; if not, write to the Free
16
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
18
+
19
+ require 'rubygems'
20
+ require 'boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb'
21
+
22
+ module BoxGrinder
23
+ describe VirtualPCPlugin do
24
+ def prepare_image(options = {})
25
+ @config = mock('Config')
26
+ @config.stub!(:platform_config).and_return({})
27
+ @config.stub!(:[]).with(:plugins).and_return({})
28
+
29
+ @appliance_config = mock('ApplianceConfig')
30
+
31
+ @appliance_config.stub!(:path).and_return(OpenCascade.new({:build => 'build/path'}))
32
+ @appliance_config.stub!(:name).and_return('full')
33
+ @appliance_config.stub!(:summary).and_return('asd')
34
+ @appliance_config.stub!(:version).and_return(1)
35
+ @appliance_config.stub!(:release).and_return(0)
36
+ @appliance_config.stub!(:os).and_return(OpenCascade.new({:name => 'fedora', :version => '16'}))
37
+ @appliance_config.stub!(:post).and_return(OpenCascade.new({:virtualpc => []}))
38
+
39
+ @appliance_config.stub!(:hardware).and_return(
40
+ OpenCascade.new({
41
+ :partitions =>
42
+ {
43
+ '/' => {'size' => 2},
44
+ '/home' => {'size' => 3},
45
+ },
46
+ :arch => 'i686',
47
+ :base_arch => 'i386',
48
+ :cpus => 1,
49
+ :memory => 256,
50
+ })
51
+ )
52
+
53
+ @plugin = RSpecPluginHelper.new(VirtualPCPlugin).prepare(@config, @appliance_config,
54
+ :previous_plugin => OpenCascade.new(:deliverables => {:disk => 'a/base/image/path.raw'}),
55
+ :plugin_info => {:class => BoxGrinder::VirtualPCPlugin, :type => :platform, :name => :virtualpc, :full_name => "VirtualPC"}
56
+ )
57
+
58
+ @exec_helper = @plugin.instance_variable_get(:@exec_helper)
59
+ @image_helper = @plugin.instance_variable_get(:@image_helper)
60
+ end
61
+
62
+ before(:each) do
63
+ prepare_image
64
+ end
65
+
66
+ describe ".execute" do
67
+ it "should convert an image to virtualpc format without post commands" do
68
+ @image_helper.should_not_receive(:customize)
69
+ @image_helper.should_receive(:convert_disk).with("a/base/image/path.raw", :vpc, "build/path/virtualpc-plugin/tmp/full.vhd")
70
+ @plugin.execute
71
+ end
72
+
73
+ it "should convert an image to virtualpc format with post commands" do
74
+ @appliance_config.post['virtualpc'] = ["one", "two", "three"]
75
+
76
+ guestfs_mock = mock("GuestFS")
77
+ guestfs_helper_mock = mock("GuestFSHelper")
78
+
79
+ @image_helper.should_receive(:customize).with("build/path/virtualpc-plugin/tmp/full.vhd").and_yield(guestfs_mock, guestfs_helper_mock)
80
+
81
+ guestfs_helper_mock.should_receive(:sh).once.ordered.with("one", :arch => 'i686')
82
+ guestfs_helper_mock.should_receive(:sh).once.ordered.with("two", :arch => 'i686')
83
+ guestfs_helper_mock.should_receive(:sh).once.ordered.with("three", :arch => 'i686')
84
+
85
+ @image_helper.should_receive(:convert_disk).with("a/base/image/path.raw", :vpc, "build/path/virtualpc-plugin/tmp/full.vhd")
86
+ @plugin.execute
87
+ end
88
+ end
89
+ end
90
+ end
@@ -27,6 +27,7 @@ module BoxGrinder
27
27
  @config = mock('Config')
28
28
  @config.stub!(:version).and_return('0.1.2')
29
29
  @config.stub!(:platform_config).and_return({})
30
+ @config.stub!(:[]).with(:plugins).and_return({'vmware' => plugin_config})
30
31
 
31
32
  @appliance_config = mock('ApplianceConfig')
32
33
 
@@ -52,15 +53,10 @@ module BoxGrinder
52
53
  })
53
54
  )
54
55
 
55
- options[:log] = Logger.new('/dev/null')
56
- options[:previous_plugin] = OpenCascade.new(:deliverables => {:disk => 'a/base/image/path.raw'})
57
- @plugin = VMwarePlugin.new
58
-
59
- @plugin.instance_variable_set(:@plugin_config, plugin_config)
60
- @plugin.should_receive(:read_plugin_config)
61
- @plugin.should_receive(:validate_plugin_config)
62
- @plugin.init(@config, @appliance_config, {:class => BoxGrinder::VMwarePlugin, :type => :platform, :name => :vmware, :full_name => "VMware"}, options)
63
- # @plugin.validate
56
+ @plugin = RSpecPluginHelper.new(VMwarePlugin).prepare(@config, @appliance_config,
57
+ :previous_plugin => OpenCascade.new(:deliverables => {:disk => 'a/base/image/path.raw'}),
58
+ :plugin_info => {:class => BoxGrinder::VMwarePlugin, :type => :platform, :name => :vmware, :full_name => "VMware"}
59
+ )
64
60
 
65
61
  @exec_helper = @plugin.instance_variable_get(:@exec_helper)
66
62
  @image_helper = @plugin.instance_variable_get(:@image_helper)
@@ -0,0 +1,47 @@
1
+ #
2
+ # Copyright 2010 Red Hat, Inc.
3
+ #
4
+ # This is free software; you can redistribute it and/or modify it
5
+ # under the terms of the GNU Lesser General Public License as
6
+ # published by the Free Software Foundation; either version 3 of
7
+ # the License, or (at your option) any later version.
8
+ #
9
+ # This software is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this software; if not, write to the Free
16
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
18
+
19
+ require 'boxgrinder-core/helpers/log-helper'
20
+
21
+ class RSpecPluginHelper
22
+ def initialize(clazz, options = {})
23
+ @options = { :skip => [] }.merge(options)
24
+ @clazz = clazz
25
+ end
26
+
27
+ def prepare(config, appliance_config, options = {})
28
+ options = {
29
+ :skip => [],
30
+ :log => BoxGrinder::LogHelper.new(:level => :trace, :type => :stdout)
31
+ }.merge(options)
32
+
33
+ config.stub!(:file).and_return('boxgrinder/configuration/file')
34
+
35
+ plugin = @clazz.new
36
+
37
+ yield plugin if block_given?
38
+
39
+ plugin.init(config, appliance_config, options[:plugin_info], options)
40
+
41
+ ([:after_init, :validate, :after_validate] - @options[:skip]).each do |callback|
42
+ plugin.send(callback) if plugin.respond_to?(callback)
43
+ end
44
+
45
+ plugin
46
+ end
47
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxgrinder-build
3
3
  version: !ruby/object:Gem::Version
4
- hash: 43
5
- prerelease: false
4
+ hash: 55
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
- - 9
9
- - 8
10
- version: 0.9.8
8
+ - 10
9
+ - 0
10
+ version: 0.10.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marek Goldmann
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-15 00:00:00 +01:00
19
- default_executable:
18
+ date: 2011-12-19 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: boxgrinder-core
@@ -106,6 +105,34 @@ dependencies:
106
105
  version: "0"
107
106
  type: :runtime
108
107
  version_requirements: *id006
108
+ - !ruby/object:Gem::Dependency
109
+ name: nokogiri
110
+ prerelease: false
111
+ requirement: &id007 !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ hash: 3
117
+ segments:
118
+ - 0
119
+ version: "0"
120
+ type: :runtime
121
+ version_requirements: *id007
122
+ - !ruby/object:Gem::Dependency
123
+ name: builder
124
+ prerelease: false
125
+ requirement: &id008 !ruby/object:Gem::Requirement
126
+ none: false
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ hash: 3
131
+ segments:
132
+ - 0
133
+ version: "0"
134
+ type: :runtime
135
+ version_requirements: *id008
109
136
  description: A tool for creating appliances from simple plain text files for various virtual environments.
110
137
  email: info@boxgrinder.org
111
138
  executables:
@@ -129,11 +156,15 @@ extra_rdoc_files:
129
156
  - lib/boxgrinder-build/helpers/plugin-helper.rb
130
157
  - lib/boxgrinder-build/helpers/qemu.wrapper
131
158
  - lib/boxgrinder-build/helpers/s3-helper.rb
159
+ - lib/boxgrinder-build/helpers/sftp-helper.rb
132
160
  - lib/boxgrinder-build/managers/plugin-manager.rb
133
161
  - lib/boxgrinder-build/plugins/base-plugin.rb
134
162
  - lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb
135
163
  - lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb
164
+ - lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb
165
+ - lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin.rb
136
166
  - lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb
167
+ - lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb
137
168
  - lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb
138
169
  - lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem
139
170
  - lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb
@@ -155,6 +186,7 @@ extra_rdoc_files:
155
186
  - lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst
156
187
  - lib/boxgrinder-build/plugins/platform/ec2/src/rc_local
157
188
  - lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb
189
+ - lib/boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb
158
190
  - lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise
159
191
  - lib/boxgrinder-build/plugins/platform/vmware/src/README-personal
160
192
  - lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk
@@ -167,10 +199,10 @@ files:
167
199
  - README.md
168
200
  - Rakefile
169
201
  - bin/boxgrinder-build
170
- - boxgrinder-build.gemspec
171
202
  - integ/appliances/gnome-fedora.appl
172
203
  - integ/appliances/jeos-centos5-files.appl
173
204
  - integ/appliances/jeos-centos5.appl
205
+ - integ/appliances/jeos-centos6.appl
174
206
  - integ/appliances/jeos-f15.appl
175
207
  - integ/appliances/jeos-f16-files.appl
176
208
  - integ/appliances/jeos-f16.appl
@@ -204,11 +236,15 @@ files:
204
236
  - lib/boxgrinder-build/helpers/plugin-helper.rb
205
237
  - lib/boxgrinder-build/helpers/qemu.wrapper
206
238
  - lib/boxgrinder-build/helpers/s3-helper.rb
239
+ - lib/boxgrinder-build/helpers/sftp-helper.rb
207
240
  - lib/boxgrinder-build/managers/plugin-manager.rb
208
241
  - lib/boxgrinder-build/plugins/base-plugin.rb
209
242
  - lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb
210
243
  - lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb
244
+ - lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb
245
+ - lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin.rb
211
246
  - lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb
247
+ - lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb
212
248
  - lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb
213
249
  - lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem
214
250
  - lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb
@@ -230,6 +266,7 @@ files:
230
266
  - lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst
231
267
  - lib/boxgrinder-build/plugins/platform/ec2/src/rc_local
232
268
  - lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb
269
+ - lib/boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb
233
270
  - lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise
234
271
  - lib/boxgrinder-build/plugins/platform/vmware/src/README-personal
235
272
  - lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk
@@ -250,7 +287,12 @@ files:
250
287
  - spec/plugins/delivery/ebs/ebs-plugin-spec.rb
251
288
  - spec/plugins/delivery/ebs/ebs.yaml
252
289
  - spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb
290
+ - spec/plugins/delivery/libvirt/libvirt-plugin-spec.rb
291
+ - spec/plugins/delivery/libvirt/libvirt_modified.xml
292
+ - spec/plugins/delivery/libvirt/libvirt_modify.sh
293
+ - spec/plugins/delivery/libvirt/libvirt_test.xml
253
294
  - spec/plugins/delivery/local/local-plugin-spec.rb
295
+ - spec/plugins/delivery/openstack/openstack-plugin-spec.rb
254
296
  - spec/plugins/delivery/s3/s3-plugin-spec.rb
255
297
  - spec/plugins/delivery/sftp/sftp-plugin-spec.rb
256
298
  - spec/plugins/os/centos/centos-plugin-spec.rb
@@ -265,8 +307,10 @@ files:
265
307
  - spec/plugins/os/sl/sl-plugin-spec.rb
266
308
  - spec/plugins/platform/ec2/ec2-plugin-spec.rb
267
309
  - spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb
310
+ - spec/plugins/platform/virtualpc/virtualpc-plugin-spec.rb
268
311
  - spec/plugins/platform/vmware/vmware-plugin-spec.rb
269
- has_rdoc: true
312
+ - spec/rspec-plugin-helper.rb
313
+ - boxgrinder-build.gemspec
270
314
  homepage: http://boxgrinder.org/
271
315
  licenses: []
272
316
 
@@ -302,7 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
346
  requirements: []
303
347
 
304
348
  rubyforge_project: BoxGrinder Build
305
- rubygems_version: 1.3.7
349
+ rubygems_version: 1.8.11
306
350
  signing_key:
307
351
  specification_version: 3
308
352
  summary: A tool for creating appliances from simple plain text files for various virtual environments.