You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(3) |
Feb
(15) |
Mar
|
Apr
(9) |
May
|
Jun
(6) |
Jul
|
Aug
|
Sep
(23) |
Oct
(25) |
Nov
(44) |
Dec
(9) |
2010 |
Jan
(14) |
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
(4) |
Sep
|
Oct
(10) |
Nov
(4) |
Dec
(22) |
2011 |
Jan
(14) |
Feb
|
Mar
(3) |
Apr
(7) |
May
(16) |
Jun
(4) |
Jul
(6) |
Aug
(3) |
Sep
|
Oct
(4) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
(10) |
Apr
(24) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <jh...@us...> - 2010-12-22 21:07:26
|
Revision: 243 http://etch.svn.sourceforge.net/etch/?rev=243&view=rev Author: jheiss Date: 2010-12-22 21:07:20 +0000 (Wed, 22 Dec 2010) Log Message: ----------- Add supported_archs per request of macports folks. Modified Paths: -------------- trunk/client/Portfile.template Modified: trunk/client/Portfile.template =================================================================== --- trunk/client/Portfile.template 2010-12-22 21:04:18 UTC (rev 242) +++ trunk/client/Portfile.template 2010-12-22 21:07:20 UTC (rev 243) @@ -34,6 +34,7 @@ depends_run port:facter worksrcdir ${worksrcdir}/client +supported_archs noarch use_configure no build {} destroot.cmd ${prefix}/bin/rake This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-22 21:04:24
|
Revision: 242 http://etch.svn.sourceforge.net/etch/?rev=242&view=rev Author: jheiss Date: 2010-12-22 21:04:18 +0000 (Wed, 22 Dec 2010) Log Message: ----------- Move the MacPort's Portfile template to Portfile.template. Save the latest Portfile in svn so that we can easily diff against it, as the MacPorts guys have indicated that they prefer a diff to a whole file. Update the Rakefile to generate the Portfile from Portfile.template. Added Paths: ----------- trunk/client/Portfile Added: trunk/client/Portfile =================================================================== --- trunk/client/Portfile (rev 0) +++ trunk/client/Portfile 2010-12-22 21:04:18 UTC (rev 242) @@ -0,0 +1,41 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id$ + +PortSystem 1.0 +PortGroup ruby 1.0 + +name etch +version 3.16.0 +categories sysutils +maintainers aput.net:jheiss openmaintainer + +description Etch is a system configuration management tool. + +long_description Etch is a tool for managing the configuration of \ + Unix systems. Etch can manage text or binary \ + files, links and directories. The contents of \ + files can be supplied from static files or \ + generated on the fly by scripts or templates. \ + Permissions and ownership as well as any pre or \ + post commands to run when updating the file are \ + configured in simple XML files. + +homepage http://etch.sourceforge.net/ +platforms darwin + +master_sites sourceforge + +checksums md5 5ee5d5aad12f4d5271ae8b676419948f \ + sha1 c1e4d4496e8edd9adf85d9893a5fc56935703946 \ + rmd160 5fd7d9e84e966a2031a30d4da49ab822bfca746c + +depends_build port:rb-rake +depends_run port:facter + +worksrcdir ${worksrcdir}/client +supported_archs noarch +use_configure no +build {} +destroot.cmd ${prefix}/bin/rake +destroot.target install\[${destroot}\] +destroot.destdir This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-22 21:04:01
|
Revision: 241 http://etch.svn.sourceforge.net/etch/?rev=241&view=rev Author: jheiss Date: 2010-12-22 21:03:55 +0000 (Wed, 22 Dec 2010) Log Message: ----------- Move the MacPort's Portfile template to Portfile.template. Save the latest Portfile in svn so that we can easily diff against it, as the MacPorts guys have indicated that they prefer a diff to a whole file. Update the Rakefile to generate the Portfile from Portfile.template. Modified Paths: -------------- trunk/client/Rakefile Added Paths: ----------- trunk/client/Portfile.template Removed Paths: ------------- trunk/client/Portfile Deleted: trunk/client/Portfile =================================================================== --- trunk/client/Portfile 2010-12-22 20:44:02 UTC (rev 240) +++ trunk/client/Portfile 2010-12-22 21:03:55 UTC (rev 241) @@ -1,42 +0,0 @@ -# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 -# $Id$ - -PortSystem 1.0 -PortGroup ruby 1.0 - -name etch -version %VER% -categories sysutils -maintainers aput.net:jheiss openmaintainer -supported_archs noarch - -description Etch is a system configuration management tool. - -long_description Etch is a tool for managing the configuration of \ - Unix systems. Etch can manage text or binary \ - files, links and directories. The contents of \ - files can be supplied from static files or \ - generated on the fly by scripts or templates. \ - Permissions and ownership as well as any pre or \ - post commands to run when updating the file are \ - configured in simple XML files. - -homepage http://etch.sourceforge.net/ -platforms darwin - -master_sites sourceforge - -checksums md5 %MD5% \ - sha1 %SHA1% \ - rmd160 %RMD160% - -depends_build port:rb-rake -depends_run port:facter - -worksrcdir ${worksrcdir}/client -use_configure no -build {} -destroot.cmd ${prefix}/bin/rake -destroot.target install\[${destroot}\] -destroot.destdir - Copied: trunk/client/Portfile.template (from rev 240, trunk/client/Portfile) =================================================================== --- trunk/client/Portfile.template (rev 0) +++ trunk/client/Portfile.template 2010-12-22 21:03:55 UTC (rev 241) @@ -0,0 +1,41 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id$ + +PortSystem 1.0 +PortGroup ruby 1.0 + +name etch +version %VER% +categories sysutils +maintainers aput.net:jheiss openmaintainer +supported_archs noarch + +description Etch is a system configuration management tool. + +long_description Etch is a tool for managing the configuration of \ + Unix systems. Etch can manage text or binary \ + files, links and directories. The contents of \ + files can be supplied from static files or \ + generated on the fly by scripts or templates. \ + Permissions and ownership as well as any pre or \ + post commands to run when updating the file are \ + configured in simple XML files. + +homepage http://etch.sourceforge.net/ +platforms darwin + +master_sites sourceforge + +checksums md5 %MD5% \ + sha1 %SHA1% \ + rmd160 %RMD160% + +depends_build port:rb-rake +depends_run port:facter + +worksrcdir ${worksrcdir}/client +use_configure no +build {} +destroot.cmd ${prefix}/bin/rake +destroot.target install\[${destroot}\] +destroot.destdir Modified: trunk/client/Rakefile =================================================================== --- trunk/client/Rakefile 2010-12-22 20:44:02 UTC (rev 240) +++ trunk/client/Rakefile 2010-12-22 21:03:55 UTC (rev 241) @@ -395,7 +395,7 @@ portfile = File.join(Dir.tmpdir, 'Portfile') rm_f(portfile) File.open(portfile, 'w') do |newfile| - IO.foreach('Portfile') do |line| + IO.foreach('Portfile.template') do |line| line.sub!('%VER%', ETCHVER) line.sub!('%MD5%', md5) line.sub!('%SHA1%', sha1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-22 20:44:08
|
Revision: 240 http://etch.svn.sourceforge.net/etch/?rev=240&view=rev Author: jheiss Date: 2010-12-22 20:44:02 +0000 (Wed, 22 Dec 2010) Log Message: ----------- Add supported_archs field per suggestion of macports folks Modified Paths: -------------- trunk/client/Portfile Modified: trunk/client/Portfile =================================================================== --- trunk/client/Portfile 2010-12-22 20:15:58 UTC (rev 239) +++ trunk/client/Portfile 2010-12-22 20:44:02 UTC (rev 240) @@ -8,6 +8,7 @@ version %VER% categories sysutils maintainers aput.net:jheiss openmaintainer +supported_archs noarch description Etch is a system configuration management tool. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-22 20:16:04
|
Revision: 239 http://etch.svn.sourceforge.net/etch/?rev=239&view=rev Author: jheiss Date: 2010-12-22 20:15:58 +0000 (Wed, 22 Dec 2010) Log Message: ----------- Tag 3.17.0 release Modified Paths: -------------- Rakefile tags/release-3.17.0/VERSION Added Paths: ----------- tags/release-3.17.0/ Modified: Rakefile =================================================================== --- Rakefile 2010-12-19 07:13:05 UTC (rev 238) +++ Rakefile 2010-12-22 20:15:58 UTC (rev 239) @@ -1,4 +1,4 @@ -ETCHVER = '3.16.0' +ETCHVER = '3.17.0' TAGNAME = "release-#{ETCHVER}" TAGDIR = "tags/#{TAGNAME}" DIST = "etch-#{ETCHVER}" Modified: tags/release-3.17.0/VERSION =================================================================== --- trunk/VERSION 2010-12-19 07:13:05 UTC (rev 238) +++ tags/release-3.17.0/VERSION 2010-12-22 20:15:58 UTC (rev 239) @@ -1 +1 @@ -trunk +3.17.0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-19 07:13:11
|
Revision: 238 http://etch.svn.sourceforge.net/etch/?rev=238&view=rev Author: jheiss Date: 2010-12-19 07:13:05 +0000 (Sun, 19 Dec 2010) Log Message: ----------- Update dependencies for Debian package. These are copied from the tpkg Debian package which is more widely used, and seem appropriate for etch as well. Modified Paths: -------------- trunk/client/control Modified: trunk/client/control =================================================================== --- trunk/client/control 2010-12-19 04:12:35 UTC (rev 237) +++ trunk/client/control 2010-12-19 07:13:05 UTC (rev 238) @@ -2,6 +2,6 @@ Version: %VER%-1 Maintainer: etc...@li... Architecture: all -Depends: ruby facter +Depends: ruby, libopenssl-ruby1.8, facter, lsb-release, lsb-base Description: Etch client This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-19 04:12:41
|
Revision: 237 http://etch.svn.sourceforge.net/etch/?rev=237&view=rev Author: jheiss Date: 2010-12-19 04:12:35 +0000 (Sun, 19 Dec 2010) Log Message: ----------- Fix bug around checking if ssh key is readable. Modified Paths: -------------- trunk/client/etchclient.rb Modified: trunk/client/etchclient.rb =================================================================== --- trunk/client/etchclient.rb 2010-12-18 08:43:26 UTC (rev 236) +++ trunk/client/etchclient.rb 2010-12-19 04:12:35 UTC (rev 237) @@ -123,7 +123,7 @@ end end - if !File.readable?(@key) + if @key && !File.readable?(@key) @key = nil end if !@key This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 08:43:33
|
Revision: 236 http://etch.svn.sourceforge.net/etch/?rev=236&view=rev Author: jheiss Date: 2010-12-18 08:43:26 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Updates as a result of running the rails:update rake task after upgrading to rails 2.3.10 Modified Paths: -------------- trunk/server/config/boot.rb Modified: trunk/server/config/boot.rb =================================================================== --- trunk/server/config/boot.rb 2010-12-18 08:42:53 UTC (rev 235) +++ trunk/server/config/boot.rb 2010-12-18 08:43:26 UTC (rev 236) @@ -62,8 +62,12 @@ gem 'rails' end rescue Gem::LoadError => load_error - $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.) - exit 1 + if load_error.message =~ /Could not find RubyGem rails/ + STDERR.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.) + exit 1 + else + raise + end end class << self This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 08:43:00
|
Revision: 235 http://etch.svn.sourceforge.net/etch/?rev=235&view=rev Author: jheiss Date: 2010-12-18 08:42:53 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Update to rails 2.3.10. Apparently 2.3.8 is incompatible with newer versions of the i18n gem and I started running into that incompatibility. This was fixed in 2.3.9. Modified Paths: -------------- trunk/server/config/environment.rb Modified: trunk/server/config/environment.rb =================================================================== --- trunk/server/config/environment.rb 2010-12-18 08:30:15 UTC (rev 234) +++ trunk/server/config/environment.rb 2010-12-18 08:42:53 UTC (rev 235) @@ -5,7 +5,7 @@ # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.3.10' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 08:30:22
|
Revision: 234 http://etch.svn.sourceforge.net/etch/?rev=234&view=rev Author: jheiss Date: 2010-12-18 08:30:15 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Finish implementing the tests for the "key" setting in etch.conf Add the :testname parameter to all run_etch calls. Modified Paths: -------------- trunk/test/test_conf.rb Modified: trunk/test/test_conf.rb =================================================================== --- trunk/test/test_conf.rb 2010-12-18 08:23:37 UTC (rev 233) +++ trunk/test/test_conf.rb 2010-12-18 08:30:15 UTC (rev 234) @@ -5,6 +5,17 @@ # require File.join(File.dirname(__FILE__), 'etchtest') +require 'net/http' +require 'rexml/document' +require 'cgi' +begin + # Try loading facter w/o gems first so that we don't introduce a + # dependency on gems if it is not needed. + require 'facter' +rescue LoadError + require 'rubygems' + require 'facter' +end class EtchConfTests < Test::Unit::TestCase include EtchTests @@ -27,7 +38,6 @@ # # Test the server setting in etch.conf # - testname = 'etch.conf server setting' FileUtils.mkdir_p("#{@repodir}/source/#{@targetfile}") File.open("#{@repodir}/source/#{@targetfile}/config.xml", 'w') do |file| @@ -43,12 +53,15 @@ EOF end + testname = 'etch.conf server setting' + sourcecontents = "Test #{testname}\n" File.open("#{@repodir}/source/#{@targetfile}/source", 'w') do |file| file.write(sourcecontents) end # Test that it fails with a bogus etch.conf server setting + testname = 'etch.conf server setting, bogus' Dir.mkdir("#{@testroot}/etc") File.open("#{@testroot}/etc/etch.conf", 'w') do |file| file.puts "server = http://bogushost:0" @@ -56,16 +69,17 @@ # The --server option normally used by run_etch will override the config # file, signal run_etch to leave out the --server option - run_etch(@server, @testroot, :server => '', :errors_expected => true) + run_etch(@server, @testroot, :server => '', :errors_expected => true, :testname => testname) # And confirm that it now succeeds with a correct etch.conf server setting + testname = 'etch.conf server setting, correct' File.open("#{@testroot}/etc/etch.conf", 'w') do |file| file.puts "server = http://localhost:#{@server[:port]}" end # The --server option normally used by run_etch will override the config # file, signal run_etch to leave out the --server option - run_etch(@server, @testroot, :server => '') + run_etch(@server, @testroot, :server => '', :testname => testname) assert_equal(sourcecontents, get_file_contents(@targetfile)) end @@ -73,7 +87,6 @@ # # Test the local setting in etch.conf # - testname = 'etch.conf local setting' FileUtils.mkdir_p("#{@repodir}/source/#{@targetfile}") File.open("#{@repodir}/source/#{@targetfile}/config.xml", 'w') do |file| @@ -89,12 +102,15 @@ EOF end + testname = 'etch.conf local setting' + sourcecontents = "Test #{testname}\n" File.open("#{@repodir}/source/#{@targetfile}/source", 'w') do |file| file.write(sourcecontents) end # Test that it fails with a bogus etch.conf local setting + testname = 'etch.conf local setting, bogus' Dir.mkdir("#{@testroot}/etc") File.open("#{@testroot}/etc/etch.conf", 'w') do |file| file.puts "local = /not/a/valid/path" @@ -102,32 +118,148 @@ # Although the config file local setting will override it, tell run_etch # to leave out the --server option to avoid confusion - run_etch(@server, @testroot, :server => '', :errors_expected => true) + run_etch(@server, @testroot, :server => '', :errors_expected => true, :testname => testname) # And confirm that it now succeeds with a correct etch.conf local setting + testname = 'etch.conf local setting, correct' File.open("#{@testroot}/etc/etch.conf", 'w') do |file| file.puts "local = #{@repodir}" end # Although the config file local setting will override it, tell run_etch # to leave out the --server option to avoid confusion - run_etch(@server, @testroot, :server => '') + run_etch(@server, @testroot, :server => '', :testname => testname) assert_equal(sourcecontents, get_file_contents(@targetfile)) end def test_conf_key - # FIXME + # Start a server instance that has authentication enabled + authrepodir = initialize_repository + File.open(File.join(authrepodir, 'etchserver.conf'), 'w') do |file| + file.puts 'auth_enabled=true' + file.puts 'auth_deny_new_clients=true' + end + # These tests set an etchserver.conf. The server only reads that file + # once and caches the settings, so we need to start up new server + # instances for these tests rather than reusing the global test server. + authserver = start_server(authrepodir) + + # Generate an SSH key pair + keyfile = Tempfile.new('etchtest') + File.unlink(keyfile.path) + system("ssh-keygen -t rsa -f #{keyfile.path} -N '' -q") + pubkeycontents = File.read("#{keyfile.path}.pub") + sshrsakey = pubkeycontents.chomp.split[1] + + # Set the client's key fact on the server to this new key + hostname = Facter['fqdn'].value + # Note the use of @server instead of authserver, we need to talk to + # a server that doesn't have authentication enabled in order to make + # these changes. + Net::HTTP.start('localhost', @server[:port]) do |http| + # Find our client id + response = http.get("/clients.xml?name=#{hostname}") + if !response.kind_of?(Net::HTTPSuccess) + response.error! + end + response_xml = REXML::Document.new(response.body) + client_id = nil + if response_xml.elements['/clients/client/id'] + client_id = response_xml.elements['/clients/client/id'].text + # If there's an existing "sshrsakey" fact for this client then + # delete it + response = http.get("/facts.xml?search[client_id]=#{client_id}&" + + "search[key]=sshrsakey") + if !response.kind_of?(Net::HTTPSuccess) + response.error! + end + response_xml = REXML::Document.new(response.body) + fact_id = nil + if response_xml.elements['/facts/fact/id'] + fact_id = response_xml.elements['/facts/fact/id'].text + end + if fact_id + response = http.delete("/facts/#{fact_id}.xml") + if !response.kind_of?(Net::HTTPSuccess) + response.error! + end + end + else + # Handle the case where this is the first test this client has + # ever run and as such there's no entry for the client in the + # database. + response = http.post('/clients.xml', + "client[name]=#{CGI.escape(hostname)}") + if !response.kind_of?(Net::HTTPSuccess) + response.error! + end + response_xml = REXML::Document.new(response.body) + client_id = response_xml.elements['/client/id'].text + end + # Insert our key as the client's "sshrsakey" fact + response = http.post('/facts.xml', + "fact[client_id]=#{client_id}&" + + "fact[key]=sshrsakey&" + + "fact[value]=#{CGI.escape(sshrsakey)}") + if !response.kind_of?(Net::HTTPSuccess) + response.error! + end + end + + FileUtils.mkdir_p("#{authrepodir}/source/#{@targetfile}") + File.open("#{authrepodir}/source/#{@targetfile}/config.xml", 'w') do |file| + file.puts <<-EOF + <config> + <file> + <warning_file></warning_file> + <source> + <plain>source</plain> + </source> + </file> + </config> + EOF + end + + testname = 'etch.conf key setting' + + sourcecontents = "Test #{testname}\n" + File.open("#{authrepodir}/source/#{@targetfile}/source", 'w') do |file| + file.write(sourcecontents) + end + + # Test that it fails with a bogus etch.conf key setting + testname = 'etch.conf key setting, bogus' + Dir.mkdir("#{@testroot}/etc") + File.open("#{@testroot}/etc/etch.conf", 'w') do |file| + file.puts "key = /not/a/valid/path" + end + # The --key option normally used by run_etch will override the config # file, signal run_etch to leave out the --key option - #run_etch(@server, @testroot, :key => '') + run_etch(authserver, @testroot, :key => '', + :errors_expected => true, :testname => testname) + + # And confirm that it now succeeds with a correct etch.conf key setting + testname = 'etch.conf key setting, correct' + File.open("#{@testroot}/etc/etch.conf", 'w') do |file| + file.puts "key = #{keyfile.path}" + end + + # The --key option normally used by run_etch will override the config + # file, signal run_etch to leave out the --key option + run_etch(authserver, @testroot, :key => '', :testname => testname) + assert_equal(sourcecontents, get_file_contents(@targetfile)) + + # Tempfile will clean up the private key file, but not the associated + # public key file + FileUtils.rm_rf("#{keyfile.path}.pub") end def test_conf_path # # Test the path setting in etch.conf # - testname = 'etch.conf path setting' FileUtils.mkdir_p("#{@repodir}/source/#{@targetfile}") File.open("#{@repodir}/source/#{@targetfile}/config.xml", 'w') do |file| @@ -146,6 +278,8 @@ EOF end + testname = 'etch.conf path setting' + sourcecontents = "Test #{testname}\n" File.open("#{@repodir}/source/#{@targetfile}/source", 'w') do |file| file.write(sourcecontents) @@ -159,16 +293,18 @@ File.chmod(0755, "#{@repodir}/pathtest/testpost") # Test that it fails without an etch.conf path setting - run_etch(@server, @testroot) + testname = 'etch.conf path setting, not set' + run_etch(@server, @testroot, :testname => testname) assert(!File.exist?("#{@repodir}/pathtest/testpost.output")) + testname = 'etch.conf path setting, set' Dir.mkdir("#{@testroot}/etc") File.open("#{@testroot}/etc/etch.conf", 'w') do |file| file.puts "path = /bin:/usr/bin:/sbin:/usr/sbin:#{@repodir}/pathtest" end # And confirm that it now succeeds with an etch.conf path setting - run_etch(@server, @testroot) + run_etch(@server, @testroot, :testname => testname) assert(File.exist?("#{@repodir}/pathtest/testpost.output")) end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 08:23:43
|
Revision: 233 http://etch.svn.sourceforge.net/etch/?rev=233&view=rev Author: jheiss Date: 2010-12-18 08:23:37 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Fix typo in previous commit Modified Paths: -------------- trunk/client/etchclient.rb Modified: trunk/client/etchclient.rb =================================================================== --- trunk/client/etchclient.rb 2010-12-18 08:22:20 UTC (rev 232) +++ trunk/client/etchclient.rb 2010-12-18 08:23:37 UTC (rev 233) @@ -123,7 +123,7 @@ end end - if !File.readable(@key) + if !File.readable?(@key) @key = nil end if !@key This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 08:23:37
|
Revision: 230 http://etch.svn.sourceforge.net/etch/?rev=230&view=rev Author: jheiss Date: 2010-12-18 06:50:12 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Add dependency on searchlogic gem Modified Paths: -------------- trunk/server/config/environment.rb Modified: trunk/server/config/environment.rb =================================================================== --- trunk/server/config/environment.rb 2010-12-18 06:49:06 UTC (rev 229) +++ trunk/server/config/environment.rb 2010-12-18 06:50:12 UTC (rev 230) @@ -25,7 +25,8 @@ # config.gem "bj" # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net" # config.gem "aws-s3", :lib => "aws/s3" - config.gem 'will_paginate', :version => '~> 2.3.8' + config.gem 'will_paginate' + config.gem 'searchlogic' # Only load the plugins named here, in the order given. By default, all plugins # in vendor/plugins are loaded in alphabetical order. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 08:22:26
|
Revision: 232 http://etch.svn.sourceforge.net/etch/?rev=232&view=rev Author: jheiss Date: 2010-12-18 08:22:20 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Rearrange the warning about unreadable private keys so that it occurs after config file parsing as the config file might specify a non-standard key. Modified Paths: -------------- trunk/client/etchclient.rb Modified: trunk/client/etchclient.rb =================================================================== --- trunk/client/etchclient.rb 2010-12-18 06:50:50 UTC (rev 231) +++ trunk/client/etchclient.rb 2010-12-18 08:22:20 UTC (rev 232) @@ -123,6 +123,13 @@ end end + if !File.readable(@key) + @key = nil + end + if !@key + warn "No readable private key found, messages to server will not be signed and may be rejected depending on server configuration" + end + @origbase = File.join(@varbase, 'orig') @historybase = File.join(@varbase, 'history') @lockbase = File.join(@varbase, 'locks') @@ -2464,9 +2471,6 @@ break end end - if !key - warn "No readable private key found, messages to server will not be signed and may be rejected depending on server configuration" - end key end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 06:50:56
|
Revision: 231 http://etch.svn.sourceforge.net/etch/?rev=231&view=rev Author: jheiss Date: 2010-12-18 06:50:50 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Add index and show views for the models that were lacking any view. Added Paths: ----------- trunk/server/app/views/etch_configs/index.html.erb trunk/server/app/views/etch_configs/show.html.erb trunk/server/app/views/facts/index.html.erb trunk/server/app/views/facts/show.html.erb trunk/server/app/views/originals/index.html.erb trunk/server/app/views/originals/show.html.erb Added: trunk/server/app/views/etch_configs/index.html.erb =================================================================== --- trunk/server/app/views/etch_configs/index.html.erb (rev 0) +++ trunk/server/app/views/etch_configs/index.html.erb 2010-12-18 06:50:50 UTC (rev 231) @@ -0,0 +1,28 @@ +<%- @page_title = 'Configs' -%> + +<h1>Configs</h1> + +<div id="results_table"> +<%= will_paginate @etch_configs %> +<table cellspacing="0" class="styled"> + <thead> + <tr> + <th nowrap="nowrap" width="5%"> </th> + <th><%= order @search, :by => :client %></th> + <th><%= order @search, :by => :file %></th> + <th><%= order @search, :by => :updated_at %></th> + </tr> + </thead> + <tbody> + <%- @etch_configs.each do |etch_config| -%> + <tr class="<%= cycle('odd', 'even') -%>"> + <td nowrap="nowrap" width="5%"><%= link_to 'View', etch_config_path(etch_config) %></td> + <td><%= etch_config.client.name %></td> + <td><%= etch_config.file %></td> + <td><%= etch_config.updated_at %></td> + </tr> + <%- end -%> + </tbody> +</table> +</div> <!-- end results_table div --> + Added: trunk/server/app/views/etch_configs/show.html.erb =================================================================== --- trunk/server/app/views/etch_configs/show.html.erb (rev 0) +++ trunk/server/app/views/etch_configs/show.html.erb 2010-12-18 06:50:50 UTC (rev 231) @@ -0,0 +1,24 @@ +<%- @page_title = "Config" %> + +<div class="record_view"> + +<h1>Config</h1> + +<p> + <strong>Client:</strong> <%= link_to(@etch_config.client.name, client_path(@etch_config.client)) %><br /> + <strong>File:</strong> <%= @etch_config.file %><br /> +</p> + +<p> + <strong>Config:</strong><br /> + <pre><%= h @etch_config.config %></pre> +</p> + +<p class="metadata"> + <strong>Created at:</strong> <%= @etch_config.created_at %><br /> + <strong>Updated at:</strong> <%= @etch_config.updated_at %><br /> + <%= link_to 'Delete', etch_config_path(@etch_config), :confirm => 'Are you sure?', :method => :delete %></p> +</p> + +</div> + Added: trunk/server/app/views/facts/index.html.erb =================================================================== --- trunk/server/app/views/facts/index.html.erb (rev 0) +++ trunk/server/app/views/facts/index.html.erb 2010-12-18 06:50:50 UTC (rev 231) @@ -0,0 +1,28 @@ +<%- @page_title = 'Facts' -%> + +<h1>Facts</h1> + +<div id="results_table"> +<%= will_paginate @facts %> +<table cellspacing="0" class="styled"> + <thead> + <tr> + <th nowrap="nowrap" width="5%"> </th> + <th><%= order @search, :by => :client %></th> + <th><%= order @search, :by => :key %></th> + <th><%= order @search, :by => :updated_at %></th> + </tr> + </thead> + <tbody> + <%- @facts.each do |fact| -%> + <tr class="<%= cycle('odd', 'even') -%>"> + <td nowrap="nowrap" width="5%"><%= link_to 'View', fact_path(fact) %></td> + <td><%= fact.client.name %></td> + <td><%= fact.key %></td> + <td><%= fact.updated_at %></td> + </tr> + <%- end -%> + </tbody> +</table> +</div> <!-- end results_table div --> + Added: trunk/server/app/views/facts/show.html.erb =================================================================== --- trunk/server/app/views/facts/show.html.erb (rev 0) +++ trunk/server/app/views/facts/show.html.erb 2010-12-18 06:50:50 UTC (rev 231) @@ -0,0 +1,24 @@ +<%- @page_title = "Fact" %> + +<div class="record_view"> + +<h1>Fact</h1> + +<p> + <strong>Client:</strong> <%= link_to(@fact.client.name, client_path(@fact.client)) %><br /> + <strong>Key:</strong> <%= @fact.key %><br /> +</p> + +<p> + <strong>Value:</strong><br /> + <pre><%= h @fact.value %></pre> +</p> + +<p class="metadata"> + <strong>Created at:</strong> <%= @fact.created_at %><br /> + <strong>Updated at:</strong> <%= @fact.updated_at %><br /> + <%= link_to 'Delete', fact_path(@fact), :confirm => 'Are you sure?', :method => :delete %></p> +</p> + +</div> + Added: trunk/server/app/views/originals/index.html.erb =================================================================== --- trunk/server/app/views/originals/index.html.erb (rev 0) +++ trunk/server/app/views/originals/index.html.erb 2010-12-18 06:50:50 UTC (rev 231) @@ -0,0 +1,28 @@ +<%- @page_title = 'Originals' -%> + +<h1>Originals</h1> + +<div id="results_table"> +<%= will_paginate @originals %> +<table cellspacing="0" class="styled"> + <thead> + <tr> + <th nowrap="nowrap" width="5%"> </th> + <th><%= order @search, :by => :client %></th> + <th><%= order @search, :by => :file %></th> + <th><%= order @search, :by => :updated_at %></th> + </tr> + </thead> + <tbody> + <%- @originals.each do |original| -%> + <tr class="<%= cycle('odd', 'even') -%>"> + <td nowrap="nowrap" width="5%"><%= link_to 'View', original_path(original) %></td> + <td><%= original.client.name %></td> + <td><%= original.file %></td> + <td><%= original.updated_at %></td> + </tr> + <%- end -%> + </tbody> +</table> +</div> <!-- end results_table div --> + Added: trunk/server/app/views/originals/show.html.erb =================================================================== --- trunk/server/app/views/originals/show.html.erb (rev 0) +++ trunk/server/app/views/originals/show.html.erb 2010-12-18 06:50:50 UTC (rev 231) @@ -0,0 +1,20 @@ +<%- @page_title = "Original" %> + +<div class="record_view"> + +<h1>Original</h1> + +<p> + <strong>Client:</strong> <%= link_to(@original.client.name, client_path(@original.client)) %><br /> + <strong>File:</strong> <%= @original.file %><br /> + <strong>Checksum:</strong> <%= @original.sum %><br /> +</p> + +<p class="metadata"> + <strong>Created at:</strong> <%= @original.created_at %><br /> + <strong>Updated at:</strong> <%= @original.updated_at %><br /> + <%= link_to 'Delete', original_path(@original), :confirm => 'Are you sure?', :method => :delete %></p> +</p> + +</div> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 06:49:12
|
Revision: 229 http://etch.svn.sourceforge.net/etch/?rev=229&view=rev Author: jheiss Date: 2010-12-18 06:49:06 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Add searchlogic searching to controllers that didn't have search functionality. The clients and results controllers still have their homegrown search functionality that will need to be migrated to searchlogic at some point. Modified Paths: -------------- trunk/server/app/controllers/etch_configs_controller.rb trunk/server/app/controllers/facts_controller.rb trunk/server/app/controllers/originals_controller.rb Modified: trunk/server/app/controllers/etch_configs_controller.rb =================================================================== --- trunk/server/app/controllers/etch_configs_controller.rb 2010-12-18 02:02:52 UTC (rev 228) +++ trunk/server/app/controllers/etch_configs_controller.rb 2010-12-18 06:49:06 UTC (rev 229) @@ -1,9 +1,19 @@ +require 'intmax' + class EtchConfigsController < ApplicationController # GET /etch_configs def index - @etch_configs = EtchConfig.find :all - + # Clients requesting XML get no pagination (all entries) + per_page = EtchConfig.per_page # will_paginate's default value respond_to do |format| + format.html {} + format.xml { per_page = Integer::MAX } + end + + @search = EtchConfig.search(params[:search]) + @etch_configs = @search.paginate(:page => params[:page], :per_page => per_page) + + respond_to do |format| format.html # index.html.erb format.xml { render :xml => @etch_configs } end Modified: trunk/server/app/controllers/facts_controller.rb =================================================================== --- trunk/server/app/controllers/facts_controller.rb 2010-12-18 02:02:52 UTC (rev 228) +++ trunk/server/app/controllers/facts_controller.rb 2010-12-18 06:49:06 UTC (rev 229) @@ -1,9 +1,19 @@ +require 'intmax' + class FactsController < ApplicationController # GET /facts def index - @facts = Fact.find :all - + # Clients requesting XML get no pagination (all entries) + per_page = Fact.per_page # will_paginate's default value respond_to do |format| + format.html {} + format.xml { per_page = Integer::MAX } + end + + @search = Fact.search(params[:search]) + @facts = @search.paginate(:page => params[:page], :per_page => per_page) + + respond_to do |format| format.html # index.html.erb format.xml { render :xml => @facts } end Modified: trunk/server/app/controllers/originals_controller.rb =================================================================== --- trunk/server/app/controllers/originals_controller.rb 2010-12-18 02:02:52 UTC (rev 228) +++ trunk/server/app/controllers/originals_controller.rb 2010-12-18 06:49:06 UTC (rev 229) @@ -1,9 +1,19 @@ +require 'intmax' + class OriginalsController < ApplicationController # GET /originals def index - @originals = Original.find :all - + # Clients requesting XML get no pagination (all entries) + per_page = Original.per_page # will_paginate's default value respond_to do |format| + format.html {} + format.xml { per_page = Integer::MAX } + end + + @search = Original.search(params[:search]) + @originals = @search.paginate(:page => params[:page], :per_page => per_page) + + respond_to do |format| format.html # index.html.erb format.xml { render :xml => @originals } end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 02:02:58
|
Revision: 228 http://etch.svn.sourceforge.net/etch/?rev=228&view=rev Author: jheiss Date: 2010-12-18 02:02:52 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Update more info URL in the comments. Modified Paths: -------------- trunk/etchserver-samples/nodegrouper trunk/etchserver-samples/nodetagger Modified: trunk/etchserver-samples/nodegrouper =================================================================== --- trunk/etchserver-samples/nodegrouper 2010-12-18 01:41:58 UTC (rev 227) +++ trunk/etchserver-samples/nodegrouper 2010-12-18 02:02:52 UTC (rev 228) @@ -2,5 +2,5 @@ # The nodegrouper script can be used to query an external data source # for node group assignments. -# http://etch.wiki.sourceforge.net/NodeGroups +# http://sourceforge.net/apps/trac/etch/wiki/NodeGroups Modified: trunk/etchserver-samples/nodetagger =================================================================== --- trunk/etchserver-samples/nodetagger 2010-12-18 01:41:58 UTC (rev 227) +++ trunk/etchserver-samples/nodetagger 2010-12-18 02:02:52 UTC (rev 228) @@ -2,5 +2,5 @@ # The nodetagger script can be used to implement a controlled deployment # scheme. -# http://etch.wiki.sourceforge.net/ControlledDeployment +# http://sourceforge.net/apps/trac/etch/wiki/ControlledDeployment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-12-18 01:42:04
|
Revision: 227 http://etch.svn.sourceforge.net/etch/?rev=227&view=rev Author: jheiss Date: 2010-12-18 01:41:58 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Set the postinstall/postremove scripts to be executable when building the Solaris packages. Modified Paths: -------------- trunk/client/Rakefile Modified: trunk/client/Rakefile =================================================================== --- trunk/client/Rakefile 2010-11-29 18:12:42 UTC (rev 226) +++ trunk/client/Rakefile 2010-12-18 01:41:58 UTC (rev 227) @@ -230,8 +230,10 @@ cp('depend', 'solbuild/depend') prototype.puts("i depend=./depend") cp('postinstall.solaris', 'solbuild/postinstall') + chmod(0555, 'solbuild/postinstall') prototype.puts("i postinstall=./postinstall") cp('postremove.solaris', 'solbuild/postremove') + chmod(0555, 'solbuild/postremove') prototype.puts("i postremove=./postremove") # The tail +2 removes the first line, which is the base directory # and doesn't need to be included in the package. @@ -319,8 +321,10 @@ cp('depend', 'solbuild/depend') prototype.puts("i depend=./depend") cp('postinstall.solaris', 'solbuild/postinstall') + chmod(0555, 'solbuild/postinstall') prototype.puts("i postinstall=./postinstall") cp('postremove.solaris', 'solbuild/postremove') + chmod(0555, 'solbuild/postremove') prototype.puts("i postremove=./postremove") # The tail +2 removes the first line, which is the base directory # and doesn't need to be included in the package. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-11-29 18:12:48
|
Revision: 226 http://etch.svn.sourceforge.net/etch/?rev=226&view=rev Author: jheiss Date: 2010-11-29 18:12:42 +0000 (Mon, 29 Nov 2010) Log Message: ----------- Set this to a more reasonable value for the general public. Modified Paths: -------------- trunk/server/config/unicorn.rb Modified: trunk/server/config/unicorn.rb =================================================================== --- trunk/server/config/unicorn.rb 2010-11-25 00:07:42 UTC (rev 225) +++ trunk/server/config/unicorn.rb 2010-11-29 18:12:42 UTC (rev 226) @@ -1,4 +1,4 @@ -worker_processes(20) +worker_processes(8) stdout_path('log/unicorn_stdout') stderr_path('log/unicorn_stderr') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-11-25 00:07:50
|
Revision: 225 http://etch.svn.sourceforge.net/etch/?rev=225&view=rev Author: jheiss Date: 2010-11-25 00:07:42 +0000 (Thu, 25 Nov 2010) Log Message: ----------- https://sourceforge.net/apps/trac/etch/ticket/8 Add support for an /etc/etch.conf config file to the client. This allows users to set the etch server, the directory to use for local configuration (if desired instead of using a server), and the SSH key permanently. These were previously only configurable on the command line. The config file also allows the user to set a PATH that will be in force for any commands etch runs. The PATH was previously hard-coded in the client. In Etch::Client.initialize replace the :varbase option with :file_system_root. The :varbase option allowed the test suite to specify an alternative to /var/etch for the client so that the test suite doesn't have to run as root and doesn't interfere with actual etch client usage on the system where the test suite is run. The replacement :file_system_root option allows the test suite to define a base directory under which the client will look for both /var/etch and /etc/etch.conf. This allows the test suite to test various config file settings, again without interfering with actual etch client usage on the development system. Change --test-base to --test-root in the etch executable to reflect the Etch::Client option change. In the start_server method in the test suite implement a check that the server has started up before returning, rather than sleeping for 5 seconds and hoping that is enough time. Under heavy load it sometimes isn't enough time, causing the test suite to fail unnecessarily. And under light load the server starts up much quicker than 5 seconds, so it is nice to not have to wait around unnecessarily. Update the run_etch method in the test suite to take optional arguments in an options hash, rather than as individual arguments. This cleans up the method signature and makes the code that calls run_etch more self-documenting. Added options to allow callers to override the --server and --key options passed to etch, and an option for specifying the testname so that we can pass that to assert. Modified Paths: -------------- trunk/client/Rakefile trunk/client/etch trunk/client/etchclient.rb trunk/test/etchtest.rb trunk/test/test_actions.rb trunk/test/test_attributes.rb trunk/test/test_auth.rb trunk/test/test_commands.rb trunk/test/test_delete.rb trunk/test/test_depend.rb trunk/test/test_file.rb trunk/test/test_history.rb trunk/test/test_link.rb trunk/test/test_local_requests.rb trunk/test/test_nodegroups.rb trunk/test/test_options.rb trunk/test/test_outputcapture.rb trunk/test/test_scripts.rb trunk/test/test_transitions.rb Added Paths: ----------- trunk/client/etch.conf trunk/test/test_conf.rb Modified: trunk/client/Rakefile =================================================================== --- trunk/client/Rakefile 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/client/Rakefile 2010-11-25 00:07:42 UTC (rev 225) @@ -81,10 +81,9 @@ if options[:etcdir] etcdir = File.join(destdir, options[:etcdir]) - # FIXME: Need to add support for etch.conf to the code - #mkdir_p(etcdir) - #cp('etch.conf', etcdir, :preserve => true) - #chmod(0644, File.join(etcdir, 'etch.conf')) + mkdir_p(etcdir) + cp('etch.conf', etcdir, :preserve => true) + chmod(0644, File.join(etcdir, 'etch.conf')) # All of the supporting config files go into a subdirectory etcetchdir = File.join(etcdir, 'etch') mkdir_p(etcetchdir) Modified: trunk/client/etch =================================================================== --- trunk/client/etch 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/client/etch 2010-11-25 00:07:42 UTC (rev 225) @@ -62,8 +62,8 @@ opts.on('--key PRIVATE_KEY', 'Use this private key for signing messages to server.') do |opt| options[:key] = opt end -opts.on('--test-base TESTDIR', 'Use an alternate local working directory.') do |opt| - options[:varbase] = opt +opts.on('--test-root TESTDIR', 'For use by the test suite only.') do |opt| + options[:file_system_root] = opt end opts.on('--debug', 'Print lots of messages about what etch is doing.') do |opt| options[:debug] = opt Added: trunk/client/etch.conf =================================================================== --- trunk/client/etch.conf (rev 0) +++ trunk/client/etch.conf 2010-11-25 00:07:42 UTC (rev 225) @@ -0,0 +1,18 @@ +# The default server url is https://etch +#server = https://etch + +# Etch is usually run from cron, and cron usually executes jobs with a very +# minimal PATH environment variable setting. You may want etch to have a more +# complete PATH setting so that pre and post commands are more readily found. +#path = /bin:/usr/bin:/sbin:/usr/sbin + +# Etch can read configuration from a local directory rather than from a +# server. If set this will override the server setting. +#local = /var/etch/configs + +# Etch will try to find an SSH host key and use it to sign all requests to the +# etch server. Several standard locations for SSH keys are searched by +# default, if your key is not in a standard location you can point etch to it. +# See https://sourceforge.net/apps/trac/etch/wiki/ClientAuthentication +#key = /etc/ssh/ssh_host_rsa_key + Modified: trunk/client/etchclient.rb =================================================================== --- trunk/client/etchclient.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/client/etchclient.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -41,7 +41,8 @@ CONFIRM_SKIP = 2 CONFIRM_QUIT = 3 PRIVATE_KEY_PATHS = ["/etc/ssh/ssh_host_rsa_key", "/etc/ssh_host_rsa_key"] - CONFIGDIR = '/etc' + DEFAULT_CONFIGDIR = '/etc' + DEFAULT_VARBASE = '/var/etch' # We need these in relation to the output capturing ORIG_STDOUT = STDOUT.dup @@ -52,7 +53,6 @@ def initialize(options) @server = options[:server] ? options[:server] : 'https://etch' @tag = options[:tag] - @varbase = options[:varbase] ? options[:varbase] : '/var/etch' @local = options[:local] ? File.expand_path(options[:local]) : nil @debug = options[:debug] @dryrun = options[:dryrun] @@ -63,11 +63,66 @@ @disableforce = options[:disableforce] @lockforce = options[:lockforce] - # Ensure we have a sane path, particularly since we are often run from - # cron. - # FIXME: Read from config file - ENV['PATH'] = '/bin:/usr/bin:/sbin:/usr/sbin:/opt/csw/bin:/opt/csw/sbin' + @configdir = DEFAULT_CONFIGDIR + @varbase = DEFAULT_VARBASE + @file_system_root = '/' # Not sure if this needs to be more portable + # This option is only intended for use by the test suite + if options[:file_system_root] + @file_system_root = options[:file_system_root] + @varbase = File.join(@file_system_root, @varbase) + @configdir = File.join(@file_system_root, @configdir) + end + + @configfile = File.join(@configdir, 'etch.conf') + + if File.exist?(@configfile) + IO.foreach(@configfile) do |line| + line.chomp! + next if (line =~ /^\s*$/); # Skip blank lines + next if (line =~ /^\s*#/); # Skip comments + line.strip! # Remove leading/trailing whitespace + key, value = line.split(/\s*=\s*/, 2) + if key == 'server' + # A setting for the server to use which comes from upstream + # (generally from a command line option) takes precedence + # over the config file + if !options[:server] + @server = value + # Warn the user, as this could potentially be confusing + # if they don't realize there's a config file lying + # around + warn "Using server #{@server} from #{@configfile}" if @debug + else + # "command line override" isn't necessarily accurate, we don't + # know why the caller passed us an option to override the config + # file, but most of the time it will be due to a command line + # option and I want the message to be easily understood by users. + # If someone can come up with some better wording without turning + # the message into something as long as this comment that would be + # welcome. + warn "Ignoring 'server' option in #{@configfile} due to command line override" if @debug + end + elsif key == 'local' + if !options[:local] && !options[:server] + @local = value + warn "Using local directory #{@local} from #{@configfile}" if @debug + else + warn "Ignoring 'local' option in #{@configfile} due to command line override" if @debug + end + elsif key == 'key' + if !options[:key] + @key = value + warn "Using key #{@key} from #{@configfile}" if @debug + else + warn "Ignoring 'key' option in #{@configfile} due to command line override" if @debug + end + elsif key == 'path' + ENV['PATH'] = value + end + end + end + @origbase = File.join(@varbase, 'orig') @historybase = File.join(@varbase, 'history') @lockbase = File.join(@varbase, 'locks') @@ -141,17 +196,17 @@ http = Net::HTTP.new(@filesuri.host, @filesuri.port) if @filesuri.scheme == "https" # Eliminate the OpenSSL "using default DH parameters" warning - if File.exist?(File.join(CONFIGDIR, 'etch', 'dhparams')) - dh = OpenSSL::PKey::DH.new(IO.read(File.join(CONFIGDIR, 'etch', 'dhparams'))) + if File.exist?(File.join(@configdir, 'etch', 'dhparams')) + dh = OpenSSL::PKey::DH.new(IO.read(File.join(@configdir, 'etch', 'dhparams'))) Net::HTTP.ssl_context_accessor(:tmp_dh_callback) http.tmp_dh_callback = proc { dh } end http.use_ssl = true - if File.exist?(File.join(CONFIGDIR, 'etch', 'ca.pem')) - http.ca_file = File.join(CONFIGDIR, 'etch', 'ca.pem') + if File.exist?(File.join(@configdir, 'etch', 'ca.pem')) + http.ca_file = File.join(@configdir, 'etch', 'ca.pem') http.verify_mode = OpenSSL::SSL::VERIFY_PEER - elsif File.directory?(File.join(CONFIGDIR, 'etch', 'ca')) - http.ca_path = File.join(CONFIGDIR, 'etch', 'ca') + elsif File.directory?(File.join(@configdir, 'etch', 'ca')) + http.ca_path = File.join(@configdir, 'etch', 'ca') http.verify_mode = OpenSSL::SSL::VERIFY_PEER end end Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/etchtest.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -5,6 +5,7 @@ require 'test/unit' require 'tempfile' require 'fileutils' +require 'net/http' module EtchTests # Roughly ../server and ../client @@ -104,9 +105,26 @@ # Pick a random port in the 3001-6000 range (range somewhat randomly chosen) port = 3001 + rand(3000) if pid = fork - # FIXME: replace this with a check that the server has started - puts "Giving the server some time to start up" - sleep(5) + # Give the server up to 30s to start, checking every second + serverstarted = false + catch :serverstarted do + 30.times do + begin + Net::HTTP.start('localhost', port) do |http| + response = http.head("/") + if response.kind_of?(Net::HTTPSuccess) + serverstarted = true + throw :serverstarted + end + end + rescue => e + end + sleep(1) + end + end + if !serverstarted + raise "Etch server failed to start" + end else if UNICORN exec("cd #{SERVERDIR} && unicorn_rails -p #{port}") @@ -122,12 +140,29 @@ Process.waitpid(server[:pid]) end - def run_etch(server, testbase, errors_expected=false, extra_args='', port=nil) - extra_args = extra_args + " --debug" - if !port - port = server[:port] + def run_etch(server, testroot, options={}) + extra_args = '' + if options[:extra_args] + extra_args += options[:extra_args] end - if errors_expected + extra_args += " --debug" + + port = server[:port] + if options[:port] + port = options[:port] + end + + server = "--server=http://localhost:#{port}" + if options[:server] + server = options[:server] + end + + key = "--key=#{File.dirname(__FILE__)}/keys/testkey" + if options[:key] + key = options[:key] + end + + if options[:errors_expected] # Warn the user that errors are expected. Otherwise it can be # disconcerting if you're watching the tests run and see errors. #sleep 3 @@ -136,11 +171,11 @@ puts "#" #sleep 3 end - result = system("ruby #{CLIENTDIR}/etch --generate-all --server=http://localhost:#{port} --test-base=#{testbase} --key=#{File.dirname(__FILE__)}/keys/testkey #{extra_args}") - if errors_expected - assert(!result) + result = system("ruby #{CLIENTDIR}/etch --generate-all --test-root=#{testroot} #{server} #{key} #{extra_args}") + if options[:errors_expected] + assert(!result, options[:testname]) else - assert(result) + assert(result, options[:testname]) end end Modified: trunk/test/test_actions.rb =================================================================== --- trunk/test/test_actions.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_actions.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -19,8 +19,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" # Generate another file to use as our link target @destfile = released_tempfile @@ -76,7 +76,7 @@ # Run etch #puts "Running initial action test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the actions were executed # The setup actions will get run several times as we loop @@ -100,7 +100,7 @@ # Run etch again and make sure that the exec_once command wasn't run # again - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal("exec_once\n", get_file_contents("#{@repodir}/exec_once"), 'exec_once_2nd_check') end @@ -142,7 +142,7 @@ # Run etch #puts "Running initial action test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the file was not touched assert_equal(origcontents, get_file_contents(@targetfile), 'failed setup') @@ -185,7 +185,7 @@ # Run etch #puts "Running failed pre test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the file was not touched assert_equal(origcontents, get_file_contents(@targetfile), 'failed pre') @@ -234,7 +234,7 @@ # Run etch #puts "Running failed test test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the original was restored, and that post was run twice assert_equal(origcontents, get_file_contents(@targetfile), 'failed test target') @@ -270,7 +270,7 @@ # Run etch #puts "Running failed test_before_post test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that post was not run assert(!File.exist?("#{@repodir}/post"), 'failed test_before_post post') @@ -286,7 +286,7 @@ # Run etch #puts "Running failed test symlink test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the original symlink was restored assert_equal(@destfile, File.readlink(@targetfile), 'failed test symlink') @@ -303,7 +303,7 @@ # Run etch #puts "Running failed test directory test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the original directory was restored assert(File.directory?(@targetfile), 'failed test directory') @@ -325,7 +325,7 @@ # Run etch #puts "Running failed test no original file test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the lack of an original file was restored assert(!File.exist?(@targetfile) && !File.symlink?(@targetfile), 'failed test no original file') @@ -372,7 +372,7 @@ # Run etch #puts "Running nested target with test test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(nestedtargetfile), 'nested target with test') @@ -415,7 +415,7 @@ # Run etch #puts "Running XML escape test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the action was executed assert_equal("post\n", get_file_contents("#{@repodir}/post_with_escape"), 'post with escape') @@ -458,7 +458,7 @@ # Run etch #puts "Running environment variable test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the action was executed assert_equal("testvalue\n", get_file_contents("#{@repodir}/post_with_env_output"), 'post with environment variable') @@ -466,7 +466,7 @@ def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) FileUtils.rm_f(@destfile) end Modified: trunk/test/test_attributes.rb =================================================================== --- trunk/test/test_attributes.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_attributes.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -21,8 +21,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" end def test_group_attributes @@ -58,9 +58,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was not modified assert_equal(origcontents, get_file_contents(@targetfile), testname) @@ -89,9 +87,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -134,9 +130,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -173,9 +167,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was not modified assert_equal(origcontents, get_file_contents(@targetfile), testname) @@ -204,9 +196,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -250,9 +240,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -289,9 +277,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was not modified assert_equal(origcontents, get_file_contents(@targetfile), testname) @@ -320,9 +306,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -359,9 +343,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -398,9 +380,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was not modified assert_equal(origcontents, get_file_contents(@targetfile), testname) @@ -429,9 +409,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -468,9 +446,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was not modified assert_equal(origcontents, get_file_contents(@targetfile), testname) @@ -509,9 +485,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -548,9 +522,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was not modified assert_equal(origcontents, get_file_contents(@targetfile), testname) @@ -584,9 +556,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -615,9 +585,7 @@ file.write(sourcecontents) end - # Run etch - #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot, :testname => testname) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -626,7 +594,7 @@ def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) end end Modified: trunk/test/test_auth.rb =================================================================== --- trunk/test/test_auth.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_auth.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -32,8 +32,8 @@ @server = start_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" # Make sure the server will initially think this is a new client hostname = Facter['fqdn'].value @@ -91,7 +91,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -122,7 +122,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -161,7 +161,7 @@ # Run etch with the wrong key to force a bad signature #puts "Running '#{testname}' test" - run_etch(@server, @testbase, true, "--key=#{File.join(File.dirname(__FILE__), 'keys', 'testkey2')}") + run_etch(@server, @testroot, :errors_expected => true, :key => "--key=#{File.join(File.dirname(__FILE__), 'keys', 'testkey2')}") # Verify that the file was not touched assert_equal(origcontents, get_file_contents(@targetfile), testname) @@ -206,7 +206,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the file was not touched assert_equal(origcontents, get_file_contents(@targetfile), testname) @@ -219,7 +219,7 @@ sleep 3 repodir2 = initialize_repository server2 = start_server(repodir2) - run_etch(server2, @testbase) + run_etch(server2, @testroot) stop_server(server2) remove_repository(repodir2) @@ -249,7 +249,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -258,7 +258,7 @@ def teardown stop_server(@server) remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) end end Modified: trunk/test/test_commands.rb =================================================================== --- trunk/test/test_commands.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_commands.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -19,8 +19,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" end def test_commands_basic @@ -47,7 +47,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(testname, get_file_contents(@targetfile), testname) @@ -76,10 +76,8 @@ end # Run etch - # The assertion here is handled by run_etch as we're passing it an - # argument indicating that we expect failure. #puts "Running '#{testname}' test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) end def test_commands_guard_succeeds @@ -108,7 +106,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was not touched assert_equal(testname, get_file_contents(@targetfile), testname) @@ -146,7 +144,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that both steps ran and in the proper order assert_equal("firststep\nsecondstep\n", get_file_contents(@targetfile), testname) @@ -191,7 +189,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that both commands ran, ordering doesn't matter assert_equal(['firstcmd', 'secondcmd'], get_file_contents(@targetfile).split("\n").sort, testname) @@ -237,7 +235,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that both commands ran and in the proper order assert_equal("firstcmd\nsecondcmd\n", get_file_contents(@targetfile), testname) @@ -291,7 +289,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the command-generated file and the regular file were created # properly @@ -336,7 +334,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that only the desired step executed assert_equal("notingroup\n", get_file_contents(@targetfile), testname) @@ -360,15 +358,13 @@ end # Run etch - # The assertion here is handled by run_etch as we're passing it an - # argument indicating that we expect failure. #puts "Running '#{testname}' test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) end def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) end end Added: trunk/test/test_conf.rb =================================================================== --- trunk/test/test_conf.rb (rev 0) +++ trunk/test/test_conf.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -0,0 +1,180 @@ +#!/usr/bin/ruby -w + +# +# Test etch's handling of its configuration file, etch.conf +# + +require File.join(File.dirname(__FILE__), 'etchtest') + +class EtchConfTests < Test::Unit::TestCase + include EtchTests + + def setup + # Generate a file to use as our etch target/destination + @targetfile = released_tempfile + #puts "Using #{@targetfile} as target file" + + # Generate a directory for our test repository + @repodir = initialize_repository + @server = get_server(@repodir) + + # Create a directory to use as a working directory for the client + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" + end + + def test_conf_server + # + # Test the server setting in etch.conf + # + testname = 'etch.conf server setting' + + FileUtils.mkdir_p("#{@repodir}/source/#{@targetfile}") + File.open("#{@repodir}/source/#{@targetfile}/config.xml", 'w') do |file| + file.puts <<-EOF + <config> + <file> + <warning_file></warning_file> + <source> + <plain>source</plain> + </source> + </file> + </config> + EOF + end + + sourcecontents = "Test #{testname}\n" + File.open("#{@repodir}/source/#{@targetfile}/source", 'w') do |file| + file.write(sourcecontents) + end + + # Test that it fails with a bogus etch.conf server setting + Dir.mkdir("#{@testroot}/etc") + File.open("#{@testroot}/etc/etch.conf", 'w') do |file| + file.puts "server = http://bogushost:0" + end + + # The --server option normally used by run_etch will override the config + # file, signal run_etch to leave out the --server option + run_etch(@server, @testroot, :server => '', :errors_expected => true) + + # And confirm that it now succeeds with a correct etch.conf server setting + File.open("#{@testroot}/etc/etch.conf", 'w') do |file| + file.puts "server = http://localhost:#{@server[:port]}" + end + + # The --server option normally used by run_etch will override the config + # file, signal run_etch to leave out the --server option + run_etch(@server, @testroot, :server => '') + assert_equal(sourcecontents, get_file_contents(@targetfile)) + end + + def test_conf_local + # + # Test the local setting in etch.conf + # + testname = 'etch.conf local setting' + + FileUtils.mkdir_p("#{@repodir}/source/#{@targetfile}") + File.open("#{@repodir}/source/#{@targetfile}/config.xml", 'w') do |file| + file.puts <<-EOF + <config> + <file> + <warning_file></warning_file> + <source> + <plain>source</plain> + </source> + </file> + </config> + EOF + end + + sourcecontents = "Test #{testname}\n" + File.open("#{@repodir}/source/#{@targetfile}/source", 'w') do |file| + file.write(sourcecontents) + end + + # Test that it fails with a bogus etch.conf local setting + Dir.mkdir("#{@testroot}/etc") + File.open("#{@testroot}/etc/etch.conf", 'w') do |file| + file.puts "local = /not/a/valid/path" + end + + # Although the config file local setting will override it, tell run_etch + # to leave out the --server option to avoid confusion + run_etch(@server, @testroot, :server => '', :errors_expected => true) + + # And confirm that it now succeeds with a correct etch.conf local setting + File.open("#{@testroot}/etc/etch.conf", 'w') do |file| + file.puts "local = #{@repodir}" + end + + # Although the config file local setting will override it, tell run_etch + # to leave out the --server option to avoid confusion + run_etch(@server, @testroot, :server => '') + assert_equal(sourcecontents, get_file_contents(@targetfile)) + end + + def test_conf_key + # FIXME + + # The --key option normally used by run_etch will override the config + # file, signal run_etch to leave out the --key option + #run_etch(@server, @testroot, :key => '') + end + + def test_conf_path + # + # Test the path setting in etch.conf + # + testname = 'etch.conf path setting' + + FileUtils.mkdir_p("#{@repodir}/source/#{@targetfile}") + File.open("#{@repodir}/source/#{@targetfile}/config.xml", 'w') do |file| + file.puts <<-EOF + <config> + <file> + <warning_file></warning_file> + <source> + <plain>source</plain> + </source> + </file> + <post> + <exec>testpost</exec> + </post> + </config> + EOF + end + + sourcecontents = "Test #{testname}\n" + File.open("#{@repodir}/source/#{@targetfile}/source", 'w') do |file| + file.write(sourcecontents) + end + + Dir.mkdir("#{@repodir}/pathtest") + File.open("#{@repodir}/pathtest/testpost", 'w') do |file| + file.puts '#!/bin/sh' + file.puts "touch #{@repodir}/pathtest/testpost.output" + end + File.chmod(0755, "#{@repodir}/pathtest/testpost") + + # Test that it fails without an etch.conf path setting + run_etch(@server, @testroot) + assert(!File.exist?("#{@repodir}/pathtest/testpost.output")) + + Dir.mkdir("#{@testroot}/etc") + File.open("#{@testroot}/etc/etch.conf", 'w') do |file| + file.puts "path = /bin:/usr/bin:/sbin:/usr/sbin:#{@repodir}/pathtest" + end + + # And confirm that it now succeeds with an etch.conf path setting + run_etch(@server, @testroot) + assert(File.exist?("#{@repodir}/pathtest/testpost.output")) + end + + def teardown + remove_repository(@repodir) + FileUtils.rm_rf(@testroot) + FileUtils.rm_rf(@targetfile) + end +end Modified: trunk/test/test_delete.rb =================================================================== --- trunk/test/test_delete.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_delete.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -19,8 +19,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" # Generate another file to use as our link target @destfile = released_tempfile @@ -47,7 +47,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was deleted assert(!File.exist?(@targetfile) && !File.symlink?(@targetfile), testname) @@ -73,7 +73,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the link was deleted assert(!File.exist?(@targetfile) && !File.symlink?(@targetfile), testname) @@ -101,7 +101,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the directory was not deleted assert(File.directory?(@targetfile), testname) @@ -130,7 +130,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the directory was deleted assert(!File.exist?(@targetfile) && !File.symlink?(@targetfile), testname) @@ -153,7 +153,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that we still don't have a file. That's rather unlikely, # this is really more a test that etch doesn't throw an error if @@ -187,7 +187,7 @@ # Run etch #puts "Running duplicate script instructions test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert(!File.exist?(@targetfile), 'duplicate script instructions') @@ -220,7 +220,7 @@ # Run etch #puts "Running contradictory script instructions test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the file wasn't removed assert(File.exist?(@targetfile), 'contradictory script instructions') @@ -229,7 +229,7 @@ def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) FileUtils.rm_rf(@destfile) end Modified: trunk/test/test_depend.rb =================================================================== --- trunk/test/test_depend.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_depend.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -21,8 +21,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" end def test_depends @@ -76,7 +76,7 @@ # Run etch #puts "Running initial dependency test" - run_etch(@server, @testbase, false) + run_etch(@server, @testroot) # Verify that the files were created properly assert_equal(sourcecontents, get_file_contents(@targetfile), 'dependency file 1') @@ -138,7 +138,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase, false, @targetfile) + run_etch(@server, @testroot, :extra_args => @targetfile) # Verify that the files were created properly assert_equal(sourcecontents, get_file_contents(@targetfile), 'single request dependency file 1') @@ -202,7 +202,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase, true, @targetfile) + run_etch(@server, @testroot, :errors_expected => true, :extra_args => @targetfile) # Verify that the files weren't modified assert_equal(origcontents, get_file_contents(@targetfile), 'circular dependency file 1') @@ -256,7 +256,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the regular file and the command-generated file were created # properly @@ -268,7 +268,7 @@ def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) end end Modified: trunk/test/test_file.rb =================================================================== --- trunk/test/test_file.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_file.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -19,8 +19,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" end def test_files @@ -49,7 +49,7 @@ # Run etch #puts "Running initial file test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly correctcontents = '' @@ -86,7 +86,7 @@ # Run etch #puts "Running initial file test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly correctcontents = '' @@ -127,7 +127,7 @@ # Run etch #puts "Running different warning file test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly correctcontents = '' @@ -164,7 +164,7 @@ # Run etch #puts "Running no warning file test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), 'no warning file') @@ -194,7 +194,7 @@ # Run etch #puts "Running different line comment test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly correctcontents = '' @@ -233,7 +233,7 @@ # Run etch #puts "Running comment open/close test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly correctcontents = "/*\n" @@ -273,7 +273,7 @@ # Run etch #puts "Running warning on second line test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly correctcontents = sourcecontents_firstline @@ -311,7 +311,7 @@ # Run etch #puts "Running no space around warning test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly correctcontents = '' @@ -344,7 +344,7 @@ # Run etch #puts "Running file ownership and permissions test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file ownership got set correctly # Most systems don't support give-away chown, so this test won't work @@ -380,7 +380,7 @@ # Run etch #puts "Running file ownership w/ bogus owner/group names" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the ownership defaulted to UID/GID 0 # Most systems don't support give-away chown, so this test won't work @@ -416,7 +416,7 @@ # Run etch #puts "Running always_manage_metadata test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file permissions got set correctly perms = File.stat(@targetfile).mode & 07777 @@ -456,7 +456,7 @@ # Run etch #puts "Running duplicate plain instructions test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file contents were updated assert_equal(sourcecontents, get_file_contents(@targetfile), 'duplicate plain instructions') @@ -495,7 +495,7 @@ # Run etch #puts "Running contradictory plain instructions test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the file contents didn't change assert_equal(origcontents, get_file_contents(@targetfile), 'contradictory plain instructions') @@ -531,7 +531,7 @@ # Run etch #puts "Running duplicate template instructions test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file contents were updated assert_equal(sourcecontents, get_file_contents(@targetfile), 'duplicate template instructions') @@ -570,7 +570,7 @@ # Run etch #puts "Running contradictory template instructions test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the file contents didn't change assert_equal(origcontents, get_file_contents(@targetfile), 'contradictory template instructions') @@ -606,7 +606,7 @@ # Run etch #puts "Running duplicate script instructions test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file contents were updated assert_equal(sourcecontents, get_file_contents(@targetfile), 'duplicate script instructions') @@ -645,7 +645,7 @@ # Run etch #puts "Running contradictory script instructions test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the file contents didn't change assert_equal(origcontents, get_file_contents(@targetfile), 'contradictory script instructions') @@ -684,7 +684,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(specialtargetfile), testname) @@ -692,7 +692,7 @@ def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) end end Modified: trunk/test/test_history.rb =================================================================== --- trunk/test/test_history.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_history.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -20,11 +20,11 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" - @origfile = File.join(@testbase, 'orig', "#{@targetfile}.ORIG") - @historydir = File.join(@testbase, 'history', "#{@targetfile}.HISTORY") + @origfile = File.join(@testroot, 'var', 'etch', 'orig', "#{@targetfile}.ORIG") + @historydir = File.join(@testroot, 'var', 'etch', 'history', "#{@targetfile}.HISTORY") end def test_history @@ -60,7 +60,7 @@ # Run etch #puts "Running initial history test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(origcontents, get_file_contents(@origfile), 'original backup of file') assert_equal(origcontents, get_file_contents(File.join(@historydir, '0000')), '0000 history file') @@ -77,7 +77,7 @@ # Run etch #puts "Running update test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(origcontents, get_file_contents(@origfile), 'original backup of file unchanged') assert_equal(origcontents, get_file_contents(File.join(@historydir, '0000')), '0000 history file') @@ -107,7 +107,7 @@ # Run etch #puts "Running revert test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(origcontents, get_file_contents(@targetfile), 'original contents reverted') assert(!File.exist?(@origfile), 'reverted original file') @@ -128,7 +128,7 @@ # Run etch #puts "Running revert test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(updatedorigcontents, get_file_contents(@targetfile), 'Updated original contents unchanged') assert(!File.exist?(@origfile), 'reverted original file') @@ -177,7 +177,7 @@ # Run etch #puts "Running history setup test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(origcontents + "\n", get_file_contents(@origfile), 'original backup of file via setup') assert_equal(sourcecontents + origcontents + "\n", get_file_contents(@targetfile), 'contents using original backup of file via setup') @@ -217,7 +217,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) origcontents = "This is the original text for #{testname}" @@ -245,7 +245,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(origcontents + "\n", get_file_contents(@origfile), testname) end @@ -283,7 +283,7 @@ # Run etch #puts "Running history link test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(@destfile, File.readlink(@origfile), 'original backup of link') assert_match("#{@targetfile} -> #{@destfile}", get_file_contents(File.join(@historydir, '0000')), '0000 history file of link') @@ -328,7 +328,7 @@ # Run etch #puts "Running history directory test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert(File.directory?(@origfile), 'original backup of directory') # Verify that etch backed up the original directory properly @@ -347,7 +347,7 @@ # differently in that case # - origtarfile = File.join(@testbase, 'orig', "#{@targetfile}.TAR") + origtarfile = File.join(@testroot, 'var', 'etch', 'orig', "#{@targetfile}.TAR") # Make the original target a directory File.delete(@targetfile) @@ -376,7 +376,7 @@ # Run etch #puts "Running history directory contents test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # In this case, because we converted a directory to something else the # original will be a tarball of the directory @@ -445,7 +445,7 @@ # Run etch #puts "Running history conversion test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(mockorigcontents, get_file_contents(File.join(@historydir, '0000')), 'RCS conv 0000 history file') assert_equal(mocksourcecontents, get_file_contents(File.join(@historydir, '0001')), 'RCS conv 0001 history file') @@ -454,7 +454,7 @@ def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) end end Modified: trunk/test/test_link.rb =================================================================== --- trunk/test/test_link.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_link.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -24,8 +24,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" # Generate a couple more files to use as our link targets @destfile = released_tempfile @@ -51,7 +51,7 @@ # Run etch #puts "Running initial link test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(@destfile, File.readlink(@targetfile), 'link create') @@ -72,7 +72,7 @@ # Run etch #puts "Running link update test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(@destfile2, File.readlink(@targetfile), 'link update') @@ -101,7 +101,7 @@ # Run etch #puts "Running link update from non-existent file test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(@destfile, File.readlink(@targetfile), 'link update from non-existent file') end @@ -127,7 +127,7 @@ # Run etch #puts "Running link to non-existent destination test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the link was not created assert(!File.symlink?(@targetfile), 'link to non-existent destination') @@ -151,7 +151,7 @@ # Run etch #puts "Running link to non-existent destination with override test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the link was updated properly assert_equal(@destfile, File.readlink(@targetfile), 'link to non-existent destination with override') @@ -180,7 +180,7 @@ # Run etch #puts "Running relative link test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the link was updated properly assert_equal(reldestfile, File.readlink(@targetfile), 'relative link') @@ -207,7 +207,7 @@ # Run etch #puts "Running link ownership and permissions test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the link ownership got set correctly # Most systems don't support give-away chown, so this test won't work @@ -242,7 +242,7 @@ # Run etch #puts "Running duplicate dest instructions test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(@destfile, File.readlink(@targetfile), 'duplicate dest instructions') end @@ -266,7 +266,7 @@ # Run etch #puts "Running contradictory dest instructions test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the link wasn't created assert(!File.symlink?(@targetfile) && !File.exist?(@targetfile), 'contradictory dest instructions') @@ -295,7 +295,7 @@ # Run etch #puts "Running duplicate script instructions test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) assert_equal(@destfile, File.readlink(@targetfile), 'duplicate script instructions') end @@ -326,7 +326,7 @@ # Run etch #puts "Running contradictory script instructions test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the link wasn't created assert(!File.symlink?(@targetfile) && !File.exist?(@targetfile), 'contradictory script instructions') @@ -334,7 +334,7 @@ def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) FileUtils.rm_f(@destfile) FileUtils.rm_f(@destfile2) Modified: trunk/test/test_local_requests.rb =================================================================== --- trunk/test/test_local_requests.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_local_requests.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -19,8 +19,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" end def test_local_requests_script @@ -44,7 +44,7 @@ end # Create the local request file - requestdir = File.join(@testbase, 'requests', @targetfile) + requestdir = File.join(@testroot, 'var', 'etch', 'requests', @targetfile) requestfile = File.join(requestdir, 'testrequest') FileUtils.mkdir_p(requestdir) File.open(requestfile, 'w') do |file| @@ -68,7 +68,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -95,7 +95,7 @@ end # Create the local request file - requestdir = File.join(@testbase, 'requests', @targetfile) + requestdir = File.join(@testroot, 'var', 'etch', 'requests', @targetfile) requestfile = File.join(requestdir, 'testrequest') FileUtils.mkdir_p(requestdir) File.open(requestfile, 'w') do |file| @@ -120,7 +120,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly # Our whitespace in the heredoc above gets added to the generated file, so @@ -131,7 +131,7 @@ def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) end end Modified: trunk/test/test_nodegroups.rb =================================================================== --- trunk/test/test_nodegroups.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_nodegroups.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -20,8 +20,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" end def test_group @@ -51,7 +51,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -92,7 +92,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -133,7 +133,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase) + run_etch(@server, @testroot) # Verify that the file was created properly assert_equal(sourcecontents, get_file_contents(@targetfile), testname) @@ -177,7 +177,7 @@ # Run etch #puts "Running '#{testname}' test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) # Verify that the file wasn't modified assert_equal(oldsourcecontents, get_file_contents(@targetfile), testname) @@ -185,7 +185,7 @@ def teardown remove_repository(@repodir) - FileUtils.rm_rf(@testbase) + FileUtils.rm_rf(@testroot) FileUtils.rm_rf(@targetfile) end end Modified: trunk/test/test_options.rb =================================================================== --- trunk/test/test_options.rb 2010-11-25 00:05:46 UTC (rev 224) +++ trunk/test/test_options.rb 2010-11-25 00:07:42 UTC (rev 225) @@ -20,8 +20,8 @@ @server = get_server(@repodir) # Create a directory to use as a working directory for the client - @testbase = tempdir - #puts "Using #{@testbase} as client working directory" + @testroot = tempdir + #puts "Using #{@testroot} as client working directory" end def test_killswitch @@ -62,7 +62,7 @@ # Run etch #puts "Running killswitch test" - run_etch(@server, @testbase, true) + run_etch(@server, @testroot, :errors_expected => true) assert_equal(origcontents, get_file_contents(@targetfile), 'killswitch') end @@ -100,7 +100,7 @@ # Run etch #puts "Running --dry-run test" - run_etch(@server, @testbase, false, '--dry-run') + ... [truncated message content] |
From: <jh...@us...> - 2010-11-25 00:05:55
|
Revision: 224 http://etch.svn.sourceforge.net/etch/?rev=224&view=rev Author: jheiss Date: 2010-11-25 00:05:46 +0000 (Thu, 25 Nov 2010) Log Message: ----------- Add link to ticket associated with FIXME for authentication of humans Modified Paths: -------------- trunk/server/app/controllers/application_controller.rb Modified: trunk/server/app/controllers/application_controller.rb =================================================================== --- trunk/server/app/controllers/application_controller.rb 2010-11-15 19:03:29 UTC (rev 223) +++ trunk/server/app/controllers/application_controller.rb 2010-11-25 00:05:46 UTC (rev 224) @@ -22,6 +22,7 @@ # This authentication system is targeted at etch clients. There should be # an alternate authentication mechanism targeted at humans so that humans # can interact with this service when authentication is enabled. + # https://sourceforge.net/apps/trac/etch/ticket/11 def authenticate if Etch::Server.auth_enabled? if request.headers['Authorization'] && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2010-11-15 19:03:35
|
Revision: 223 http://etch.svn.sourceforge.net/etch/?rev=223&view=rev Author: darrendao Date: 2010-11-15 19:03:29 +0000 (Mon, 15 Nov 2010) Log Message: ----------- Update etch_to_trunk to be more flexible. Users can now pass in option parameters such as user and timezone. Modified Paths: -------------- trunk/client/etch_to_trunk Modified: trunk/client/etch_to_trunk =================================================================== --- trunk/client/etch_to_trunk 2010-10-21 21:45:44 UTC (rev 222) +++ trunk/client/etch_to_trunk 2010-11-15 19:03:29 UTC (rev 223) @@ -1,21 +1,45 @@ #!/usr/bin/ruby -w require 'nventory' +require 'time' +require 'optparse' -@username = ENV['LOGNAME'] +ETCH_SERVER_TZ = 'UTC' # The etch servers run in UTC +options = {} +opts = OptionParser.new +opts.banner = 'Usage: etch_to_trunk [options] <server1> [<server2> <server3>]' +opts.on('-u', '--username USERNAME', 'Username for connecting to nventory server.') do |opt| + options[:username] = opt +end +opts.on('-t', '--timezone TIMEZONE', 'Time zone of etch server.') do |opt| + options[:timezone] = opt +end +opts.on_tail('-h', '--help', 'Show this message.') do + puts opts + exit +end + +nodes = opts.parse(ARGV) + if ARGV.length == 0 - abort "Usage: #{File.basename($0)} <server1> [<server2> <server3>]" + puts opts + exit end -# The etch servers run in UTC -ENV['TZ'] = 'UTC' -currentheadtag = Time.now.strftime('trunk-%Y%m%d-%H00') +@username = options[:username] || ENV['LOGNAME'] +etch_server_tz = options[:timezone] || ETCH_SERVER_TZ +if etch_server_tz + currentheadtag = Time.at(Time.now.utc + Time.zone_offset(etch_server_tz)).strftime('trunk-%Y%m%d-%H00') +else # if no timezone is specified then just use local time for the tag + currentheadtag = Time.now.strftime('trunk-%Y%m%d-%H00') +end + # Find the requested clients nvclient = NVentory::Client.new -results = nvclient.get_objects('nodes', {}, { 'name' => ARGV }, {}, {}) -ARGV.each do |name| +results = nvclient.get_objects('nodes', {}, { 'name' => nodes }, {}, {}) +nodes.each do |name| if results.empty? && results[name].nil? abort "No entry found for #{name}" else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-10-21 21:45:51
|
Revision: 222 http://etch.svn.sourceforge.net/etch/?rev=222&view=rev Author: jheiss Date: 2010-10-21 21:45:44 +0000 (Thu, 21 Oct 2010) Log Message: ----------- https://sourceforge.net/apps/trac/etch/ticket/10 Fix the etch home link in upper left so that it obeys RAILS_RELATIVE_URL_ROOT. Modified Paths: -------------- trunk/server/app/views/layouts/application.html.erb Modified: trunk/server/app/views/layouts/application.html.erb =================================================================== --- trunk/server/app/views/layouts/application.html.erb 2010-10-20 20:55:09 UTC (rev 221) +++ trunk/server/app/views/layouts/application.html.erb 2010-10-21 21:45:44 UTC (rev 222) @@ -26,7 +26,7 @@ <%- end -%> </p> -<h1 id="branding"><a href="/">Etch</a></h1> +<h1 id="branding"><%= link_to "Etch", { :controller => 'dashboard' } %></h1> <hr /> </div> <!-- end header --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-10-20 20:55:15
|
Revision: 221 http://etch.svn.sourceforge.net/etch/?rev=221&view=rev Author: jheiss Date: 2010-10-20 20:55:09 +0000 (Wed, 20 Oct 2010) Log Message: ----------- Update more info URL in the comments. Modified Paths: -------------- trunk/etchserver-samples/nventory/nodetagger trunk/etchserver-samples/nventory/tagstate Modified: trunk/etchserver-samples/nventory/nodetagger =================================================================== --- trunk/etchserver-samples/nventory/nodetagger 2010-10-20 20:54:51 UTC (rev 220) +++ trunk/etchserver-samples/nventory/nodetagger 2010-10-20 20:55:09 UTC (rev 221) @@ -1,7 +1,7 @@ #!/usr/bin/ruby -w ############################################################################## # This is a node tagging script for etch which gets tags from nVentory -# http://etch.wiki.sourceforge.net/ControlledDeployment +# http://sourceforge.net/apps/trac/etch/wiki/ControlledDeployment ############################################################################## require 'optparse' Modified: trunk/etchserver-samples/nventory/tagstate =================================================================== --- trunk/etchserver-samples/nventory/tagstate 2010-10-20 20:54:51 UTC (rev 220) +++ trunk/etchserver-samples/nventory/tagstate 2010-10-20 20:55:09 UTC (rev 221) @@ -3,4 +3,4 @@ # etchautotag-20081002-1000 bad # etchautotag-20081002-1100 badfwd # For more info: -# http://etch.wiki.sourceforge.net/ControlledDeployment +# http://sourceforge.net/apps/trac/etch/wiki/ControlledDeployment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-10-20 20:54:57
|
Revision: 220 http://etch.svn.sourceforge.net/etch/?rev=220&view=rev Author: jheiss Date: 2010-10-20 20:54:51 +0000 (Wed, 20 Oct 2010) Log Message: ----------- Switch to nVentory's new get_objects syntax. Update more info URL in the comment at the top of the script. Modified Paths: -------------- trunk/etchserver-samples/nventory/nodegrouper Modified: trunk/etchserver-samples/nventory/nodegrouper =================================================================== --- trunk/etchserver-samples/nventory/nodegrouper 2010-10-20 18:42:17 UTC (rev 219) +++ trunk/etchserver-samples/nventory/nodegrouper 2010-10-20 20:54:51 UTC (rev 220) @@ -1,7 +1,7 @@ #!/usr/bin/ruby -w ############################################################################## # This is a node grouping script for etch which gets groups from nVentory -# http://etch.wiki.sourceforge.net/NodeGroups +# http://sourceforge.net/apps/trac/etch/wiki/NodeGroups ############################################################################## require 'nventory' @@ -13,7 +13,7 @@ # nvclient = NVentory::Client.new -results = nvclient.get_objects('nodes', {}, { 'name' => name }, {}, {}, ['node_groups']) +results = nvclient.get_objects(:objecttype => 'nodes', :exactget => { 'name' => name }, :includes => ['node_groups']) if results.include?(name) && results[name].include?('node_groups') results[name]['node_groups'].each do |ng| This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-10-20 18:42:23
|
Revision: 219 http://etch.svn.sourceforge.net/etch/?rev=219&view=rev Author: jheiss Date: 2010-10-20 18:42:17 +0000 (Wed, 20 Oct 2010) Log Message: ----------- Add badfwd example Modified Paths: -------------- trunk/etchserver-samples/nventory/tagstate Modified: trunk/etchserver-samples/nventory/tagstate =================================================================== --- trunk/etchserver-samples/nventory/tagstate 2010-10-20 18:37:23 UTC (rev 218) +++ trunk/etchserver-samples/nventory/tagstate 2010-10-20 18:42:17 UTC (rev 219) @@ -1,5 +1,6 @@ # Examples: # etchautotag-20081002-0900 good # etchautotag-20081002-1000 bad +# etchautotag-20081002-1100 badfwd # For more info: # http://etch.wiki.sourceforge.net/ControlledDeployment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |