|
From: <jud...@us...> - 2006-07-20 17:55:21
|
Revision: 314 Author: judith_osdl Date: 2006-07-20 10:54:59 -0700 (Thu, 20 Jul 2006) ViewCVS: http://svn.sourceforge.net/stp/?rev=314&view=rev Log Message: ----------- Updates for receiving email via brt_egate.pl Modified Paths: -------------- trunk/Test-Sut/lib/Test/Admin/Result.pm trunk/Test-Sut/lib/Test/Sut/Util/Log.pm trunk/Test-Sut/scripts/admin/brt_egate.pl Added Paths: ----------- trunk/Test-Sut/etc/stp_email.conf trunk/Test-Sut/etc/stp_receive_email.conf trunk/Test-Sut/tags/ Added: trunk/Test-Sut/etc/stp_email.conf =================================================================== --- trunk/Test-Sut/etc/stp_email.conf (rev 0) +++ trunk/Test-Sut/etc/stp_email.conf 2006-07-20 17:54:59 UTC (rev 314) @@ -0,0 +1,49 @@ +# Configuration file for the Scalable Test Platform +# +# 2004-2006 OSDL +# +# This is connfiguration for the autotest with wsdl transport +# Basic Information - STP PATH and administrator email +basepath: /usr/share/stp +admin_email: stp...@li... +support_email: stp...@li... + +# Set default urls to pull kernel source from using single spaces to deliminate +kernel_url: http://www.kernel.org/ http://www.au.kernel.org/ +kernel_path: pub/linux/kernel/v2.6/ pub/linux/kernel/v2.4/ +kernel_depth: 0 + +# Service location (ASP ) +asp_proxy: https://stp.testing.osdl.org/backend/service.wsdl +webpath: http://www.testing.osdl.org/tests/ + +# Global Logging Config +log_level: 2 +log_target: file +log_filename: "/var/log/stp/stp.log" + +# Data path for STP reports +datapath: /tmp/report + +# Result storage paths +resultpath: /home/stp/results +resulturl: http://www.testing.osdl.org/stp + +# Location of tools needed by stp_client.pl +use_local_state: no +state_file: /var/log/sut-state +plm_patch: /usr/bin/plm_build_tree.pl +plm_app: /usr/bin/plm_build_app.pl +kernel_build: stp_robokern +use_local_state: no +state_file: /var/log/sut-state +email_to: re...@st... +email_from: na...@te... +encrypt_results: yes +pub_key_id: 757E3417 +private_key_id: <private_key> +email_results: auto + + +net_health_check: "ping -w 10 -q -n -c1 10.11.59.1" + Added: trunk/Test-Sut/etc/stp_receive_email.conf =================================================================== --- trunk/Test-Sut/etc/stp_receive_email.conf (rev 0) +++ trunk/Test-Sut/etc/stp_receive_email.conf 2006-07-20 17:54:59 UTC (rev 314) @@ -0,0 +1,36 @@ +# Configuration file for the Scalable Test Platform +# +# 2004-2006 OSDL +# +# This is connfiguration for the autotest with wsdl transport +# Basic Information - STP PATH and administrator email +admin_email: stp...@li... +support_email: stp...@li... + +# Service location (ASP ) +asp_proxy: https://stp.testing.osdl.org/backend/service.wsdl +asp_login: test_unpacker +asp_pass: <password> + +# Global Logging Config +log_level: 2 +log_target: file +log_filename: "/var/log/stp/stp.log" + +# Data path for STP reports +datapath: /tmp/report + +# Result storage paths +resultpath: /srv/stp/results +#resulturl: http://www.testing.osdl.org/stp +default_sender: re...@st... + +# Location of tools needed by stp_client.pl +#plm_patch: /usr/bin/plm_build_tree.pl +#plm_app: /usr/bin/plm_build_app.pl +#kernel_build: stp_robokern +#use_local_state: no +#state_file: /var/log/sut-state + +#net_health_check: "ping -w 10 -q -n -c1 10.11.59.1" + Modified: trunk/Test-Sut/lib/Test/Admin/Result.pm =================================================================== --- trunk/Test-Sut/lib/Test/Admin/Result.pm 2006-07-19 21:27:29 UTC (rev 313) +++ trunk/Test-Sut/lib/Test/Admin/Result.pm 2006-07-20 17:54:59 UTC (rev 314) @@ -54,7 +54,7 @@ $self->{'configfile'} = $configfile; $self->{'config'} = new Test::Sut::Util::Config( $configfile ); - $self->{'log'} = new Test::Sut::Util::Log( $self->{ 'config' } ); + $self->{'log'} = new Test::Sut::Util::Log( $self->{ 'config' }->getConfigParam( 'log_filename' ), $self->{ 'config' }->getConfigParam( 'log_level' ) ); # Use Secured RPC, second option is a '1'. $self->{'asp_proxy'} = $self->{'config'}->getConfigParam( 'asp_proxy' ); $self->{'resultpath'} = $self->{'config'}->getConfigParam( 'resultpath' ); @@ -78,7 +78,9 @@ $self->{ 'test_request_id' } = $self->parse_header( $message->head() ); if ( $self->{ 'test_request_id' } ){ - ( $self->{'user_id'}, $self->{'user_email'}, $self->{'gpg_pubkey'} ) = @{ $self->get_sender_info() }; + my $user_information = $self->get_sender_info(); + $self->{'user_email'}=$user_information->{'email'}; + $self->{'gpg_pubkey'}=$user_information->{'gpg_pubkey'}; $self->{'filename'} = $self->{'resultpath'} . "/" . $self->{ 'test_request_id' } . ".tar.bz2.asc"; # This could be very big open FH, ">" . $self->{'filename'}; @@ -134,11 +136,13 @@ my ( $signee ) = $output =~ m/Good signature from \"(.*)\"/; if ( $signee =~ m/$self->{ 'user_email' }|$self->{'default_sender'}/ ){ - $self->{ 'log' }->msg( 4, "File " . $self->{ 'filename' } . " is signed.\nExpected: $self->{ 'user_email' }\nGot $output." ); + print "File " . $self->{ 'filename' } . " IS signed.\nExpected: $self->{ 'user_email' } or $self->{'default_sender'}\nGot $signee\n Error message: $output." ; + $self->{ 'log' }->msg( 4, "File " . $self->{ 'filename' } . " is signed.\nExpected: $self->{ 'user_email' } or $self->{'default_sender'}\nGot $signee\n Error message: $output." ); $self->{ 'filename' } = $outfile; return 1; } else { - $self->{ 'log' }->msg( 1, "File " . $self->{ 'filename' } . " is not signed.\nExpected: $self->{ 'user_email' }\nGot $output." ); + print "File " . $self->{ 'filename' } . " is NOT signed.\nExpected: $self->{ 'user_email' } or $self->{'default_sender'}\nGot $signee\n Error message: $output." ; + $self->{ 'log' }->msg( 1, "File " . $self->{ 'filename' } . " is NOT signed.\nExpected: $self->{ 'user_email' }or $self->{'default_sender'}\nGot $signee\n Error message: $output." ); return 0; } } Modified: trunk/Test-Sut/lib/Test/Sut/Util/Log.pm =================================================================== --- trunk/Test-Sut/lib/Test/Sut/Util/Log.pm 2006-07-19 21:27:29 UTC (rev 313) +++ trunk/Test-Sut/lib/Test/Sut/Util/Log.pm 2006-07-20 17:54:59 UTC (rev 314) @@ -14,7 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -package Tets::Sut::Util::Log; +package Test::Sut::Util::Log; # TODO __- Investigate Data::Dumper for Log::bomb use Data::Dumper; @@ -33,12 +33,16 @@ =cut sub new { - my ( $pkg, $logfile ) = @_; + my ( $pkg, $logfile, $level ) = @_; if ( !defined( $logfile ) ) { $logfile = "/var/log/FIX_STP_LOGFILE"; } - my $obj = { logfile => $logfile }; + if ( !defined( $level ) ) { + $level = 3; + } + my $obj = { logfile => $logfile, + level => $level }; return bless $obj, $pkg; } @@ -65,6 +69,14 @@ return 1; } +sub msg{ + my ( $self, $level, $message ) = @_; + if ( $level >= $self->{ 'level' }){ + $self->log($message); + } +} + + =head1 FUNCTION dump_err Log an error, print to STDERR Modified: trunk/Test-Sut/scripts/admin/brt_egate.pl =================================================================== --- trunk/Test-Sut/scripts/admin/brt_egate.pl 2006-07-19 21:27:29 UTC (rev 313) +++ trunk/Test-Sut/scripts/admin/brt_egate.pl 2006-07-20 17:54:59 UTC (rev 314) @@ -35,7 +35,7 @@ use strict; use Test::Admin::Result; -my $result = new Test::Admin::Result( '/etc/brt/brt_default.cfg' ); +my $result = new Test::Admin::Result( '/etc/stp/stp_main.conf' ); $result->read_email(); if ( $result->decrypt() ){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |