Changeset 589
- Timestamp:
- 03/29/07 14:12:23 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bin/applications/nightly_build_test_infrastructure/chroot.rb
r588 r589 48 48 @release = release 49 49 @arch = arch 50 50 @log_file = "#{@target_dir}/#{@name}.log" 51 51 @complete_path = "#{@path}/#{@name}" 52 52 end … … 62 62 63 63 run "#{@sudo}mkdir #{@complete_path}" 64 run "#{@sudo}debootstrap #{@release} #{@complete_path} http://ftp.debian.org/debian/ >> /tmp/hefeweizen_installation.log" 65 run "#{@sudo}mv /tmp/hefeweizen_installation.log #{@complete_path}/root" 64 run "#{@sudo}debootstrap #{@release} #{@complete_path} http://ftp.debian.org/debian/ >> #{@log_file}" 66 65 run "#{@sudo}echo \"/proc #{@complete_path}/proc proc defaults 0 0\" >> /etc/fstab" 67 66 run "#{@sudo}echo \"/dev #{@complete_path}/dev dev defaults 0 0\" >> /etc/fstab" … … 78 77 # to ask for trusting the certificate). 79 78 def install_subversion_and_add_ssl_certificate havanawave_certificate 80 81 run "#{@sudo}chroot #{@complete_path} apt-get update >> /root/hefeweizen_installation.log" 82 run "#{@sudo}chroot #{@complete_path} apt-get -y install subversion >> /root/hefeweizen_installation.log" 79 run "#{@sudo}chroot #{@complete_path} apt-get update >> #{@log_file}" 80 run "#{@sudo}chroot #{@complete_path} apt-get -y install subversion >> #{@log_file}" 83 81 run "#{@sudo}cp #{havanawave_certificate} #{@complete_path}/root/" 84 82 run "#{@sudo}echo \"ssl-authority-files = /root/#{File.basename havanawave_certificate}\" >> #{@complete_path}/etc/subversion/servers" 85 86 83 end 87 84 88 85 # This method copies the HefeWeizen installation script 89 86 def get_hefeweizen_installation_script command 90 run "#{@sudo}chroot #{@complete_path} #{command} >> /root/hefeweizen_installation.log"87 run "#{@sudo}chroot #{@complete_path} #{command} >> #{@log_file}" 91 88 end 92 89 93 90 # This method runs the HefeWeizen installation inside the chroot. 94 91 def run_hefeweizen_installation 95 run "#{@sudo}chroot #{@complete_path} sh hefeweizen-installation.sh >> /root/hefeweizen_installation.log"92 run "#{@sudo}chroot #{@complete_path} sh hefeweizen-installation.sh >> #{@log_file}" 96 93 end 97 94 … … 104 101 # This mehtod starts the HefeWeizen system 105 102 def start_hefeweizen 106 run "#{@sudo}chroot #{@complete_path} sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/bin/run-hefeweizen.sh & "103 run "#{@sudo}chroot #{@complete_path} sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/bin/run-hefeweizen.sh & >> #{@log_file} " 107 104 end 108 105 109 106 # This method starts the HefeWeizen Test system 110 107 def start_tester 111 run "#{@sudo}chroot #{@complete_path} sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/bin/run-tester.sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/bin "108 run "#{@sudo}chroot #{@complete_path} sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/bin/run-tester.sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/bin >> #{@log_file}" 112 109 end 113 110 114 111 # This method stops the HefeWeizen sytem. 115 112 def stop_hefeweizen 116 run "#{@sudo}chroot #{@complete_path} sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/bin/stop-hefeweizen.sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/ "113 run "#{@sudo}chroot #{@complete_path} sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/bin/stop-hefeweizen.sh /usr/local/src/HefeWeizenProject/HefeWeizen/trunk/ >> #{@log_file}" 117 114 end 118 115 … … 120 117 def copy_test_result_to target, prefix 121 118 Dir.glob("#{@complete_path}/home/hefeweizen-env/var/log/hefeweizen-test/*").each{ | dir | 122 run "#{@sudo}mv #{dir} #{target}/#{prefix}_#{File.basename dir}"119 run "#{@sudo}mv \"#{dir}\" \"#{target}/#{prefix}_#{File.basename dir}\"" 123 120 } 124 121 end … … 128 125 # This method executes a command and raises an Exception if the command failed. 129 126 def run command 130 @logger.debug " command: #{command}"127 @logger.debug "#{Time.now}: command: #{command}" 131 128 system command 132 # return true133 129 if $? != 0 then 134 130 raise Exception.new "Error executing command '#{command}'" trunk/bin/applications/nightly_build_test_infrastructure/hefeweizen-test-system.rb
r588 r589 54 54 DEFAULT_PATH = "/home/hefeweizen_builds/" 55 55 56 @logger = Logger.new(STDOUT)57 @logger.level = Logger::DEBUG58 59 56 # This class is handling a complete Testing of HefeWeizen. This includes the creation of a chroot, 60 57 # installing the HefeWeizen system inside the chroot and running tests. … … 77 74 architecture = "32bit" 78 75 time = Time.now 79 putschroot_name = "#{distribution}_#{release}_#{architecture}_#{time.to_f.to_s}_#{time.to_s.gsub(/ /, '_')}"76 chroot_name = "#{distribution}_#{release}_#{architecture}_#{time.to_f.to_s}_#{time.to_s.gsub(/ /, '_')}" 80 77 chroot = Chroot.new @logger, @use_sudo, chroot_name, @target_path, CHROOT_PATH, distribution, release, architecture 81 78 82 79 begin 80 83 81 path = chroot.create 84 @logger.info "Created new chroot with the following path: #{path}"82 @logger.info "Created new chroot with the name '#{chroot_name}' at the following path: #{path}" 85 83 86 84 @logger.info "Installing subversion and setting up ssl certificate" … … 111 109 @logger.info "Stopping HefeWeizenTester" 112 110 chroot.stop_hefeweizen 113 111 114 112 @logger.info "Copying test result" 115 113 chroot.copy_test_result_to "#{@target_path}/#{RESULTS_PATH}", prefix = chroot_name … … 127 125 end 128 126 129 #options = {:path => DEFAULT_PATH, :sudo => false}130 127 options = OpenStruct.new 131 128 options.path = [DEFAULT_PATH] … … 153 150 end.parse! 154 151 152 time_start = Time.now 153 log_file = "#{options.path}/#{RESULTS_PATH}/hefeweizen-test-system-#{time_start.to_f}_#{time_start.to_s.gsub(/ /, "_").log}" 154 @logger = Logger.new(log_file) 155 @logger.level = Logger::DEBUG 156 155 157 @logger.info "HefeWeizen CHROOT Test System" 156 158 @logger.info "Path to install: #{options.path}"
