vmth 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,54 @@
1
+ #
2
+ # Strings are passed through ERB, so you can use this to templatize your config
3
+ # Variables you might use via ERB are...
4
+ # @source_path - specified on the command-line via '-p'
5
+ # @scenario - name of the scenario currently under test
6
+ #
7
+ # Each section below provides an array of directives.
8
+ # Directives are processed in order. Valid directives are:
9
+ # upload: [ host-path, vm-path ] - copy a file to the vm
10
+ # upload_recurse: [ host-path, vm-path ] - recursively copy files to vm
11
+ # download: [ vm-path, host-path ] - copy a file down from the vm
12
+ # download_recurse: [ vm-path, host-path ] - same, but recursive
13
+ # cmd: some-shell-command - execute a command on the vm
14
+ # cmdtest: [ "some-shell-command", !ruby/regexp /output-when-cmd-fails/ ]
15
+ # This command will be run and its output will be evaluated for a string
16
+ # which shows the command failed. If this string is found or the
17
+ # command exits non-zero the section is considered 'FAILED' and reported
18
+ # as such in the text output
19
+ # foreach: [ args [array-of-args], directive1, directive2, .. ]
20
+ # This is used to loop over a series of commands.
21
+
22
+ # You can also override settings from defaults.yaml in this file.
23
+
24
+ prep:
25
+ - cmd: sysctl vm.panic_on_oom=0
26
+ - cmd: mkdir -p /home/ops-envs/development
27
+ - foreach:
28
+ - args: [ dnsdata, rubylib, scripts, service ]
29
+ - cmd: svn export --force https://svn/trunk/<%=@arg%> /home/ops-envs/development/<%=@arg%>
30
+ - upload_recurse: [ "<%=@source_path%>/.", /home/ops-envs/development/puppet ]
31
+ - foreach:
32
+ - args: [ ldap.conf, nsswitch.conf ]
33
+ - upload: [ "<%=@source_path%>/dist/ldap-client/<%=@arg%>", "/etc/<%=@arg%>" ]
34
+ - upload: [ "<%=@source_path%>/dist/puppetmaster/fileserver.rb", /usr/lib/ruby/site_ruby/1.8/puppet/network/handler/fileserver.rb ]
35
+ - cmd: cp /home/ops-envs/development/puppet/dist/puppet/puppet.conf /etc/puppet/puppet.conf
36
+ - cmd: cp /home/ops-envs/development/puppet/dist/puppetmaster/fileserver.conf /etc/puppet
37
+ - cmd: rm /etc/puppet/puppetd.conf
38
+ - cmd: rm /etc/puppet/puppetmasterd.conf
39
+ - cmd: mkdir -p /var/cache/rsync
40
+ - cmd: /sbin/service puppetmaster restart
41
+ - upload: [ "<%=@source_path%>/../get_device_services.rb", /etc/puppet/get_device_services.rb ]
42
+ - upload: [ "<%=@source_path%>/../machdb_hostdata.yaml", /etc/machdb_hostdata.yaml ]
43
+ - cmd: chattr +i /etc/hosts
44
+ - cmd: chattr +i /etc/ssh/sshd_config
45
+ - cmd: sleep 5
46
+ applying:
47
+ - cmd: cp /etc/shadow /etc/shadow.bak
48
+ - cmd: /sbin/service puppetmaster restart
49
+ - cmd: "echo <%=@scenario%> >/etc/test_this_service"
50
+ - cmdtest: [ "pp", !ruby/regexp /Not using cache on failed catalog/ ]
51
+ testing:
52
+ - cmdtest: [ "ruby /home/ops-envs/development/puppet/tests/test_<%=@scenario%>.rb 2>&1", !ruby/regexp /Failure:/ ]
53
+ teardown:
54
+ - cmd: cp /etc/shadow.bak /etc/shadow
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ $LOAD_PATH << File.expand_path( File.dirname(__FILE__) + '/../lib' )
4
+ require 'test/unit'
5
+
@@ -0,0 +1,13 @@
1
+ #!/bin/ruby
2
+ require File.dirname(__FILE__)+"/helpers.rb"
3
+ require 'virb'
4
+
5
+ class VirbTest < Test::Unit::TestCase
6
+ def setup
7
+ true
8
+ end
9
+ def test_new
10
+ assert defined?(p_test)
11
+ assert defined?(f_apply)
12
+ end
13
+ end
@@ -0,0 +1,25 @@
1
+ #!/bin/ruby
2
+ require File.dirname(__FILE__)+"/helpers.rb"
3
+ require 'vmth'
4
+
5
+ class VmthTest < Test::Unit::TestCase
6
+ def setup
7
+ true
8
+ end
9
+ def test_true
10
+ assert true
11
+ end
12
+
13
+
14
+ def test_new
15
+ assert_nothing_raised do
16
+ @vmth = Vmth.new()
17
+ end
18
+ end
19
+ def test_vmcl
20
+ @vmth = Vmth.new()
21
+ vmcl = @vmth.vmcl()
22
+ assert vmcl.class == String, "vmcl did not return a string"
23
+ assert ! vmcl.empty?
24
+ end
25
+ end
@@ -0,0 +1,65 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{vmth}
5
+ s.version = "0.0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Greg Retkowski"]
9
+ s.cert_chain = ["/home/greg/.gemkeys/gem-public_cert.pem"]
10
+ s.date = %q{2011-04-26}
11
+ s.description = %q{require 'rubygems'
12
+ require 'rake'
13
+ require 'echoe'
14
+
15
+ Echoe.new('vmth', '0.0.1') do |p|
16
+ p.description = File.open(File.dirname(__FILE__+"/DESCRIPTION")).read
17
+ p.summary = "A VM test harness for testing operational configurations"
18
+ p.url = "http://github.com/gregretkowski/vmth"
19
+ p.author = "Greg Retkowski"
20
+ p.email = "greg@rage.net"
21
+ p.ignore_pattern = ["tmp/*", "script/*", "ol/*"]
22
+ p.rdoc_template = nil
23
+ p.rdoc_pattern = /^(lib|bin|tasks|ext)|^README|^CHANGELOG|^TODO|^LICENSE|^QUICKSTART|^CONFIG|^COPYING$/
24
+ # p.rdoc_template = ""
25
+ p.development_dependencies = []
26
+ p.runtime_dependencies = [
27
+ 'formatr',
28
+ 'net-ssh',
29
+ 'net-scp',
30
+ ]
31
+
32
+ end
33
+ }
34
+ s.email = %q{greg@rage.net}
35
+ s.executables = ["virb", "vmth"]
36
+ s.extra_rdoc_files = ["CHANGELOG", "CONFIG.rdoc", "LICENSE", "QUICKSTART.rdoc", "README.rdoc", "bin/virb", "bin/vmth", "lib/defaults.yaml", "lib/virb.rb", "lib/vmth.rb"]
37
+ s.files = ["CHANGELOG", "CONFIG.rdoc", "DESCRIPTION", "LICENSE", "Manifest", "QUICKSTART.rdoc", "README.rdoc", "Rakefile", "bin/virb", "bin/vmth", "lib/defaults.yaml", "lib/virb.rb", "lib/vmth.rb", "sample_config.yaml", "test/helpers.rb", "test/test_virb.rb", "test/test_vmth.rb", "vmth.gemspec"]
38
+ s.homepage = %q{http://github.com/gregretkowski/vmth}
39
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Vmth", "--main", "README.rdoc"]
40
+ s.require_paths = ["lib"]
41
+ s.rubyforge_project = %q{vmth}
42
+ s.rubygems_version = %q{1.3.5}
43
+ s.signing_key = %q{/home/greg/.gemkeys/gem-private_key.pem}
44
+ s.summary = %q{A VM test harness for testing operational configurations}
45
+ s.test_files = ["test/test_virb.rb", "test/test_vmth.rb"]
46
+
47
+ if s.respond_to? :specification_version then
48
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
49
+ s.specification_version = 3
50
+
51
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
52
+ s.add_runtime_dependency(%q<formatr>, [">= 0"])
53
+ s.add_runtime_dependency(%q<net-ssh>, [">= 0"])
54
+ s.add_runtime_dependency(%q<net-scp>, [">= 0"])
55
+ else
56
+ s.add_dependency(%q<formatr>, [">= 0"])
57
+ s.add_dependency(%q<net-ssh>, [">= 0"])
58
+ s.add_dependency(%q<net-scp>, [">= 0"])
59
+ end
60
+ else
61
+ s.add_dependency(%q<formatr>, [">= 0"])
62
+ s.add_dependency(%q<net-ssh>, [">= 0"])
63
+ s.add_dependency(%q<net-scp>, [">= 0"])
64
+ end
65
+ end
metadata ADDED
@@ -0,0 +1,160 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vmth
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Greg Retkowski
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDKDCCAhCgAwIBAgIBADANBgkqhkiG9w0BAQUFADA6MQ0wCwYDVQQDDARncmVn
14
+ MRQwEgYKCZImiZPyLGQBGRYEcmFnZTETM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e9Fk=
30
+ -----END CERTIFICATE-----
31
+
32
+ date: 2011-04-26 00:00:00 -07:00
33
+ default_executable:
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: formatr
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: net-ssh
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: net-scp
57
+ type: :runtime
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ description: |
66
+ require 'rubygems'
67
+ require 'rake'
68
+ require 'echoe'
69
+
70
+ Echoe.new('vmth', '0.0.1') do |p|
71
+ p.description = File.open(File.dirname(__FILE__+"/DESCRIPTION")).read
72
+ p.summary = "A VM test harness for testing operational configurations"
73
+ p.url = "http://github.com/gregretkowski/vmth"
74
+ p.author = "Greg Retkowski"
75
+ p.email = "greg@rage.net"
76
+ p.ignore_pattern = ["tmp/*", "script/*", "ol/*"]
77
+ p.rdoc_template = nil
78
+ p.rdoc_pattern = /^(lib|bin|tasks|ext)|^README|^CHANGELOG|^TODO|^LICENSE|^QUICKSTART|^CONFIG|^COPYING$/
79
+ # p.rdoc_template = ""
80
+ p.development_dependencies = []
81
+ p.runtime_dependencies = [
82
+ 'formatr',
83
+ 'net-ssh',
84
+ 'net-scp',
85
+ ]
86
+
87
+ end
88
+
89
+ email: greg@rage.net
90
+ executables:
91
+ - virb
92
+ - vmth
93
+ extensions: []
94
+
95
+ extra_rdoc_files:
96
+ - CHANGELOG
97
+ - CONFIG.rdoc
98
+ - LICENSE
99
+ - QUICKSTART.rdoc
100
+ - README.rdoc
101
+ - bin/virb
102
+ - bin/vmth
103
+ - lib/defaults.yaml
104
+ - lib/virb.rb
105
+ - lib/vmth.rb
106
+ files:
107
+ - CHANGELOG
108
+ - CONFIG.rdoc
109
+ - DESCRIPTION
110
+ - LICENSE
111
+ - Manifest
112
+ - QUICKSTART.rdoc
113
+ - README.rdoc
114
+ - Rakefile
115
+ - bin/virb
116
+ - bin/vmth
117
+ - lib/defaults.yaml
118
+ - lib/virb.rb
119
+ - lib/vmth.rb
120
+ - sample_config.yaml
121
+ - test/helpers.rb
122
+ - test/test_virb.rb
123
+ - test/test_vmth.rb
124
+ - vmth.gemspec
125
+ has_rdoc: true
126
+ homepage: http://github.com/gregretkowski/vmth
127
+ licenses: []
128
+
129
+ post_install_message:
130
+ rdoc_options:
131
+ - --line-numbers
132
+ - --inline-source
133
+ - --title
134
+ - Vmth
135
+ - --main
136
+ - README.rdoc
137
+ require_paths:
138
+ - lib
139
+ required_ruby_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: "0"
144
+ version:
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: "1.2"
150
+ version:
151
+ requirements: []
152
+
153
+ rubyforge_project: vmth
154
+ rubygems_version: 1.3.5
155
+ signing_key:
156
+ specification_version: 3
157
+ summary: A VM test harness for testing operational configurations
158
+ test_files:
159
+ - test/test_virb.rb
160
+ - test/test_vmth.rb
@@ -0,0 +1,2 @@
1
+ ~�������g&q
2
+ Α����4�X�� �� P3��]��q��:ڃ��=��߭"�/F���O�� ���}�N���ӓv��ѣ��|��_�Ҍ��������3��h��(�Ǔ}�{V��2�Xÿ!�[2����aP��I�t�v����GV�Ov�jQ�2�Q_����}���ÿ�a����-n8���A������;��V�~i'`L]�_z`�9��x[�hdZ�Sr�y�