instalatron 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +32 -1
- data/Rakefile +0 -1
- data/bin/instalatron-play +19 -1
- data/bin/instalatron-record +1 -1
- data/lib/instalatron.rb +24 -1
- metadata +5 -20
data/README.md
CHANGED
@@ -1,4 +1,35 @@
|
|
1
|
-
|
1
|
+
# Instalatron
|
2
|
+
|
3
|
+
RedHat Anaconda Testing Framework using Oracle's VirtualBox
|
4
|
+
|
5
|
+
# Requirements
|
6
|
+
|
7
|
+
Rubygems
|
2
8
|
|
3
9
|
VirtualBox >= 4.0.8
|
10
|
+
|
4
11
|
ImageMagick >= 6.6.4
|
12
|
+
|
13
|
+
# Install
|
14
|
+
|
15
|
+
Make you you have installed VirtualBox and ImageMagick before installing.
|
16
|
+
|
17
|
+
Install instalatron gem:
|
18
|
+
|
19
|
+
`sudo gem install instalatron`
|
20
|
+
|
21
|
+
|
22
|
+
# Examples
|
23
|
+
|
24
|
+
Creating a new recording
|
25
|
+
|
26
|
+
`instalatron-record --iso-file my-abiquo-iso.iso`
|
27
|
+
|
28
|
+
This will create a new VM in VirtualBox and will start the recording session
|
29
|
+
|
30
|
+
Creating a new instalatron script
|
31
|
+
|
32
|
+
`instalatron-play -s ciab --iso-file ~/Downloads/abiquo-linux-ee-1.8-preview-2011-07-07-1456.iso --nic-config nic1:eth0:bridged --vm-memory 1024`
|
33
|
+
|
34
|
+
This will create a VM with 1024 MB of RAM and use the script found in 'ciab' directory to create a Cloud in a Box install.
|
35
|
+
|
data/Rakefile
CHANGED
@@ -24,7 +24,6 @@ Jeweler::Tasks.new do |gem|
|
|
24
24
|
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
25
25
|
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
26
26
|
gem.add_runtime_dependency 'mixlib-cli', '>= 1.2'
|
27
|
-
gem.add_runtime_dependency 'mixlib-cli', '>= 1.2'
|
28
27
|
gem.add_runtime_dependency 'virtualbox', '>= 0.8'
|
29
28
|
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
30
29
|
end
|
data/bin/instalatron-play
CHANGED
@@ -4,11 +4,29 @@ require 'instalatron'
|
|
4
4
|
require 'yaml'
|
5
5
|
require 'mixlib/cli'
|
6
6
|
require 'logger'
|
7
|
+
require 'erb'
|
7
8
|
|
8
9
|
def play_session(vm_name, script, custom_seq = nil, key_press_delay = 0)
|
9
10
|
ctrlc_gap = 0
|
10
11
|
basedir = File.dirname(script)
|
11
|
-
|
12
|
+
if File.exist?(basedir + '/config.rb')
|
13
|
+
include Instalatron
|
14
|
+
begin
|
15
|
+
require basedir + '/config.rb'
|
16
|
+
rescue Exception => e
|
17
|
+
raise Exception.new("Error loading config.rb file: #{e.message}")
|
18
|
+
end
|
19
|
+
|
20
|
+
begin
|
21
|
+
tmpl = ERB.new(File.read(script))
|
22
|
+
script = YAML.load(tmpl.result)
|
23
|
+
rescue Exception => e
|
24
|
+
raise Exception.new("Error rendering ERB template from script.yml: #{e.message}")
|
25
|
+
end
|
26
|
+
|
27
|
+
else
|
28
|
+
script = YAML.load_file(script)
|
29
|
+
end
|
12
30
|
if custom_seq
|
13
31
|
new_seq = script[0]
|
14
32
|
new_seq[:sequence] = custom_seq
|
data/bin/instalatron-record
CHANGED
@@ -42,7 +42,7 @@ def record_session(vm_name, session_name = "instalatron_rec_" + Time.now.strftim
|
|
42
42
|
$stdin.gets
|
43
43
|
end
|
44
44
|
rescue SystemExit, Interrupt
|
45
|
-
puts "
|
45
|
+
puts "\nAborting..."
|
46
46
|
File.open "#{session_name}/script.yml", 'w' do |f|
|
47
47
|
f.puts script.to_yaml
|
48
48
|
end
|
data/lib/instalatron.rb
CHANGED
@@ -4,7 +4,30 @@ require 'virtualbox'
|
|
4
4
|
|
5
5
|
module Instalatron
|
6
6
|
|
7
|
-
VERSION = '0.1.
|
7
|
+
VERSION = '0.1.5'
|
8
|
+
|
9
|
+
class ScriptConfig
|
10
|
+
|
11
|
+
@config = {}
|
12
|
+
|
13
|
+
class << self
|
14
|
+
attr_reader :config
|
15
|
+
|
16
|
+
def [](arg)
|
17
|
+
config[arg]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.create(&block)
|
22
|
+
i = self.new
|
23
|
+
i.instance_eval &block
|
24
|
+
end
|
25
|
+
|
26
|
+
def method_missing(symbol, *args, &block)
|
27
|
+
ScriptConfig.config[symbol] = args[0]
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
8
31
|
|
9
32
|
#
|
10
33
|
# NIC is nic1, nic2, etc
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instalatron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sergio Rubio
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -66,21 +66,6 @@ dependencies:
|
|
66
66
|
name: mixlib-cli
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
69
|
-
none: false
|
70
|
-
requirements:
|
71
|
-
- - ">="
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
hash: 11
|
74
|
-
segments:
|
75
|
-
- 1
|
76
|
-
- 2
|
77
|
-
version: "1.2"
|
78
|
-
type: :runtime
|
79
|
-
requirement: *id004
|
80
|
-
prerelease: false
|
81
|
-
name: mixlib-cli
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
84
69
|
none: false
|
85
70
|
requirements:
|
86
71
|
- - ">="
|
@@ -91,7 +76,7 @@ dependencies:
|
|
91
76
|
- 8
|
92
77
|
version: "0.8"
|
93
78
|
type: :runtime
|
94
|
-
requirement: *
|
79
|
+
requirement: *id004
|
95
80
|
prerelease: false
|
96
81
|
name: virtualbox
|
97
82
|
description: Tests graphical installers using VirtualBox, keyboard driven input and image recognition technics
|