boxgrinder-build 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -0
- data/Manifest +2 -1
- data/Rakefile +1 -1
- data/boxgrinder-build.gemspec +6 -6
- data/integ/appliances/jeos-f16.appl +9 -0
- data/integ/spec/jeos-spec.rb +5 -0
- data/lib/boxgrinder-build/helpers/ec2-helper.rb +1 -1
- data/lib/boxgrinder-build/helpers/s3-helper.rb +2 -7
- data/lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb +3 -5
- data/lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb +29 -23
- data/lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb +54 -3
- data/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb +0 -36
- data/lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init +3 -2
- data/lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb +8 -1
- data/rubygem-boxgrinder-build.spec +11 -3
- data/spec/helpers/ec2-helper-spec.rb +2 -2
- data/spec/helpers/guestfs-helper-spec.rb +3 -1
- data/spec/helpers/s3-helper-spec.rb +2 -19
- data/spec/plugins/delivery/ebs/ebs-plugin-spec.rb +18 -21
- data/spec/plugins/delivery/s3/s3-plugin-spec.rb +213 -163
- data/spec/plugins/os/fedora/fedora-plugin-spec.rb +37 -0
- data/spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb +0 -30
- data/spec/plugins/platform/ec2/ec2-plugin-spec.rb +25 -0
- metadata +10 -7
@@ -87,6 +87,43 @@ module BoxGrinder
|
|
87
87
|
@plugin.normalize_packages(packages)
|
88
88
|
packages.should == ["@core", "system-config-firewall-base", "dhclient", "kernel"]
|
89
89
|
end
|
90
|
+
|
91
|
+
context "BGBUILD-204" do
|
92
|
+
it "should disable bios device name hints for GRUB legacy" do
|
93
|
+
guestfs = mock("GuestFS")
|
94
|
+
guestfs.should_receive(:exists).with("/boot/grub2/grub.cfg").and_return(0)
|
95
|
+
guestfs.should_receive(:exists).with("/boot/grub/grub.cfg").and_return(1)
|
96
|
+
guestfs.should_receive(:sh).with("sed -i \"s/kernel\\(.*\\)/kernel\\1 biosdevname=0/g\" /boot/grub/grub.conf")
|
97
|
+
@plugin.disable_biosdevname(guestfs)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should disable bios device name hints for GRUB2" do
|
101
|
+
guestfs = mock("GuestFS")
|
102
|
+
guestfs.should_receive(:exists).with("/boot/grub2/grub.cfg").and_return(1)
|
103
|
+
guestfs.should_receive(:exists).with("/boot/grub/grub.cfg").and_return(0)
|
104
|
+
guestfs.should_receive(:write).with("/etc/default/grub", "GRUB_CMDLINE_LINUX=\"quiet rhgb biosdevname=0\"\n")
|
105
|
+
@plugin.disable_biosdevname(guestfs)
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should change to runlevel 3 by default" do
|
109
|
+
guestfs = mock("GuestFS")
|
110
|
+
guestfs.should_receive(:rm).with("/etc/systemd/system/default.target")
|
111
|
+
guestfs.should_receive(:ln_sf).with("/lib/systemd/system/multi-user.target", "/etc/systemd/system/default.target")
|
112
|
+
@plugin.change_runlevel(guestfs)
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should disable netfs" do
|
116
|
+
guestfs = mock("GuestFS")
|
117
|
+
guestfs.should_receive(:sh).with("chkconfig netfs off")
|
118
|
+
@plugin.disable_netfs(guestfs)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
it "should link /etc/mtab to /proc/self/mounts" do
|
123
|
+
guestfs = mock("GuestFS")
|
124
|
+
guestfs.should_receive(:ln_sf).with("/proc/self/mounts", "/etc/mtab")
|
125
|
+
@plugin.link_mtab(guestfs)
|
126
|
+
end
|
90
127
|
end
|
91
128
|
end
|
92
129
|
|
@@ -246,10 +246,6 @@ module BoxGrinder
|
|
246
246
|
@plugin.should_receive(:add_repos).ordered.with({})
|
247
247
|
|
248
248
|
do_build do |guestfs, guestfs_helper|
|
249
|
-
@plugin.should_receive(:disable_biosdevname).ordered.with(guestfs)
|
250
|
-
@plugin.should_receive(:change_runlevel).ordered.with(guestfs)
|
251
|
-
@plugin.should_receive(:disable_netfs).ordered.with(guestfs)
|
252
|
-
@plugin.should_receive(:link_mtab).ordered.with(guestfs)
|
253
249
|
@plugin.should_receive(:recreate_rpm_database).ordered.with(guestfs, guestfs_helper)
|
254
250
|
@plugin.should_receive(:execute_post).ordered.with(guestfs_helper)
|
255
251
|
end
|
@@ -345,31 +341,5 @@ module BoxGrinder
|
|
345
341
|
@plugin.recreate_rpm_database(guestfs, guestfs_helper)
|
346
342
|
end
|
347
343
|
end
|
348
|
-
|
349
|
-
context "BGBUILD-204" do
|
350
|
-
it "should disable bios device name hints" do
|
351
|
-
guestfs = mock("GuestFS")
|
352
|
-
guestfs.should_receive(:sh).with("sed -i \"s/kernel\\(.*\\)/kernel\\1 biosdevname=0/g\" /boot/grub/grub.conf")
|
353
|
-
@plugin.disable_biosdevname(guestfs)
|
354
|
-
end
|
355
|
-
|
356
|
-
it "should change to runlevel 3 by default" do
|
357
|
-
guestfs = mock("GuestFS")
|
358
|
-
guestfs.should_receive(:rm).with("/etc/systemd/system/default.target")
|
359
|
-
guestfs.should_receive(:ln_sf).with("/lib/systemd/system/multi-user.target", "/etc/systemd/system/default.target")
|
360
|
-
@plugin.change_runlevel(guestfs)
|
361
|
-
end
|
362
|
-
|
363
|
-
it "should disable netfs" do
|
364
|
-
guestfs = mock("GuestFS")
|
365
|
-
guestfs.should_receive(:sh).with("chkconfig netfs off")
|
366
|
-
@plugin.disable_netfs(guestfs)
|
367
|
-
end
|
368
|
-
end
|
369
|
-
it "should link /etc/mtab to /proc/self/mounts" do
|
370
|
-
guestfs = mock("GuestFS")
|
371
|
-
guestfs.should_receive(:ln_sf).with("/proc/self/mounts", "/etc/mtab")
|
372
|
-
@plugin.link_mtab(guestfs)
|
373
|
-
end
|
374
344
|
end
|
375
345
|
end
|
@@ -122,6 +122,31 @@ module BoxGrinder
|
|
122
122
|
@plugin.upload_rc_local(guestfs)
|
123
123
|
end
|
124
124
|
|
125
|
+
it "should upload rc_local for Fedora 16 or newer" do
|
126
|
+
@appliance_config.stub!(:os).and_return(OpenCascade.new({:name => 'fedora', :version => '16'}))
|
127
|
+
|
128
|
+
guestfs = mock("guestfs")
|
129
|
+
tempfile = mock("tempfile")
|
130
|
+
|
131
|
+
Tempfile.should_receive(:new).with("rc_local").and_return(tempfile)
|
132
|
+
File.should_receive(:read).with(any_args()).and_return("with other content")
|
133
|
+
|
134
|
+
guestfs.should_receive(:read_file).once.ordered.with("/etc/rc.local").and_return("content ")
|
135
|
+
tempfile.should_receive(:<<).once.ordered.with("content with other content")
|
136
|
+
tempfile.should_receive(:flush).once.ordered
|
137
|
+
tempfile.should_receive(:path).once.ordered.and_return("path")
|
138
|
+
guestfs.should_receive(:upload).once.ordered.with("path", "/etc/rc.local")
|
139
|
+
tempfile.should_receive(:close).once.ordered
|
140
|
+
|
141
|
+
@log.should_receive(:debug).once.with("Uploading '/etc/rc.local' file...")
|
142
|
+
@log.should_receive(:debug).once.with("'/etc/rc.local' file uploaded.")
|
143
|
+
|
144
|
+
guestfs.should_receive(:cp).with("/lib/systemd/system/rc-local.service", "/etc/systemd/system/")
|
145
|
+
guestfs.should_receive(:sh).with("sed -i '/^ConditionFileIsExecutable/a After=network.target' /etc/systemd/system/rc-local.service")
|
146
|
+
|
147
|
+
@plugin.upload_rc_local(guestfs)
|
148
|
+
end
|
149
|
+
|
125
150
|
it "should change configuration" do
|
126
151
|
guestfs_helper = mock("GuestFSHelper")
|
127
152
|
|
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:
|
4
|
+
hash: 49
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 5
|
10
|
+
version: 0.9.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Marek Goldmann
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-26 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -42,10 +42,12 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
45
|
+
hash: 17
|
46
46
|
segments:
|
47
|
-
-
|
48
|
-
|
47
|
+
- 1
|
48
|
+
- 1
|
49
|
+
- 1
|
50
|
+
version: 1.1.1
|
49
51
|
type: :runtime
|
50
52
|
version_requirements: *id002
|
51
53
|
- !ruby/object:Gem::Dependency
|
@@ -180,6 +182,7 @@ files:
|
|
180
182
|
- integ/appliances/_test_base.appl
|
181
183
|
- integ/appliances/gnome-fedora.appl
|
182
184
|
- integ/appliances/jeos-centos.appl
|
185
|
+
- integ/appliances/jeos-f16.appl
|
183
186
|
- integ/appliances/jeos-fedora.appl
|
184
187
|
- integ/appliances/modular.appl
|
185
188
|
- integ/packages/ephemeral-repo-test-0.1-1.noarch.rpm
|