boxgrinder-build 0.10.3 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Manifest +0 -1
- data/bin/boxgrinder-build +2 -2
- data/boxgrinder-build.gemspec +3 -3
- data/lib/boxgrinder-build/appliance.rb +1 -1
- data/lib/boxgrinder-build/plugins/base-plugin.rb +7 -7
- data/lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb +1 -1
- data/rubygem-boxgrinder-build.spec +6 -2
- data/spec/appliance-spec.rb +8 -8
- data/spec/helpers/guestfs-helper-spec.rb +11 -11
- data/spec/helpers/image-helper-spec.rb +3 -3
- data/spec/plugins/base-plugin-spec.rb +3 -3
- data/spec/plugins/delivery/ebs/ebs-plugin-spec.rb +4 -4
- data/spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb +10 -10
- data/spec/plugins/delivery/libvirt/libvirt-plugin-spec.rb +4 -4
- data/spec/plugins/delivery/local/local-plugin-spec.rb +5 -5
- data/spec/plugins/delivery/openstack/openstack-plugin-spec.rb +4 -4
- data/spec/plugins/delivery/s3/s3-plugin-spec.rb +6 -6
- data/spec/plugins/os/centos/centos-plugin-spec.rb +2 -2
- data/spec/plugins/os/fedora/fedora-plugin-spec.rb +8 -8
- data/spec/plugins/os/rhel/rhel-plugin-spec.rb +7 -7
- data/spec/plugins/os/rpm-based/kickstart-spec.rb +5 -5
- data/spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb +8 -8
- data/spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb +5 -5
- data/spec/plugins/os/sl/sl-plugin-spec.rb +2 -2
- data/spec/plugins/platform/ec2/ec2-plugin-spec.rb +10 -10
- data/spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb +10 -10
- data/spec/plugins/platform/virtualpc/virtualpc-plugin-spec.rb +5 -5
- data/spec/plugins/platform/vmware/vmware-plugin-spec.rb +6 -6
- metadata +3 -3
data/CHANGELOG
CHANGED
data/Manifest
CHANGED
data/bin/boxgrinder-build
CHANGED
@@ -21,7 +21,7 @@ require 'optparse'
|
|
21
21
|
require 'rubygems'
|
22
22
|
require 'pathname'
|
23
23
|
require 'rbconfig'
|
24
|
-
require '
|
24
|
+
require 'boxgrinder-core/astruct'
|
25
25
|
require 'boxgrinder-core'
|
26
26
|
require 'boxgrinder-core/models/config'
|
27
27
|
require 'boxgrinder-core/helpers/log-helper'
|
@@ -30,7 +30,7 @@ require 'boxgrinder-build/appliance'
|
|
30
30
|
require 'boxgrinder-build/util/permissions/fs-observer'
|
31
31
|
require 'boxgrinder-build/util/permissions/fs-monitor'
|
32
32
|
|
33
|
-
options =
|
33
|
+
options = BoxGrinder::AStruct.new(
|
34
34
|
:platform => :none,
|
35
35
|
:delivery => :none,
|
36
36
|
:os_config => {},
|
data/boxgrinder-build.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "boxgrinder-build"
|
5
|
-
s.version = "0.10.
|
5
|
+
s.version = "0.10.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Marek Goldmann"]
|
9
|
-
s.date = "2012-
|
9
|
+
s.date = "2012-09-04"
|
10
10
|
s.description = "A tool for creating appliances from simple plain text files for various virtual environments."
|
11
11
|
s.email = "info@boxgrinder.org"
|
12
12
|
s.executables = ["boxgrinder-build"]
|
13
13
|
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.md", "bin/boxgrinder-build", "lib/boxgrinder-build.rb", "lib/boxgrinder-build/appliance.rb", "lib/boxgrinder-build/helpers/augeas-helper.rb", "lib/boxgrinder-build/helpers/aws-helper.rb", "lib/boxgrinder-build/helpers/banner-helper.rb", "lib/boxgrinder-build/helpers/ec2-helper.rb", "lib/boxgrinder-build/helpers/guestfs-helper.rb", "lib/boxgrinder-build/helpers/image-helper.rb", "lib/boxgrinder-build/helpers/linux-helper.rb", "lib/boxgrinder-build/helpers/package-helper.rb", "lib/boxgrinder-build/helpers/plugin-helper.rb", "lib/boxgrinder-build/helpers/qemu.wrapper", "lib/boxgrinder-build/helpers/s3-helper.rb", "lib/boxgrinder-build/helpers/sftp-helper.rb", "lib/boxgrinder-build/managers/plugin-manager.rb", "lib/boxgrinder-build/plugins/base-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/messages.rb", "lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb", "lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb", "lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin.rb", "lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb", "lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/messages.rb", "lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem", "lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb", "lib/boxgrinder-build/plugins/delivery/usb/usb-plugin.rb", "lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb", "lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb", "lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb", "lib/boxgrinder-build/plugins/os/rpm-based/src/appliance.ks.erb", "lib/boxgrinder-build/plugins/os/rpm-based/src/base.repo", "lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init", "lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_32bit", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_64bit", "lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0", "lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst", "lib/boxgrinder-build/plugins/platform/ec2/src/rc_local", "lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb", "lib/boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb", "lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise", "lib/boxgrinder-build/plugins/platform/vmware/src/README-personal", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx", "lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb", "lib/boxgrinder-build/util/concurrent/get_set.rb", "lib/boxgrinder-build/util/permissions/fs-monitor.rb", "lib/boxgrinder-build/util/permissions/fs-observer.rb", "lib/boxgrinder-build/util/permissions/user-switcher.rb"]
|
14
|
-
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.md", "Rakefile", "bash_completion", "bin/boxgrinder-build", "
|
14
|
+
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.md", "Rakefile", "bash_completion", "bin/boxgrinder-build", "integ/appliances/gnome-fedora.appl", "integ/appliances/jeos-centos5-files.appl", "integ/appliances/jeos-centos5.appl", "integ/appliances/jeos-centos6.appl", "integ/appliances/jeos-f15.appl", "integ/appliances/jeos-f16-files.appl", "integ/appliances/jeos-f16.appl", "integ/appliances/modular/_hardware_cpus.appl", "integ/appliances/modular/_hardware_memory.appl", "integ/appliances/modular/_hardware_partitions_home.appl", "integ/appliances/modular/_hardware_partitions_root.appl", "integ/appliances/modular/_os_password.appl", "integ/appliances/modular/_packages_groups_base.appl", "integ/appliances/modular/_packages_groups_core.appl", "integ/appliances/modular/_packages_squid.appl", "integ/appliances/modular/_packages_utils.appl", "integ/appliances/modular/_repos_boxgrinder_permanent_noarch.appl", "integ/appliances/modular/_repos_testlocal_ephemeral_noarch.appl", "integ/appliances/modular/_test_base.appl", "integ/appliances/modular/modular.appl", "integ/packages/ephemeral-repo-test-0.1-1.noarch.rpm", "integ/packages/local-repo-test.spec", "integ/spec/files-spec.rb", "integ/spec/jeos-spec.rb", "integ/spec/modular-spec.rb", "lib/boxgrinder-build.rb", "lib/boxgrinder-build/appliance.rb", "lib/boxgrinder-build/helpers/augeas-helper.rb", "lib/boxgrinder-build/helpers/aws-helper.rb", "lib/boxgrinder-build/helpers/banner-helper.rb", "lib/boxgrinder-build/helpers/ec2-helper.rb", "lib/boxgrinder-build/helpers/guestfs-helper.rb", "lib/boxgrinder-build/helpers/image-helper.rb", "lib/boxgrinder-build/helpers/linux-helper.rb", "lib/boxgrinder-build/helpers/package-helper.rb", "lib/boxgrinder-build/helpers/plugin-helper.rb", "lib/boxgrinder-build/helpers/qemu.wrapper", "lib/boxgrinder-build/helpers/s3-helper.rb", "lib/boxgrinder-build/helpers/sftp-helper.rb", "lib/boxgrinder-build/managers/plugin-manager.rb", "lib/boxgrinder-build/plugins/base-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/messages.rb", "lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb", "lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb", "lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin.rb", "lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb", "lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/messages.rb", "lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem", "lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb", "lib/boxgrinder-build/plugins/delivery/usb/usb-plugin.rb", "lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb", "lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb", "lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb", "lib/boxgrinder-build/plugins/os/rpm-based/src/appliance.ks.erb", "lib/boxgrinder-build/plugins/os/rpm-based/src/base.repo", "lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init", "lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_32bit", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_64bit", "lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0", "lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst", "lib/boxgrinder-build/plugins/platform/ec2/src/rc_local", "lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb", "lib/boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb", "lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise", "lib/boxgrinder-build/plugins/platform/vmware/src/README-personal", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx", "lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb", "lib/boxgrinder-build/util/concurrent/get_set.rb", "lib/boxgrinder-build/util/permissions/fs-monitor.rb", "lib/boxgrinder-build/util/permissions/fs-observer.rb", "lib/boxgrinder-build/util/permissions/user-switcher.rb", "rubygem-boxgrinder-build.spec", "spec/appliance-spec.rb", "spec/helpers/augeas-helper-spec.rb", "spec/helpers/ec2-helper-spec.rb", "spec/helpers/guestfs-helper-spec.rb", "spec/helpers/image-helper-spec.rb", "spec/helpers/linux-helper-spec.rb", "spec/helpers/package-helper-spec.rb", "spec/helpers/plugin-helper-spec.rb", "spec/helpers/s3-helper-spec.rb", "spec/managers/plugin-manager-spec.rb", "spec/plugins/base-plugin-spec.rb", "spec/plugins/delivery/ebs/ebs-plugin-spec.rb", "spec/plugins/delivery/ebs/ebs.yaml", "spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb", "spec/plugins/delivery/libvirt/libvirt-plugin-spec.rb", "spec/plugins/delivery/libvirt/libvirt_modified.xml", "spec/plugins/delivery/libvirt/libvirt_modify.sh", "spec/plugins/delivery/libvirt/libvirt_test.xml", "spec/plugins/delivery/local/local-plugin-spec.rb", "spec/plugins/delivery/openstack/openstack-plugin-spec.rb", "spec/plugins/delivery/s3/s3-plugin-spec.rb", "spec/plugins/delivery/sftp/sftp-plugin-spec.rb", "spec/plugins/os/centos/centos-plugin-spec.rb", "spec/plugins/os/fedora/fedora-plugin-spec.rb", "spec/plugins/os/rhel/rhel-plugin-spec.rb", "spec/plugins/os/rpm-based/kickstart-spec.rb", "spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb", "spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb", "spec/plugins/os/rpm-based/src/jeos-f13-plain.ks", "spec/plugins/os/rpm-based/src/jeos-f13-without-version.ks", "spec/plugins/os/rpm-based/src/jeos-f13.ks", "spec/plugins/os/sl/sl-plugin-spec.rb", "spec/plugins/platform/ec2/ec2-plugin-spec.rb", "spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb", "spec/plugins/platform/virtualpc/virtualpc-plugin-spec.rb", "spec/plugins/platform/vmware/vmware-plugin-spec.rb", "spec/rcov_helper.rb", "spec/rspec-plugin-helper.rb", "spec/spec_helper.rb", "spec/util/concurrent/get-set-spec.rb", "spec/util/permissions/fs-monitor-spec.rb", "spec/util/permissions/fs-observer-spec.rb", "spec/util/permissions/user-switcher-spec.rb", "boxgrinder-build.gemspec"]
|
15
15
|
s.homepage = "http://boxgrinder.org/"
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Boxgrinder-build", "--main", "README.md"]
|
17
17
|
s.require_paths = ["lib"]
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'rubygems'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
require 'boxgrinder-core/helpers/log-helper'
|
22
22
|
require 'boxgrinder-core/models/appliance-config'
|
23
23
|
require 'boxgrinder-core/models/config'
|
@@ -23,7 +23,7 @@ require 'boxgrinder-core/errors'
|
|
23
23
|
require 'boxgrinder-build/helpers/image-helper'
|
24
24
|
require 'boxgrinder-build/managers/plugin-manager'
|
25
25
|
require 'ostruct'
|
26
|
-
require '
|
26
|
+
require 'boxgrinder-core/astruct'
|
27
27
|
require 'fileutils'
|
28
28
|
require 'logger'
|
29
29
|
|
@@ -37,11 +37,11 @@ module BoxGrinder
|
|
37
37
|
def initialize
|
38
38
|
@plugin_config = {}
|
39
39
|
|
40
|
-
@deliverables =
|
41
|
-
@supported_oses =
|
40
|
+
@deliverables = AStruct.new
|
41
|
+
@supported_oses = AStruct.new
|
42
42
|
@supported_platforms = []
|
43
|
-
@target_deliverables =
|
44
|
-
@dir =
|
43
|
+
@target_deliverables = AStruct.new
|
44
|
+
@dir = AStruct.new
|
45
45
|
end
|
46
46
|
|
47
47
|
def init(config, appliance_config, info, options = {})
|
@@ -64,7 +64,7 @@ module BoxGrinder
|
|
64
64
|
@previous_deliverables = @previous_plugin.deliverables
|
65
65
|
@previous_plugin_info = @previous_plugin.plugin_info
|
66
66
|
else
|
67
|
-
@previous_deliverables =
|
67
|
+
@previous_deliverables = AStruct.new
|
68
68
|
end
|
69
69
|
|
70
70
|
# TODO get rid of that - we don't have plugin configuration files - everything is now in one place.
|
@@ -103,7 +103,7 @@ module BoxGrinder
|
|
103
103
|
def register_supported_os(name, versions)
|
104
104
|
raise "You can register supported operating system only after the plugin is initialized, please initialize the plugin using init method." if @initialized.nil?
|
105
105
|
|
106
|
-
@supported_oses[name] =
|
106
|
+
@supported_oses[name] = AStruct.new if @supported_oses[name].nil?
|
107
107
|
@supported_oses[name] = versions
|
108
108
|
end
|
109
109
|
|
@@ -32,7 +32,7 @@ module BoxGrinder
|
|
32
32
|
|
33
33
|
build_virtualbox
|
34
34
|
|
35
|
-
if is_os_old? or !@appliance_config.post['virtualbox'].
|
35
|
+
if is_os_old? or !@appliance_config.post['virtualbox'].empty?
|
36
36
|
@image_helper.customize([@deliverables.disk]) do |guestfs, guestfs_helper|
|
37
37
|
recreate_kernel(guestfs) if is_os_old?
|
38
38
|
customize(guestfs_helper) unless @appliance_config.post['virtualbox'].nil?
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
Summary: A tool for creating appliances from simple plain text files
|
13
13
|
Name: rubygem-%{gem_name}
|
14
|
-
Version: 0.10.
|
14
|
+
Version: 0.10.4
|
15
15
|
Release: 1%{?dist}
|
16
16
|
Group: Development/Languages
|
17
17
|
License: LGPLv3+
|
@@ -19,7 +19,7 @@ URL: http://boxgrinder.org/
|
|
19
19
|
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
|
20
20
|
|
21
21
|
Requires: ruby(abi) = %{rubyabi}
|
22
|
-
Requires: rubygem(boxgrinder-core) >= 0.3.
|
22
|
+
Requires: rubygem(boxgrinder-core) >= 0.3.14
|
23
23
|
Requires: rubygem(boxgrinder-core) < 0.4.0
|
24
24
|
Requires: ruby-libguestfs
|
25
25
|
|
@@ -153,6 +153,10 @@ popd
|
|
153
153
|
%{gem_docdir}
|
154
154
|
|
155
155
|
%changelog
|
156
|
+
* Tue Sep 4 2012 Marc Savy <msavy@redhat.com> - 0.10.4
|
157
|
+
- Upstream release: 0.10.4
|
158
|
+
- [BGBUILD-373] Remove hashery dependency
|
159
|
+
|
156
160
|
* Mon Jun 18 2012 Marc Savy <msavy@redhat.com> - 0.10.3
|
157
161
|
- Upstream release: 0.10.3
|
158
162
|
- [BGBUILD-339] Existing rpm package with the name containing '+' considered as an invalid name
|
data/spec/appliance-spec.rb
CHANGED
@@ -24,7 +24,7 @@ module BoxGrinder
|
|
24
24
|
describe Appliance do
|
25
25
|
def prepare_appliance(options = {}, definition_file = "#{File.dirname(__FILE__)}/rspec/src/appliances/jeos-f13.appl")
|
26
26
|
@log = LogHelper.new(:level => :trace, :type => :stdout)
|
27
|
-
@config =
|
27
|
+
@config = AStruct.new(:platform => :none, :delivery => :none, :force => false,
|
28
28
|
:change_to_user => false, :uid => 501, :gid => 501,
|
29
29
|
:dir => {:root => '/', :build => 'build'}).merge(options)
|
30
30
|
|
@@ -39,15 +39,15 @@ module BoxGrinder
|
|
39
39
|
def prepare_appliance_config
|
40
40
|
@appliance_config = mock('ApplianceConfig')
|
41
41
|
|
42
|
-
@appliance_config.stub!(:path).and_return(
|
42
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
43
43
|
@appliance_config.stub!(:name).and_return('full')
|
44
44
|
@appliance_config.stub!(:summary).and_return('asd')
|
45
45
|
@appliance_config.stub!(:version).and_return(1)
|
46
46
|
@appliance_config.stub!(:release).and_return(0)
|
47
|
-
@appliance_config.stub!(:os).and_return(
|
47
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '11'}))
|
48
48
|
|
49
49
|
@appliance_config.stub!(:hardware).and_return(
|
50
|
-
|
50
|
+
AStruct.new({
|
51
51
|
:partitions =>
|
52
52
|
{
|
53
53
|
'/' => {'size' => 2},
|
@@ -64,7 +64,7 @@ module BoxGrinder
|
|
64
64
|
end
|
65
65
|
|
66
66
|
it "should create @config object without log" do
|
67
|
-
config = Appliance.new("file",
|
67
|
+
config = Appliance.new("file", AStruct.new(:platform => :ec2), :log => "ALOG").instance_variable_get(:@config)
|
68
68
|
|
69
69
|
config.size.should == 1
|
70
70
|
config[:log].should == nil
|
@@ -77,14 +77,14 @@ module BoxGrinder
|
|
77
77
|
end
|
78
78
|
|
79
79
|
it "should raise if we use unsupported OS" do
|
80
|
-
PluginManager.stub(:instance).and_return(
|
80
|
+
PluginManager.stub(:instance).and_return(AStruct.new(:plugins => {:os => {:centos => {}}}))
|
81
81
|
lambda {
|
82
82
|
@appliance.validate_definition
|
83
83
|
}.should raise_error(RuntimeError, "Unsupported operating system selected: fedora. Make sure you have installed right operating system plugin, see http://boxgrinder.org/tutorials/boxgrinder-build-plugins/#Operating_system_plugins. Supported OSes are: centos")
|
84
84
|
end
|
85
85
|
|
86
86
|
it "should NOT raise if we use supported OS" do
|
87
|
-
PluginManager.stub(:instance).and_return(
|
87
|
+
PluginManager.stub(:instance).and_return(AStruct.new(:plugins => {:os => {:fedora => {:versions => ['11']}}}))
|
88
88
|
@appliance.validate_definition
|
89
89
|
end
|
90
90
|
end
|
@@ -236,7 +236,7 @@ module BoxGrinder
|
|
236
236
|
let(:platform_plugin_info_mock){ mock('platform_plugin_info_mock', :[] => 'plat').as_null_object }
|
237
237
|
let(:delivery_plugin_info_mock){ mock('delivery_plugin_info_mock', :[] => 'deliver').as_null_object }
|
238
238
|
|
239
|
-
let(:platform_plugin){ mock("PlatformPlugin", :deliverables =>
|
239
|
+
let(:platform_plugin){ mock("PlatformPlugin", :deliverables => AStruct.new(:disk => 'a/disk.vmdk')) }
|
240
240
|
let(:delivery_plugin){ mock("DeliveryPlugin", :deliverables => {}) }
|
241
241
|
|
242
242
|
it "should prepare the plugin chain to create an appliance and convert it to VMware format" do
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/helpers/guestfs-helper'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
|
22
22
|
module BoxGrinder
|
23
23
|
describe GuestFSHelper do
|
@@ -29,7 +29,7 @@ module BoxGrinder
|
|
29
29
|
@appliance_config.stub!(:hardware).and_return(:partitions => {})
|
30
30
|
|
31
31
|
@config = mock('Config')
|
32
|
-
@config.stub!(:dir).and_return(
|
32
|
+
@config.stub!(:dir).and_return(AStruct.new(:tmp => '/tmp'))
|
33
33
|
|
34
34
|
@helper = GuestFSHelper.new('a/raw/disk', @appliance_config, @config, :log => @log)
|
35
35
|
end
|
@@ -154,7 +154,7 @@ module BoxGrinder
|
|
154
154
|
end
|
155
155
|
|
156
156
|
it "should run guestfs with two partitions" do
|
157
|
-
@appliance_config.stub!(:hardware).and_return(
|
157
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:partitions => {'/' => nil, '/home' => nil}))
|
158
158
|
|
159
159
|
guestfs = mock('Guestfs')
|
160
160
|
@helper.instance_variable_set(:@guestfs, guestfs)
|
@@ -170,7 +170,7 @@ module BoxGrinder
|
|
170
170
|
end
|
171
171
|
|
172
172
|
it "should run guestfs with no partitions and don't load selinux" do
|
173
|
-
@appliance_config.stub!(:hardware).and_return(
|
173
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:partitions => {'/' => nil, '/home' => nil}))
|
174
174
|
|
175
175
|
guestfs = mock('Guestfs')
|
176
176
|
@helper.instance_variable_set(:@guestfs, guestfs)
|
@@ -224,7 +224,7 @@ module BoxGrinder
|
|
224
224
|
it "should mount two partitions" do
|
225
225
|
guestfs = mock('Guestfs')
|
226
226
|
|
227
|
-
@appliance_config.stub!(:hardware).and_return(
|
227
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:partitions => {'/' => nil, '/home' => nil}))
|
228
228
|
guestfs.should_receive(:list_partitions).and_return(['/dev/vda1', '/dev/vda2'])
|
229
229
|
guestfs.should_receive(:vfs_type).with('/dev/vda1').twice.and_return('ext3')
|
230
230
|
guestfs.should_receive(:vfs_type).with('/dev/vda2').twice.and_return('ext3')
|
@@ -239,7 +239,7 @@ module BoxGrinder
|
|
239
239
|
it "should mount partitions skiping partitions with undefined filesystem type" do
|
240
240
|
guestfs = mock('Guestfs')
|
241
241
|
|
242
|
-
@appliance_config.stub!(:hardware).and_return(
|
242
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:partitions => {'/' => nil}))
|
243
243
|
guestfs.should_receive(:list_partitions).and_return(['/dev/vda1', '/dev/vda2'])
|
244
244
|
guestfs.should_receive(:vfs_type).with('/dev/vda1').and_return('')
|
245
245
|
guestfs.should_receive(:vfs_type).with('/dev/vda2').twice.and_return('ext3')
|
@@ -253,7 +253,7 @@ module BoxGrinder
|
|
253
253
|
it "should mount two partitions from three where one is a swap partition" do
|
254
254
|
guestfs = mock('Guestfs')
|
255
255
|
|
256
|
-
@appliance_config.stub!(:hardware).and_return(
|
256
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:partitions => {'/' => nil, '/home' => nil, 'swap' => nil}))
|
257
257
|
guestfs.should_receive(:list_partitions).and_return(['/dev/vda1', '/dev/vda2', '/dev/vda3'])
|
258
258
|
guestfs.should_receive(:vfs_type).with('/dev/vda1').twice.and_return('ext3')
|
259
259
|
guestfs.should_receive(:vfs_type).with('/dev/vda2').twice.and_return('ext3')
|
@@ -269,7 +269,7 @@ module BoxGrinder
|
|
269
269
|
it "should mount partitions with extended partitions" do
|
270
270
|
guestfs = mock('Guestfs')
|
271
271
|
|
272
|
-
@appliance_config.stub!(:hardware).and_return(
|
272
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:partitions => {'/' => nil, '/home' => nil, '/var/www' => nil, '/var/mock' => nil}))
|
273
273
|
guestfs.should_receive(:list_partitions).and_return(['/dev/vda1', '/dev/vda2', '/dev/vda3', '/dev/vda4', '/dev/vda5'])
|
274
274
|
guestfs.should_receive(:vfs_type).with('/dev/vda1').twice.and_return('ext3')
|
275
275
|
guestfs.should_receive(:vfs_type).with('/dev/vda2').twice.and_return('ext3')
|
@@ -309,21 +309,21 @@ module BoxGrinder
|
|
309
309
|
describe ".hw_virtualization_available?" do
|
310
310
|
it "should return true if HW acceleration is available" do
|
311
311
|
URI.should_receive(:parse).with('http://169.254.169.254/latest/meta-data/ami-id').and_return('parsed')
|
312
|
-
Net::HTTP.should_receive(:get_response).with("parsed").and_return(
|
312
|
+
Net::HTTP.should_receive(:get_response).with("parsed").and_return(AStruct.new(:code => '404'))
|
313
313
|
@helper.should_receive(:`).with("egrep '^flags.*(vmx|svm)' /proc/cpuinfo | wc -l").and_return("2")
|
314
314
|
@helper.hw_virtualization_available?.should == true
|
315
315
|
end
|
316
316
|
|
317
317
|
it "should return false if no vmx flag is present" do
|
318
318
|
URI.should_receive(:parse).with('http://169.254.169.254/latest/meta-data/ami-id').and_return('parsed')
|
319
|
-
Net::HTTP.should_receive(:get_response).with("parsed").and_return(
|
319
|
+
Net::HTTP.should_receive(:get_response).with("parsed").and_return(AStruct.new(:code => '404'))
|
320
320
|
@helper.should_receive(:`).with("egrep '^flags.*(vmx|svm)' /proc/cpuinfo | wc -l").and_return("0")
|
321
321
|
@helper.hw_virtualization_available?.should == false
|
322
322
|
end
|
323
323
|
|
324
324
|
it "should return false if we're on EC2" do
|
325
325
|
URI.should_receive(:parse).with('http://169.254.169.254/latest/meta-data/ami-id').and_return('parsed')
|
326
|
-
Net::HTTP.should_receive(:get_response).with("parsed").and_return(
|
326
|
+
Net::HTTP.should_receive(:get_response).with("parsed").and_return(AStruct.new(:code => '200'))
|
327
327
|
@helper.should_receive(:`).with("egrep '^flags.*(vmx|svm)' /proc/cpuinfo | wc -l").and_return("0")
|
328
328
|
@helper.hw_virtualization_available?.should == false
|
329
329
|
end
|
@@ -27,9 +27,9 @@ module BoxGrinder
|
|
27
27
|
@appliance_config = mock('ApplianceConfig')
|
28
28
|
|
29
29
|
@appliance_config.stub!(:name).and_return('full')
|
30
|
-
@appliance_config.stub!(:os).and_return(
|
30
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '14'}))
|
31
31
|
@appliance_config.stub!(:hardware).and_return(
|
32
|
-
|
32
|
+
AStruct.new({
|
33
33
|
:partitions =>
|
34
34
|
{
|
35
35
|
'/' => {'size' => 2, 'type' => 'ext4'},
|
@@ -66,7 +66,7 @@ module BoxGrinder
|
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should customize the disk image using GuestFS and selectind ide_disk option for RHEL/CentOS 5" do
|
69
|
-
@appliance_config.stub!(:os).and_return(
|
69
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'rhel', :version => '5'}))
|
70
70
|
|
71
71
|
guestfs = mock('GuestFS')
|
72
72
|
guestfs.should_receive(:abc)
|
@@ -35,8 +35,8 @@ module BoxGrinder
|
|
35
35
|
|
36
36
|
@appliance_config = mock('ApplianceConfig')
|
37
37
|
|
38
|
-
@appliance_config.stub!(:path).and_return(
|
39
|
-
@appliance_config.stub!(:os).and_return(
|
38
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
39
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '13'}))
|
40
40
|
|
41
41
|
@log = LogHelper.new(:level => :trace, :type => :stdout)
|
42
42
|
|
@@ -125,7 +125,7 @@ module BoxGrinder
|
|
125
125
|
|
126
126
|
it "should fail if OS is not supported" do
|
127
127
|
@plugin.register_supported_os('fedora', ['12', '13'])
|
128
|
-
@appliance_config.stub!(:os).and_return(
|
128
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '14'}))
|
129
129
|
lambda { @plugin.run }.should raise_error(PluginValidationError, 'Amazon Simple Storage Service (Amazon S3) plugin supports following operating systems: fedora (versions: 12, 13). Your appliance contains fedora 14 operating system which is not supported by this plugin, sorry.')
|
130
130
|
end
|
131
131
|
|
@@ -40,12 +40,12 @@ module BoxGrinder
|
|
40
40
|
@appliance_config.stub!(:name).and_return('appliance_name')
|
41
41
|
@appliance_config.stub!(:version).and_return(1)
|
42
42
|
@appliance_config.stub!(:release).and_return(0)
|
43
|
-
@appliance_config.stub!(:os).and_return(
|
44
|
-
@appliance_config.stub!(:hardware).and_return(
|
45
|
-
@appliance_config.stub!(:path).and_return(
|
43
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '14'}))
|
44
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new({:arch => 'x86_64', :base_arch => 'x86_64'}))
|
45
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => '/a/build/path'}))
|
46
46
|
|
47
47
|
@plugin = RSpecPluginHelper.new(EBSPlugin, :skip => [:validate]).prepare(@config, @appliance_config,
|
48
|
-
:previous_plugin =>
|
48
|
+
:previous_plugin => AStruct.new(:type => :os, :deliverables => {:disk => "a_disk.raw", :metadata => 'metadata.xml'}),
|
49
49
|
:plugin_info => {:class => BoxGrinder::EBSPlugin, :type => :delivery, :name => :ebs, :full_name => "Elastic Block Storage"}
|
50
50
|
) { |plugin| yield plugin if block_given? }
|
51
51
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
|
-
require '
|
19
|
+
require 'boxgrinder-core/astruct'
|
20
20
|
require 'boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin'
|
21
21
|
|
22
22
|
module BoxGrinder
|
@@ -34,16 +34,16 @@ module BoxGrinder
|
|
34
34
|
|
35
35
|
@appliance_config = mock('ApplianceConfig')
|
36
36
|
|
37
|
-
@appliance_config.stub!(:path).and_return(
|
37
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
38
38
|
@appliance_config.stub!(:name).and_return('appliance')
|
39
39
|
@appliance_config.stub!(:version).and_return(1)
|
40
40
|
@appliance_config.stub!(:cpus).and_return(1)
|
41
41
|
@appliance_config.stub!(:release).and_return(0)
|
42
|
-
@appliance_config.stub!(:os).and_return(
|
43
|
-
@appliance_config.stub!(:hardware).and_return(
|
42
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => :fedora, :version => '13'}))
|
43
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:cpus => 1, :arch => 'x86_64', :partitions => {'/' => {'size' => 1}, '/home' => {'size' => 2}}, :memory => 512))
|
44
44
|
|
45
45
|
options = {
|
46
|
-
:previous_plugin =>
|
46
|
+
:previous_plugin => AStruct.new(:plugin_info => {:type => :os}, :deliverables => {:disk => 'a/base/image/path.raw'}),
|
47
47
|
:plugin_info => {:class => BoxGrinder::ElasticHostsPlugin, :type => :delivery, :name => :elastichosts, :full_name => "ElasticHosts"}
|
48
48
|
}.merge(options)
|
49
49
|
|
@@ -59,7 +59,7 @@ module BoxGrinder
|
|
59
59
|
describe ".validate" do
|
60
60
|
it "should fail because we try to upload a non-base appliance" do
|
61
61
|
lambda {
|
62
|
-
prepare(:previous_plugin =>
|
62
|
+
prepare(:previous_plugin => AStruct.new(:plugin_info => {:type => :platform}))
|
63
63
|
}.should raise_error(PluginValidationError, 'You can use ElasticHosts plugin with base appliances (appliances created with operating system plugins) only, see http://boxgrinder.org/tutorials/boxgrinder-build-plugins/#ElasticHosts_Delivery_Plugin.')
|
64
64
|
end
|
65
65
|
end
|
@@ -163,7 +163,7 @@ module BoxGrinder
|
|
163
163
|
|
164
164
|
describe ".upload_chunks" do
|
165
165
|
it "should upload chunks in 2 parts" do
|
166
|
-
@plugin.instance_variable_set(:@previous_deliverables,
|
166
|
+
@plugin.instance_variable_set(:@previous_deliverables, AStruct.new({:disk => 'a/disk'}))
|
167
167
|
|
168
168
|
f = mock(File)
|
169
169
|
f.should_receive(:eof?).ordered.and_return(false)
|
@@ -188,7 +188,7 @@ module BoxGrinder
|
|
188
188
|
|
189
189
|
it "should upload 1 chunk with custom chunk size" do
|
190
190
|
@plugin_config.merge!('chunk' => 128)
|
191
|
-
@plugin.instance_variable_set(:@previous_deliverables,
|
191
|
+
@plugin.instance_variable_set(:@previous_deliverables, AStruct.new({:disk => 'a/disk'}))
|
192
192
|
|
193
193
|
f = mock(File)
|
194
194
|
f.should_receive(:eof?).ordered.and_return(false)
|
@@ -206,7 +206,7 @@ module BoxGrinder
|
|
206
206
|
|
207
207
|
it "should not compress the data before uploading the chunks if we use CloudSigma" do
|
208
208
|
@plugin_config.merge!('endpoint' => 'api.cloudsigma.com')
|
209
|
-
@plugin.instance_variable_set(:@previous_deliverables,
|
209
|
+
@plugin.instance_variable_set(:@previous_deliverables, AStruct.new({:disk => 'a/disk'}))
|
210
210
|
|
211
211
|
f = mock(File)
|
212
212
|
f.should_receive(:eof?).ordered.and_return(false)
|
@@ -304,7 +304,7 @@ module BoxGrinder
|
|
304
304
|
it "should create the server with 512 MB of ram for instances to be uploaded to cloudsigma" do
|
305
305
|
@plugin_config.merge!('endpoint' => 'api.cloudsigma.com')
|
306
306
|
|
307
|
-
@appliance_config.stub!(:hardware).and_return(
|
307
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:cpus => 1, :arch => 'x86_64', :partitions => {'/' => {'size' => 1}, '/home' => {'size' => 2}}, :memory => 256))
|
308
308
|
|
309
309
|
RestClient.should_receive(:post).with("http://12345:secret_access_key@api.cloudsigma.com/servers/create",
|
310
310
|
"json").and_return("server abc-1234567890-abc\nname appliance-1.0\n")
|
@@ -28,15 +28,15 @@ module BoxGrinder
|
|
28
28
|
|
29
29
|
@appliance_config = mock('ApplianceConfig')
|
30
30
|
|
31
|
-
@appliance_config.stub!(:path).and_return(
|
31
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
32
32
|
@appliance_config.stub!(:name).and_return('appliance')
|
33
33
|
@appliance_config.stub!(:summary).and_return('boxgrinder-rocks')
|
34
34
|
@appliance_config.stub!(:version).and_return(1)
|
35
35
|
@appliance_config.stub!(:release).and_return(0)
|
36
|
-
@appliance_config.stub!(:os).and_return(
|
37
|
-
@appliance_config.stub!(:hardware).and_return(
|
36
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => :fedora, :version => '13'}))
|
37
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new({:arch => 'x86_64', :memory => 256, :cpu => 5}))
|
38
38
|
|
39
|
-
@previous_plugin_info =
|
39
|
+
@previous_plugin_info = AStruct.new(:type => :os, :deliverables => {:disk => "/flo/bble.raw", :metadata => 'metadata.xml'})
|
40
40
|
@libvirt_capabilities = mock('libvirt_capabilities').as_null_object
|
41
41
|
@log = mock('logger').as_null_object
|
42
42
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/delivery/local/local-plugin'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
|
22
22
|
module BoxGrinder
|
23
23
|
describe LocalPlugin do
|
@@ -27,15 +27,15 @@ module BoxGrinder
|
|
27
27
|
|
28
28
|
@appliance_config = mock('ApplianceConfig')
|
29
29
|
|
30
|
-
@appliance_config.stub!(:path).and_return(
|
30
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
31
31
|
@appliance_config.stub!(:name).and_return('appliance')
|
32
32
|
@appliance_config.stub!(:version).and_return(1)
|
33
33
|
@appliance_config.stub!(:release).and_return(0)
|
34
|
-
@appliance_config.stub!(:os).and_return(
|
35
|
-
@appliance_config.stub!(:hardware).and_return(
|
34
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => :fedora, :version => '13'}))
|
35
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new({:arch => 'x86_64'}))
|
36
36
|
|
37
37
|
@plugin = RSpecPluginHelper.new(LocalPlugin).prepare(@config, @appliance_config,
|
38
|
-
:previous_plugin =>
|
38
|
+
:previous_plugin => AStruct.new(:type => :os, :deliverables => {:disk => "a_disk.raw", :metadata => 'metadata.xml'}),
|
39
39
|
:plugin_info => {:class => BoxGrinder::LocalPlugin, :type => :delivery, :name => :local, :full_name => "Local file system"}
|
40
40
|
)
|
41
41
|
|
@@ -28,12 +28,12 @@ module BoxGrinder
|
|
28
28
|
@appliance_config.stub!(:name).and_return('appliance_name')
|
29
29
|
@appliance_config.stub!(:version).and_return(1)
|
30
30
|
@appliance_config.stub!(:release).and_return(0)
|
31
|
-
@appliance_config.stub!(:os).and_return(
|
32
|
-
@appliance_config.stub!(:hardware).and_return(
|
33
|
-
@appliance_config.stub!(:path).and_return(
|
31
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '14'}))
|
32
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new({:arch => 'x86_64', :base_arch => 'x86_64'}))
|
33
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => '/a/build/path'}))
|
34
34
|
|
35
35
|
@plugin = RSpecPluginHelper.new(OpenStackPlugin).prepare(@config, @appliance_config,
|
36
|
-
:previous_plugin =>
|
36
|
+
:previous_plugin => AStruct.new(:type => :os, :deliverables => {:disk => "a_disk.raw", :metadata => 'metadata.xml'}),
|
37
37
|
:plugin_info => {:class => BoxGrinder::OpenStackPlugin, :type => :delivery, :name => :openstack, :full_name => "OpenStack" }
|
38
38
|
)
|
39
39
|
end
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/delivery/s3/s3-plugin'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
require 'boxgrinder-core/models/config'
|
22
22
|
require 'set'
|
23
23
|
|
@@ -40,15 +40,15 @@ module BoxGrinder
|
|
40
40
|
|
41
41
|
@appliance_config = mock('ApplianceConfig')
|
42
42
|
|
43
|
-
@appliance_config.stub!(:path).and_return(
|
43
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
44
44
|
@appliance_config.stub!(:name).and_return('appliance')
|
45
45
|
@appliance_config.stub!(:version).and_return(1)
|
46
46
|
@appliance_config.stub!(:release).and_return(0)
|
47
|
-
@appliance_config.stub!(:os).and_return(
|
48
|
-
@appliance_config.stub!(:hardware).and_return(
|
47
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '14'}))
|
48
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new({:arch => 'x86_64', :base_arch => 'x86_64'}))
|
49
49
|
|
50
50
|
@plugin = RSpecPluginHelper.new(S3Plugin).prepare(@config, @appliance_config,
|
51
|
-
:previous_plugin =>
|
51
|
+
:previous_plugin => AStruct.new(:type => :os, :deliverables => {:disk => "a_disk.raw", :metadata => 'metadata.xml'}),
|
52
52
|
:plugin_info => {:class => BoxGrinder::S3Plugin, :type => :delivery, :name => :s3, :full_name => "Amazon Simple Storage Service (Amazon S3)", :types => [:s3, :cloudfront, :ami]}
|
53
53
|
) { |plugin| plugin.stub!(:asset_bucket) }
|
54
54
|
|
@@ -153,7 +153,7 @@ module BoxGrinder
|
|
153
153
|
end
|
154
154
|
|
155
155
|
it "should bundle the image for centos 5 and choose right kernel and ramdisk" do
|
156
|
-
@appliance_config.stub!(:os).and_return(
|
156
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'centos', :version => '5'}))
|
157
157
|
@plugin.instance_variable_get(:@plugin_config).merge!({'region' => 'us-west-1'})
|
158
158
|
|
159
159
|
File.should_receive(:exists?).with('build/path/s3-plugin/ami').and_return(false)
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/os/centos/centos-plugin'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
|
22
22
|
module BoxGrinder
|
23
23
|
describe CentOSPlugin do
|
@@ -30,7 +30,7 @@ module BoxGrinder
|
|
30
30
|
|
31
31
|
@appliance_config = mock('ApplianceConfig')
|
32
32
|
|
33
|
-
@appliance_config.stub!(:path).and_return(
|
33
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
34
34
|
@appliance_config.stub!(:name).and_return('full')
|
35
35
|
|
36
36
|
@plugin = CentOSPlugin.new.init(@config, @appliance_config, {:class => BoxGrinder::CentOSPlugin, :type => :os, :name => :centos, :full_name => "CentOS", :versions => ["5"]}, :log => Logger.new('/dev/null'))
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/os/fedora/fedora-plugin'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
|
22
22
|
module BoxGrinder
|
23
23
|
describe FedoraPlugin do
|
@@ -30,12 +30,12 @@ module BoxGrinder
|
|
30
30
|
|
31
31
|
@appliance_config = mock('ApplianceConfig')
|
32
32
|
|
33
|
-
@appliance_config.stub!(:path).and_return(
|
33
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
34
34
|
@appliance_config.stub!(:name).and_return('full')
|
35
35
|
@appliance_config.stub!(:version).and_return(1)
|
36
36
|
@appliance_config.stub!(:release).and_return(0)
|
37
|
-
@appliance_config.stub!(:os).and_return(
|
38
|
-
@appliance_config.stub!(:hardware).and_return(
|
37
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '13'}))
|
38
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new({:arch => 'x86_64'}))
|
39
39
|
@appliance_config.stub!(:is64bit?).and_return(true)
|
40
40
|
@appliance_config.stub!(:packages).and_return(['mc'])
|
41
41
|
|
@@ -62,7 +62,7 @@ module BoxGrinder
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it "should normalize packages for 32bit for pae enabled system" do
|
65
|
-
@appliance_config.stub!(:os).and_return(
|
65
|
+
@appliance_config.stub!(:os).and_return(AStruct.new(:name => 'fedora', :version => '13'))
|
66
66
|
@plugin_config.merge!('PAE' => false)
|
67
67
|
|
68
68
|
packages = ['abc', 'def', 'kernel']
|
@@ -74,7 +74,7 @@ module BoxGrinder
|
|
74
74
|
end
|
75
75
|
|
76
76
|
it "should normalize packages for Fedora 16" do
|
77
|
-
@appliance_config.stub!(:os).and_return(
|
77
|
+
@appliance_config.stub!(:os).and_return(AStruct.new(:name => 'fedora', :version => '16'))
|
78
78
|
|
79
79
|
packages = ['abc', 'def', 'kernel']
|
80
80
|
|
@@ -136,7 +136,7 @@ module BoxGrinder
|
|
136
136
|
|
137
137
|
describe ".execute" do
|
138
138
|
it "should make Fedora 15 or higher work" do
|
139
|
-
@appliance_config.stub!(:os).and_return(
|
139
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '15'}))
|
140
140
|
|
141
141
|
guestfs = mock("GuestFS")
|
142
142
|
guestfs_helper = mock("GuestFSHelper")
|
@@ -153,7 +153,7 @@ module BoxGrinder
|
|
153
153
|
|
154
154
|
# https://issues.jboss.org/browse/BGBUILD-298
|
155
155
|
it "should for Fedora 16 or higher first install GRUB2 then look after it" do
|
156
|
-
@appliance_config.stub!(:os).and_return(
|
156
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '16'}))
|
157
157
|
|
158
158
|
guestfs = mock("GuestFS")
|
159
159
|
guestfs_helper = mock("GuestFSHelper")
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/os/rhel/rhel-plugin'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
|
22
22
|
module BoxGrinder
|
23
23
|
describe RHELPlugin do
|
@@ -30,11 +30,11 @@ module BoxGrinder
|
|
30
30
|
|
31
31
|
@appliance_config = mock('ApplianceConfig')
|
32
32
|
|
33
|
-
@appliance_config.stub!(:path).and_return(
|
33
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
34
34
|
@appliance_config.stub!(:name).and_return('full')
|
35
35
|
@appliance_config.stub!(:version).and_return(1)
|
36
36
|
@appliance_config.stub!(:release).and_return(0)
|
37
|
-
@appliance_config.stub!(:os).and_return(
|
37
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'rhel', :version => '6'}))
|
38
38
|
|
39
39
|
@plugin = RHELPlugin.new.init(@config, @appliance_config, {:class => BoxGrinder::RHELPlugin, :type => :os, :name => :rhel, :full_name => "Red Hat Enterprise Linux", :versions => ['5', '6']}, :log => LogHelper.new(:level => :trace, :type => :stdout))
|
40
40
|
|
@@ -47,7 +47,7 @@ module BoxGrinder
|
|
47
47
|
|
48
48
|
describe ".normalize_packages" do
|
49
49
|
it "should add @core to package list" do
|
50
|
-
@appliance_config.stub!(:os).and_return(
|
50
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'rhel', :version => '5'}))
|
51
51
|
|
52
52
|
packages = []
|
53
53
|
|
@@ -65,7 +65,7 @@ module BoxGrinder
|
|
65
65
|
end
|
66
66
|
|
67
67
|
it "should not add kernel package if kernel-xen is already choose" do
|
68
|
-
@appliance_config.stub!(:os).and_return(
|
68
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'rhel', :version => '5'}))
|
69
69
|
|
70
70
|
packages = ['kernel-xen']
|
71
71
|
|
@@ -98,7 +98,7 @@ module BoxGrinder
|
|
98
98
|
|
99
99
|
describe ".execute" do
|
100
100
|
it "should recreate the kernel and add some modules to RHEL 5 with normal kernel" do
|
101
|
-
@appliance_config.stub!(:os).and_return(
|
101
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'rhel', :version => '5'}))
|
102
102
|
|
103
103
|
@appliance_config.stub!(:packages).and_return([])
|
104
104
|
|
@@ -115,7 +115,7 @@ module BoxGrinder
|
|
115
115
|
end
|
116
116
|
|
117
117
|
it "should NOT recreate the kernel and add some modules to RHEL 5 if kernel-xen is choosen" do
|
118
|
-
@appliance_config.stub!(:os).and_return(
|
118
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'rhel', :version => '5'}))
|
119
119
|
|
120
120
|
@appliance_config.stub!(:packages).and_return(['kernel-xen'])
|
121
121
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/os/rpm-based/kickstart'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
|
22
22
|
module BoxGrinder
|
23
23
|
describe Kickstart do
|
@@ -34,15 +34,15 @@ module BoxGrinder
|
|
34
34
|
@dir = mock('Some directory')
|
35
35
|
@dir.stub!(:tmp).and_return('baloney')
|
36
36
|
|
37
|
-
@appliance_config.stub!(:path).and_return(
|
37
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
38
38
|
@appliance_config.stub!(:name).and_return('full')
|
39
39
|
@appliance_config.stub!(:version).and_return(1)
|
40
40
|
@appliance_config.stub!(:release).and_return(0)
|
41
|
-
@appliance_config.stub!(:os).and_return(
|
41
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '11', :password => 'boxgrinder'}))
|
42
42
|
@appliance_config.stub!(:packages).and_return(["gcc-c++", "wget"])
|
43
43
|
@appliance_config.stub!(:repos).and_return(repos)
|
44
44
|
|
45
|
-
@kickstart = Kickstart.new(@config, @appliance_config, @dir,
|
45
|
+
@kickstart = Kickstart.new(@config, @appliance_config, @dir, AStruct.new(:base => 'a/base/dir'))
|
46
46
|
end
|
47
47
|
|
48
48
|
describe ".build_definition" do
|
@@ -50,7 +50,7 @@ module BoxGrinder
|
|
50
50
|
prepare_kickstart(KICKSTART_FEDORA_REPOS)
|
51
51
|
|
52
52
|
@appliance_config.stub!(:hardware).and_return(
|
53
|
-
|
53
|
+
AStruct.new({
|
54
54
|
:partitions =>
|
55
55
|
{
|
56
56
|
'/' => {'size' => 2},
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
|
22
22
|
module BoxGrinder
|
23
23
|
describe RPMBasedOSPlugin do
|
@@ -27,17 +27,17 @@ module BoxGrinder
|
|
27
27
|
plugins = mock('Plugins')
|
28
28
|
plugins.stub!(:[]).with('rpm_based').and_return({})
|
29
29
|
@config.stub!(:[]).with(:plugins).and_return(plugins)
|
30
|
-
@config.stub!(:dir).and_return(
|
31
|
-
@config.stub!(:os).and_return(
|
30
|
+
@config.stub!(:dir).and_return(AStruct.new(:tmp => 'tmpdir', :cache => 'cachedir'))
|
31
|
+
@config.stub!(:os).and_return(AStruct.new(:name => 'fedora', :version => '14'))
|
32
32
|
@config.stub!(:os_config).and_return({})
|
33
33
|
|
34
34
|
@appliance_config.stub!(:name).and_return('full')
|
35
35
|
@appliance_config.stub!(:version).and_return(1)
|
36
36
|
@appliance_config.stub!(:release).and_return(0)
|
37
37
|
@appliance_config.stub!(:post).and_return({})
|
38
|
-
@appliance_config.stub!(:os).and_return(
|
39
|
-
@appliance_config.stub!(:hardware).and_return(
|
40
|
-
@appliance_config.stub!(:path).and_return(
|
38
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '11'}))
|
39
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:cpus => 1, :memory => 512, :partitions => {'/' => nil, '/home' => nil}))
|
40
|
+
@appliance_config.stub!(:path).and_return(AStruct.new(:build => 'build/path', :main => 'mainpath'))
|
41
41
|
@appliance_config.stub!(:files).and_return({})
|
42
42
|
|
43
43
|
@plugin = RSpecPluginHelper.new(RPMBasedOSPlugin).prepare(@config, @appliance_config, :plugin_info => {:class => BoxGrinder::RPMBasedOSPlugin, :type => :os, :name => :rpm_based})
|
@@ -171,7 +171,7 @@ module BoxGrinder
|
|
171
171
|
end
|
172
172
|
|
173
173
|
it "should build appliance" do
|
174
|
-
@appliance_config.stub!(:os).and_return(
|
174
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '14'}))
|
175
175
|
@appliance_config.should_receive(:default_repos).and_return(true)
|
176
176
|
@plugin.should_receive(:add_repos).with({})
|
177
177
|
do_build
|
@@ -179,7 +179,7 @@ module BoxGrinder
|
|
179
179
|
end
|
180
180
|
|
181
181
|
it "should execute additional steps for Fedora 15" do
|
182
|
-
@appliance_config.stub!(:os).and_return(
|
182
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '15'}))
|
183
183
|
@appliance_config.should_receive(:default_repos).and_return(true)
|
184
184
|
@plugin.should_receive(:add_repos).ordered.with({})
|
185
185
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
|
22
22
|
module BoxGrinder
|
23
23
|
describe RPMDependencyValidator do
|
@@ -28,14 +28,14 @@ module BoxGrinder
|
|
28
28
|
plugins.stub!(:[]).with('rpm_based').and_return({})
|
29
29
|
@config.stub!(:[]).with(:plugins).and_return(plugins)
|
30
30
|
|
31
|
-
@appliance_config.stub!(:path).and_return(
|
31
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
32
32
|
@appliance_config.stub!(:name).and_return('full')
|
33
33
|
@appliance_config.stub!(:version).and_return(1)
|
34
34
|
@appliance_config.stub!(:release).and_return(0)
|
35
|
-
@appliance_config.stub!(:hardware).and_return(
|
36
|
-
@appliance_config.stub!(:os).and_return(
|
35
|
+
@appliance_config.stub!(:hardware).and_return(AStruct.new(:arch => 'i386'))
|
36
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '11'}))
|
37
37
|
|
38
|
-
@validator = RPMDependencyValidator.new(@config, @appliance_config,
|
38
|
+
@validator = RPMDependencyValidator.new(@config, @appliance_config, AStruct.new(:tmp => 'tmp'))
|
39
39
|
end
|
40
40
|
|
41
41
|
describe ".generate_yum_config" do
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/os/sl/sl-plugin'
|
20
20
|
require 'rspec'
|
21
|
-
require '
|
21
|
+
require 'boxgrinder-core/astruct'
|
22
22
|
|
23
23
|
module BoxGrinder
|
24
24
|
describe ScientificLinuxPlugin do
|
@@ -26,7 +26,7 @@ module BoxGrinder
|
|
26
26
|
@config = Config.new
|
27
27
|
@appliance_config = mock(ApplianceConfig,
|
28
28
|
:name => 'name',
|
29
|
-
:path =>
|
29
|
+
:path => AStruct.new({:build => 'build/path'})
|
30
30
|
)
|
31
31
|
|
32
32
|
@plugin = ScientificLinuxPlugin.new.init(@config, @appliance_config, {:class => BoxGrinder::ScientificLinuxPlugin, :type => :os, :name => :sl, :full_name => "Scientific Linux", :versions => ["5", "6"]}, :log => LogHelper.new(:level => :trace, :type => :stdout))
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/platform/ec2/ec2-plugin'
|
20
20
|
require 'boxgrinder-core/helpers/log-helper'
|
21
|
-
require '
|
21
|
+
require 'boxgrinder-core/astruct'
|
22
22
|
|
23
23
|
module BoxGrinder
|
24
24
|
describe EC2Plugin do
|
@@ -31,17 +31,17 @@ module BoxGrinder
|
|
31
31
|
|
32
32
|
@appliance_config = mock('ApplianceConfig')
|
33
33
|
|
34
|
-
@appliance_config.stub!(:path).and_return(
|
34
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
35
35
|
@appliance_config.stub!(:name).and_return('full')
|
36
36
|
@appliance_config.stub!(:version).and_return(1)
|
37
37
|
@appliance_config.stub!(:release).and_return(0)
|
38
38
|
@appliance_config.stub!(:packages).and_return(["gcc-c++", "wget"])
|
39
|
-
@appliance_config.stub!(:os).and_return(
|
39
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '13'}))
|
40
40
|
@appliance_config.stub!(:is64bit?).and_return(false)
|
41
|
-
@appliance_config.stub!(:post).and_return(
|
41
|
+
@appliance_config.stub!(:post).and_return(AStruct.new)
|
42
42
|
|
43
43
|
@appliance_config.stub!(:hardware).and_return(
|
44
|
-
|
44
|
+
AStruct.new({
|
45
45
|
:partitions =>
|
46
46
|
{
|
47
47
|
'/' => {'size' => 2, 'type' => 'ext4'},
|
@@ -55,7 +55,7 @@ module BoxGrinder
|
|
55
55
|
)
|
56
56
|
|
57
57
|
@plugin = RSpecPluginHelper.new(EC2Plugin).prepare(@config, @appliance_config,
|
58
|
-
:previous_plugin =>
|
58
|
+
:previous_plugin => AStruct.new(:deliverables => {:disk => 'a/disk.raw'}),
|
59
59
|
:plugin_info => {:class => BoxGrinder::EC2Plugin, :type => :platform, :name => :ec2, :full_name => "Amazon Elastic Compute Cloud (Amazon EC2)"}
|
60
60
|
)
|
61
61
|
|
@@ -126,7 +126,7 @@ module BoxGrinder
|
|
126
126
|
end
|
127
127
|
|
128
128
|
it "should upload rc_local for Fedora 16 or newer" do
|
129
|
-
@appliance_config.stub!(:os).and_return(
|
129
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '16'}))
|
130
130
|
|
131
131
|
guestfs = mock("guestfs")
|
132
132
|
tempfile = mock("tempfile")
|
@@ -268,7 +268,7 @@ module BoxGrinder
|
|
268
268
|
end
|
269
269
|
|
270
270
|
it "should recreate kernel image while converting to EC2 format for RHEL/CentOS 5" do
|
271
|
-
@appliance_config.stub!(:os).and_return(
|
271
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'rhel', :version => '5'}))
|
272
272
|
@appliance_config.stub!(:is64bit?).and_return(true)
|
273
273
|
|
274
274
|
linux_helper = mock(LinuxHelper)
|
@@ -320,7 +320,7 @@ module BoxGrinder
|
|
320
320
|
|
321
321
|
describe ".execute_post" do
|
322
322
|
it "should execute post commands" do
|
323
|
-
@appliance_config.stub!(:post).and_return(
|
323
|
+
@appliance_config.stub!(:post).and_return(AStruct.new({'ec2' => ['ls /']}))
|
324
324
|
|
325
325
|
guestfs_helper = mock("guestfsHelper")
|
326
326
|
guestfs_helper.should_receive(:sh).with('ls /', :arch => 'i686')
|
@@ -329,7 +329,7 @@ module BoxGrinder
|
|
329
329
|
end
|
330
330
|
|
331
331
|
it "should not execute post commands because there are no commands to execute :)" do
|
332
|
-
@appliance_config.stub!(:post).and_return(
|
332
|
+
@appliance_config.stub!(:post).and_return(AStruct.new)
|
333
333
|
|
334
334
|
guestfs_helper = mock("guestfsHelper")
|
335
335
|
guestfs_helper.should_not_receive(:sh)
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
require 'rspec-plugin-helper'
|
22
22
|
|
23
23
|
module BoxGrinder
|
@@ -30,16 +30,16 @@ module BoxGrinder
|
|
30
30
|
|
31
31
|
@appliance_config = mock('ApplianceConfig')
|
32
32
|
|
33
|
-
@appliance_config.stub!(:path).and_return(
|
33
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
34
34
|
@appliance_config.stub!(:name).and_return('full')
|
35
35
|
@appliance_config.stub!(:summary).and_return('asd')
|
36
36
|
@appliance_config.stub!(:version).and_return(1)
|
37
37
|
@appliance_config.stub!(:release).and_return(0)
|
38
|
-
@appliance_config.stub!(:os).and_return(
|
39
|
-
@appliance_config.stub!(:post).and_return(
|
38
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '14'}))
|
39
|
+
@appliance_config.stub!(:post).and_return(AStruct.new({:virtualbox => []}))
|
40
40
|
|
41
41
|
@appliance_config.stub!(:hardware).and_return(
|
42
|
-
|
42
|
+
AStruct.new({
|
43
43
|
:partitions =>
|
44
44
|
{
|
45
45
|
'/' => {'size' => 2},
|
@@ -53,7 +53,7 @@ module BoxGrinder
|
|
53
53
|
)
|
54
54
|
|
55
55
|
@plugin = RSpecPluginHelper.new(VirtualBoxPlugin).prepare(@config, @appliance_config,
|
56
|
-
:previous_plugin =>
|
56
|
+
:previous_plugin => AStruct.new(:deliverables => {:disk => 'a/base/image/path.raw'}),
|
57
57
|
:plugin_info => {:class => BoxGrinder::VirtualBoxPlugin, :type => :platform, :name => :virtualbox, :full_name => "VirtualBox"}
|
58
58
|
)
|
59
59
|
|
@@ -83,19 +83,19 @@ module BoxGrinder
|
|
83
83
|
describe ".is_os_old?" do
|
84
84
|
it "should return false for fedora 14" do
|
85
85
|
prepare_image
|
86
|
-
@appliance_config.stub!(:os).and_return(
|
86
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '14'}))
|
87
87
|
@plugin.is_os_old?.should == false
|
88
88
|
end
|
89
89
|
|
90
90
|
it "should return false for rhel 6" do
|
91
91
|
prepare_image
|
92
|
-
@appliance_config.stub!(:os).and_return(
|
92
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'rhel', :version => '6'}))
|
93
93
|
@plugin.is_os_old?.should == false
|
94
94
|
end
|
95
95
|
|
96
96
|
it "should return true for centos 5" do
|
97
97
|
prepare_image
|
98
|
-
@appliance_config.stub!(:os).and_return(
|
98
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'centos', :version => '5'}))
|
99
99
|
@plugin.is_os_old?.should == true
|
100
100
|
end
|
101
101
|
end
|
@@ -153,7 +153,7 @@ module BoxGrinder
|
|
153
153
|
prepare_image
|
154
154
|
|
155
155
|
@appliance_config.post['virtualbox'] = ["one", "two", "three"]
|
156
|
-
@appliance_config.stub!(:os).and_return(
|
156
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'rhel', :version => '5'}))
|
157
157
|
|
158
158
|
@plugin.should_receive(:build_virtualbox)
|
159
159
|
|
@@ -27,16 +27,16 @@ module BoxGrinder
|
|
27
27
|
|
28
28
|
@appliance_config = mock('ApplianceConfig')
|
29
29
|
|
30
|
-
@appliance_config.stub!(:path).and_return(
|
30
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
31
31
|
@appliance_config.stub!(:name).and_return('full')
|
32
32
|
@appliance_config.stub!(:summary).and_return('asd')
|
33
33
|
@appliance_config.stub!(:version).and_return(1)
|
34
34
|
@appliance_config.stub!(:release).and_return(0)
|
35
|
-
@appliance_config.stub!(:os).and_return(
|
36
|
-
@appliance_config.stub!(:post).and_return(
|
35
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '16'}))
|
36
|
+
@appliance_config.stub!(:post).and_return(AStruct.new({:virtualpc => []}))
|
37
37
|
|
38
38
|
@appliance_config.stub!(:hardware).and_return(
|
39
|
-
|
39
|
+
AStruct.new({
|
40
40
|
:partitions =>
|
41
41
|
{
|
42
42
|
'/' => {'size' => 2},
|
@@ -50,7 +50,7 @@ module BoxGrinder
|
|
50
50
|
)
|
51
51
|
|
52
52
|
@plugin = RSpecPluginHelper.new(VirtualPCPlugin).prepare(@config, @appliance_config,
|
53
|
-
:previous_plugin =>
|
53
|
+
:previous_plugin => AStruct.new(:deliverables => {:disk => 'a/base/image/path.raw'}),
|
54
54
|
:plugin_info => {:class => BoxGrinder::VirtualPCPlugin, :type => :platform, :name => :virtualpc, :full_name => "VirtualPC"}
|
55
55
|
)
|
56
56
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
18
|
|
19
19
|
require 'boxgrinder-build/plugins/platform/vmware/vmware-plugin'
|
20
|
-
require '
|
20
|
+
require 'boxgrinder-core/astruct'
|
21
21
|
|
22
22
|
module BoxGrinder
|
23
23
|
describe VMwarePlugin do
|
@@ -29,16 +29,16 @@ module BoxGrinder
|
|
29
29
|
|
30
30
|
@appliance_config = mock('ApplianceConfig')
|
31
31
|
|
32
|
-
@appliance_config.stub!(:path).and_return(
|
32
|
+
@appliance_config.stub!(:path).and_return(AStruct.new({:build => 'build/path'}))
|
33
33
|
@appliance_config.stub!(:name).and_return('full')
|
34
34
|
@appliance_config.stub!(:summary).and_return('asd')
|
35
35
|
@appliance_config.stub!(:version).and_return(1)
|
36
36
|
@appliance_config.stub!(:release).and_return(0)
|
37
|
-
@appliance_config.stub!(:os).and_return(
|
38
|
-
@appliance_config.stub!(:post).and_return(
|
37
|
+
@appliance_config.stub!(:os).and_return(AStruct.new({:name => 'fedora', :version => '11'}))
|
38
|
+
@appliance_config.stub!(:post).and_return(AStruct.new({:vmware => []}))
|
39
39
|
|
40
40
|
@appliance_config.stub!(:hardware).and_return(
|
41
|
-
|
41
|
+
AStruct.new({
|
42
42
|
:partitions =>
|
43
43
|
{
|
44
44
|
'/' => {'size' => 2},
|
@@ -52,7 +52,7 @@ module BoxGrinder
|
|
52
52
|
)
|
53
53
|
|
54
54
|
@plugin = RSpecPluginHelper.new(VMwarePlugin).prepare(@config, @appliance_config,
|
55
|
-
:previous_plugin =>
|
55
|
+
:previous_plugin => AStruct.new(:deliverables => {:disk => 'a/base/image/path.raw'}),
|
56
56
|
:plugin_info => {:class => BoxGrinder::VMwarePlugin, :type => :platform, :name => :vmware, :full_name => "VMware"}
|
57
57
|
)
|
58
58
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxgrinder-build
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: boxgrinder-core
|
@@ -213,7 +213,6 @@ files:
|
|
213
213
|
- Rakefile
|
214
214
|
- bash_completion
|
215
215
|
- bin/boxgrinder-build
|
216
|
-
- boxgrinder-build.gemspec
|
217
216
|
- integ/appliances/gnome-fedora.appl
|
218
217
|
- integ/appliances/jeos-centos5-files.appl
|
219
218
|
- integ/appliances/jeos-centos5.appl
|
@@ -338,6 +337,7 @@ files:
|
|
338
337
|
- spec/util/permissions/fs-monitor-spec.rb
|
339
338
|
- spec/util/permissions/fs-observer-spec.rb
|
340
339
|
- spec/util/permissions/user-switcher-spec.rb
|
340
|
+
- boxgrinder-build.gemspec
|
341
341
|
homepage: http://boxgrinder.org/
|
342
342
|
licenses: []
|
343
343
|
post_install_message:
|