[PATCH configure 1/2] Added aeolus-configure, aeolus-cleanup, stop services tests
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
Added spec tests to check that aeolus-configure and aeolus-cleanup run
correctly and exit with the correct status. Also added test to check that
aeolus-services are stopped after aeolus-cleanup
---
spec/verify_install_spec.rb | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/spec/verify_install_spec.rb b/spec/verify_install_spec.rb
index 83e2004..3d787f1 100644
--- a/spec/verify_install_spec.rb
+++ b/spec/verify_install_spec.rb
@@ -8,6 +8,19 @@ describe "aeolus-configure install" do
@password = "#{ENV['password']}".empty? ? nil : "#{ENV['password']}"
end
+ it "should successfully execute aeolus-configure" do
+ Net::SSH.start(@hostname, @username, :password => @password) do |ssh|
+ ssh.open_channel do |channel|
+ channel.exec("aeolus-configure") do |ch, success|
+ channel.on_request("exit-status") do |ch, data|
+ exit_code = data.read_long
+ exit_code.should == 0
+ end
+ end
+ end
+ end
+ end
+
it "should install all aeolus packages" do
stdout = ""
Net::SSH.start(@hostname, @username, :password => @password) do |ssh|
@@ -63,4 +76,29 @@ describe "aeolus-configure install" do
end
end
+ it "should successfully execute aeolus-cleanup" do
+ Net::SSH.start(@hostname, @username, :password => @password) do |ssh|
+ ssh.open_channel do |channel|
+ channel.exec("aeolus-cleanup") do |ch, success|
+ channel.on_request("exit-status") do |ch, data|
+ exit_code = data.read_long
+ exit_code.should == 0
+ end
+ end
+ end
+ end
+ end
+
+ it "aeolus-cleanup should stop all services" do
+ stdout = ""
+ Net::SSH.start(@hostname, @username, :password => @password) do |ssh|
+ ["aeolus-conductor", "deltacloud-core", "iwhd", "conductor-dbomatic", "conductor-condor_refreshd"].each do |service|
+ ssh.exec!("/etc/init.d/" + service + " status") do |channel, stream, data|
+ stdout << data if stream == :stdout
+ end
+ stdout.include?("is stopped").should == true
+ stdout = ""
+ end
+ end
+ end
end
--
1.7.4
13 years, 1 month
[PATCH configure 1/2] Added RSpec test framework
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
Rakefile | 7 +++++++
spec/spec.opts | 4 ++++
spec/spec_helper.rb | 3 +++
3 files changed, 14 insertions(+), 0 deletions(-)
create mode 100644 spec/spec.opts
create mode 100644 spec/spec_helper.rb
diff --git a/Rakefile b/Rakefile
index cc529d8..5ad69f5 100644
--- a/Rakefile
+++ b/Rakefile
@@ -3,6 +3,8 @@
require 'rake/clean'
require 'rake/rpmtask'
require 'rake/yumtask'
+require 'rubygems'
+require 'spec/rake/spectask'
CURRENT_DIR = File.dirname(__FILE__)
RPMBUILD_DIR = "#{File.expand_path('~')}/rpmbuild"
@@ -26,3 +28,8 @@ Rake::YumTask.new(YUM_REPO) do |repo|
repo.rpms << rpm_task.rpm_file
end
+desc "Run remote spec tests, SSH options: hostname=<hostname> username=<username> password=<password>"
+Spec::Rake::SpecTask.new do |t, args|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+end
+
diff --git a/spec/spec.opts b/spec/spec.opts
new file mode 100644
index 0000000..391705b
--- /dev/null
+++ b/spec/spec.opts
@@ -0,0 +1,4 @@
+--colour
+--format progress
+--loadby mtime
+--reverse
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..a9cd152
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,3 @@
+require 'rubygems'
+require 'spec'
+require 'spec/autorun'
--
1.7.4
13 years, 1 month
[PATCH configure 1/1] Make aeolus-configure rpm macros consistent with aeolus-conductor macros
by Mike Orazi
---
contrib/aeolus-configure.spec | 2 +-
rake/rpmtask.rb | 16 +++++++++-------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/contrib/aeolus-configure.spec b/contrib/aeolus-configure.spec
index ebca531..c949c94 100644
--- a/contrib/aeolus-configure.spec
+++ b/contrib/aeolus-configure.spec
@@ -4,7 +4,7 @@
Summary: Aeolus Configure Puppet Recipe
Name: aeolus-configure
Version: 2.0.0
-Release: 4%{?dist}%{timestamp}
+Release: 4%{?dist}%{?extra_release}
Group: Applications/Internet
License: GPLv2+
diff --git a/rake/rpmtask.rb b/rake/rpmtask.rb
index 0dd361c..0cc156e 100644
--- a/rake/rpmtask.rb
+++ b/rake/rpmtask.rb
@@ -18,8 +18,8 @@ module Rake
# RPM build dir
attr_accessor :topdir
- # Include a timestamp in the rpm
- attr_accessor :include_timestamp
+ # Include extra_release information in the rpm
+ attr_accessor :include_extra_release
def initialize(rpm_spec)
init(rpm_spec)
@@ -28,7 +28,7 @@ module Rake
end
def init(rpm_spec)
- @include_timestamp = false
+ @include_extra_release = true
@rpm_spec = rpm_spec
# parse this out of the rpmbuild macros,
@@ -67,16 +67,18 @@ module Rake
directory "#{@topdir}/SPECS"
desc "Build the rpms"
- task :rpms, [:include_timestamp] => [rpm_file]
+ task :rpms, [:include_extra_release] => [rpm_file]
# FIXME properly determine :package build artifact(s) to copy to sources dir
- file rpm_file, [:include_timestamp] => [:package, "#{@topdir}/SOURCES", "#{@topdir}/SPECS"] do |t,args|
- @include_timestamp = args.include_timestamp != "false"
+ file rpm_file, [:include_extra_release] => [:package, "#{@topdir}/SOURCES", "#{@topdir}/SPECS"] do |t,args|
+ @include_extra_release = args.include_extra_release != "false"
+ @git_head = `git log -1 --pretty=format:%h`
+ @extra_release = "." + Time.now.strftime("%Y%m%d%k%M%S").gsub(/\s/, '') + "git" + "#{@git_head}"
cp "#{package_dir}/#{@name}-#{(a)version}.tgz", "#{@topdir}/SOURCES/"
cp @rpm_spec, "#{@topdir}/SPECS"
sh "#{@rpmbuild_cmd} " +
"--define '_topdir #{@topdir}' " +
- "--define 'timestamp .#{@include_timestamp ? Time.now.strftime("%Y%m%d%k%M%s").gsub(/\s/, '') : ''}' " +
+ "--define 'extra_release #{@include_extra_release ? @extra_release : ''}' " +
"-ba #{@rpm_spec}"
end
end
--
1.7.4
13 years, 1 month
[PATCH configure] Updated Git Ignore
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
Updated Git Ignore to ignore eclipse project files and tmp files
---
.gitignore | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 314808d..421bb7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
deltacloud
pkg/
repo/
+.loadpath
+.project
+*.*~
--
1.7.4
13 years, 1 month
[PATCH configure] Added Tests for Check Admin/Create Bucket
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
.loadpath | 5 +++++
.project | 17 +++++++++++++++++
spec/verify_install_spec.rb | 30 ++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+), 0 deletions(-)
create mode 100644 .loadpath
create mode 100644 .project
diff --git a/.loadpath b/.loadpath
new file mode 100644
index 0000000..9a62220
--- /dev/null
+++ b/.loadpath
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<loadpath>
+ <pathentry path="" type="src"/>
+ <pathentry path="org.rubypeople.rdt.launching.RUBY_CONTAINER" type="con"/>
+</loadpath>
diff --git a/.project b/.project
new file mode 100644
index 0000000..a298967
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>conf</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.rubypeople.rdt.core.rubybuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.rubypeople.rdt.core.rubynature</nature>
+ </natures>
+</projectDescription>
diff --git a/spec/verify_install_spec.rb b/spec/verify_install_spec.rb
index 1ea5d27..83e2004 100644
--- a/spec/verify_install_spec.rb
+++ b/spec/verify_install_spec.rb
@@ -33,4 +33,34 @@ describe "aeolus-configure install" do
end
end
end
+
+ it "should correctly create an aeolus templates bucket" do
+ stdout = ""
+ Net::SSH.start(@hostname, @username, :password => @password) do |ssh|
+ ssh.exec!("/usr/bin/curl -X GET http://localhost:9090") do |channel, stream, data|
+ stdout << data if stream == :stdout
+ end
+ end
+ stdout.include?("http://localhost:9090/templates").should == true
+ end
+
+ it "should create a site admin for aeolus conductor" do
+ stdout = ""
+ Net::SSH.start(@hostname, @username, :password => @password) do |ssh|
+ ssh.exec!("echo 'RAILS_ENV=\"production\"' > /tmp/check_admin.rb")
+ ssh.exec!("echo 'require \"/usr/share/aeolus-conductor/config/environment\"' >> /tmp/check_admin.rb")
+ ssh.exec!("echo 'user=User.find(:all, :conditions => {:login => \"admin\"}).first' >> /tmp/check_admin.rb")
+ ssh.exec!("echo 'puts \"email=\" + user.email' >> /tmp/check_admin.rb")
+ ssh.exec!("echo 'puts \"first_name=\" + user.first_name' >> /tmp/check_admin.rb")
+ ssh.exec!("echo 'puts \"last_name=\" + user.last_name' >> /tmp/check_admin.rb")
+ ssh.exec!("ruby /tmp/check_admin.rb") do |channel, stream, data|
+ stdout << data if stream == :stdout
+ end
+ stdout.include?("email=dcuser(a)aeolusproject.org").should == true
+ stdout.include?("first_name=aeolus").should == true
+ stdout.include?("last_name=user").should == true
+ ssh.exec!("rm -f /tmp/check_admin.rb")
+ end
+ end
+
end
--
1.7.4
13 years, 1 month
Minor revision to tests
by Jason Guiditta
[PATCH conductor] Initial version of qmf console for v2 factory.
Now that the push method on agent has been fixed, I noticed an
intermittent error on tests, due to trying to shutdown the console
when it was not always connected. I have run the suite several times
with these changes and tests pass for me, so hopefully this error
is corrected. If you see an error about session not being attached,
let me know, that was the symptom I was attempting to correct.
-j
13 years, 1 month
[PATCH] add missing rubygem(net-scp) dependency to aeolus-conductor
by Mo Morsi
---
aeolus-conductor.spec.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/aeolus-conductor.spec.in b/aeolus-conductor.spec.in
index e2bbe4c..d90cf89 100644
--- a/aeolus-conductor.spec.in
+++ b/aeolus-conductor.spec.in
@@ -35,6 +35,7 @@ Requires: rubygem(imagebuilder-console)
Requires: rubygem(rack-restful_submit)
Requires: rubygem(sunspot_rails)
Requires: rubygem(delayed_job)
+Requires: rubygem(net-scp)
Requires: postgresql
Requires: postgresql-server
Requires: ruby-postgres
--
1.7.2.3
13 years, 1 month
[PATCH configure] removed iwhd conf.js and init script as they are now provided by iwhd rpm
by Mo Morsi
---
recipes/aeolus_recipe/files/iwhd-conf.js | 7 ---
recipes/aeolus_recipe/files/iwhd.init | 76 ------------------------------
recipes/aeolus_recipe/manifests/iwhd.pp | 12 +----
3 files changed, 1 insertions(+), 94 deletions(-)
delete mode 100644 recipes/aeolus_recipe/files/iwhd-conf.js
delete mode 100644 recipes/aeolus_recipe/files/iwhd.init
diff --git a/recipes/aeolus_recipe/files/iwhd-conf.js b/recipes/aeolus_recipe/files/iwhd-conf.js
deleted file mode 100644
index 44516e0..0000000
--- a/recipes/aeolus_recipe/files/iwhd-conf.js
+++ /dev/null
@@ -1,7 +0,0 @@
-[
- {
- "name": "primary",
- "type": "fs",
- "path": "."
- }
-]
diff --git a/recipes/aeolus_recipe/files/iwhd.init b/recipes/aeolus_recipe/files/iwhd.init
deleted file mode 100644
index 4695d73..0000000
--- a/recipes/aeolus_recipe/files/iwhd.init
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/bash
-#
-#
-# iwhd startup script for iwhd server
-#
-# chkconfig: - 40 60
-# description: iwhd is primary server process for the \
-# IWHD component.
-#
-
-[ -r /etc/sysconfig/iwhd ] && . /etc/sysconfig/iwhd
-
-LOCKFILE="${LOCKFILE:-/var/lock/subsys/iwhd}"
-
-PROG=/usr/bin/iwhd
-CONF=/etc/iwhd/conf.js
-
-. /etc/init.d/functions
-
-start() {
- echo -n "Starting iwhd: "
- # FIXME: we sleep 2 here to make sure that mongod has really come up.
- # Yes, it's a hack
- sleep 2
-
- $PROG -c $CONF >& /var/log/iwhd.log &
- RETVAL=$?
- if [ $RETVAL -eq 0 ] && touch $LOCKFILE ; then
- echo_success
- echo
- else
- echo_failure
- echo
- fi
-}
-
-stop() {
- echo -n "Shutting down iwhd: "
- RETVAL=$?
- killall $PROG
- if [ $RETVAL -eq 0 ] && rm -f $LOCKFILE ; then
- echo_success
- echo
- else
- echo_failure
- echo
- fi
-}
-
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- reload)
- ;;
- force-reload)
- restart
- ;;
- status)
- status $PROG
- RETVAL=$?
- ;;
- *)
- echo "Usage: iwhd {start|stop|restart|status}"
- exit 1
- ;;
-esac
-
-exit $RETVAL
diff --git a/recipes/aeolus_recipe/manifests/iwhd.pp b/recipes/aeolus_recipe/manifests/iwhd.pp
index 2acd0f8..0357a91 100644
--- a/recipes/aeolus_recipe/manifests/iwhd.pp
+++ b/recipes/aeolus_recipe/manifests/iwhd.pp
@@ -12,15 +12,6 @@ class aeolus::iwhd inherits aeolus {
### Start the aeolus services
file { "/data": ensure => 'directory' }
file { "/data/db": ensure => 'directory' }
- file { "/etc/iwhd": ensure => 'directory'}
- file { "/etc/iwhd/conf.js":
- source => "puppet:///modules/aeolus_recipe/iwhd-conf.js",
- mode => 755, require => File['/etc/iwhd'] }
-
- #TODO The service wrapper should probably be in the rpm itself
- file { "/etc/rc.d/init.d/iwhd":
- source => "puppet:///modules/aeolus_recipe/iwhd.init",
- mode => 755 }
service { 'mongod':
ensure => 'running',
@@ -31,8 +22,7 @@ class aeolus::iwhd inherits aeolus {
ensure => 'running',
enable => true,
hasstatus => true,
- require => [File['/etc/rc.d/init.d/iwhd', '/etc/iwhd/conf.js'],
- return_if($enable_packages, Package['iwhd']),
+ require => [return_if($enable_packages, Package['iwhd']),
Service[mongod]]}
# XXX ugly hack but iwhd might take some time to come up
--
1.7.2.3
13 years, 1 month
[PATCH configure] install mongodb-server before starting mongo service
by Mo Morsi
---
recipes/aeolus_recipe/manifests/iwhd.pp | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/recipes/aeolus_recipe/manifests/iwhd.pp b/recipes/aeolus_recipe/manifests/iwhd.pp
index 0357a91..5b28c3c 100644
--- a/recipes/aeolus_recipe/manifests/iwhd.pp
+++ b/recipes/aeolus_recipe/manifests/iwhd.pp
@@ -7,6 +7,8 @@ class aeolus::iwhd inherits aeolus {
provider => 'yum', ensure => 'installed',
require => Yumrepo['aeolus_arch', 'aeolus_noarch']
}
+ package { 'mongodb-server':
+ provider => 'yum', ensure => 'installed'}
}
### Start the aeolus services
@@ -16,7 +18,7 @@ class aeolus::iwhd inherits aeolus {
service { 'mongod':
ensure => 'running',
enable => true,
- require => [return_if($enable_packages, Package['iwhd']), File["/data/db"]]}
+ require => [return_if($enable_packages, Package['iwhd', 'mongodb-server']), File["/data/db"]]}
service { 'iwhd':
ensure => 'running',
--
1.7.2.3
13 years, 1 month
[PATCH configure] add timestamp to configure rpm release (rev 2)
by Mo Morsi
---
contrib/deltacloud-configure.spec | 2 +-
rake/rpmtask.rb | 14 +++++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/contrib/deltacloud-configure.spec b/contrib/deltacloud-configure.spec
index 670d401..d88d43a 100644
--- a/contrib/deltacloud-configure.spec
+++ b/contrib/deltacloud-configure.spec
@@ -4,7 +4,7 @@
Summary: DeltaCloud Configure Puppet Recipe
Name: deltacloud-configure
Version: 2.0.0
-Release: 2%{?dist}
+Release: 2%{?dist}%{timestamp}
Group: Applications/Internet
License: GPLv2+
diff --git a/rake/rpmtask.rb b/rake/rpmtask.rb
index ff2ee66..0dd361c 100644
--- a/rake/rpmtask.rb
+++ b/rake/rpmtask.rb
@@ -18,6 +18,9 @@ module Rake
# RPM build dir
attr_accessor :topdir
+ # Include a timestamp in the rpm
+ attr_accessor :include_timestamp
+
def initialize(rpm_spec)
init(rpm_spec)
yield self if block_given?
@@ -25,6 +28,7 @@ module Rake
end
def init(rpm_spec)
+ @include_timestamp = false
@rpm_spec = rpm_spec
# parse this out of the rpmbuild macros,
@@ -63,13 +67,17 @@ module Rake
directory "#{@topdir}/SPECS"
desc "Build the rpms"
- task :rpms => [rpm_file]
+ task :rpms, [:include_timestamp] => [rpm_file]
# FIXME properly determine :package build artifact(s) to copy to sources dir
- file rpm_file => [:package, "#{@topdir}/SOURCES", "#{@topdir}/SPECS"] do
+ file rpm_file, [:include_timestamp] => [:package, "#{@topdir}/SOURCES", "#{@topdir}/SPECS"] do |t,args|
+ @include_timestamp = args.include_timestamp != "false"
cp "#{package_dir}/#{@name}-#{(a)version}.tgz", "#{@topdir}/SOURCES/"
cp @rpm_spec, "#{@topdir}/SPECS"
- sh "#{@rpmbuild_cmd} --define '_topdir #{@topdir}' -ba #{@rpm_spec}"
+ sh "#{@rpmbuild_cmd} " +
+ "--define '_topdir #{@topdir}' " +
+ "--define 'timestamp .#{@include_timestamp ? Time.now.strftime("%Y%m%d%k%M%s").gsub(/\s/, '') : ''}' " +
+ "-ba #{@rpm_spec}"
end
end
--
1.7.2.3
13 years, 1 month