|
From: <jud...@us...> - 2006-07-11 20:14:18
|
Revision: 301 Author: judith_osdl Date: 2006-07-11 13:14:15 -0700 (Tue, 11 Jul 2006) ViewCVS: http://svn.sourceforge.net/stp/?rev=301&view=rev Log Message: ----------- This packs up stp results for mailing in. Added Paths: ----------- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm Added: trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm =================================================================== --- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm (rev 0) +++ trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-11 20:14:15 UTC (rev 301) @@ -0,0 +1,111 @@ +# Copyright (C) 2002-2006 Open Source Development Lab +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# +package Test::Sut::Upload::Wsdl; +use Data::Dumper; +use Test::Sut::Upload; +use Test::Sut::Email; +use Test::Transport::Wsdl; +use MIME::Base64; +no warnings 'redefine'; +use Exporter; +our @ISA = qw( Test::Sut::Upload Exporter); +our @EXPORT = qw( upload_all + upload_result + upload_results + upload_file + request_details + request_details_file + ); +use strict; + +# We need to repeat this use or call functions by the fully qualified name +use Test::Sut::Tools; + +sub new{ + my $package = shift; + my $config_file = shift || "/etc/brt/brt_default.cfg"; + + my $self = $package->SUPER::new($config_file); + + return $self; +} + + +# +# This function handles the generic uploading of results +# +# Future work could include reading a stp-upload file for a line-by-line of +# test-specific files that should be copied +# + +sub upload_results { + + my ( $r ) = @_; + + my $test_name = $r->{ 'tr_ref' }->{ 'test_case_descriptor' }; + + my $exec_home = $ENV{ 'EXEC_HOME' }; + my @files; + + syslog "uploading results to the server"; + + # Move the test results to the current directory & archive them + chdir( "$ENV{'EXEC_HOME'}" ); + # Set new RESULTS_TOP + $ENV{'RESULTS_TOP'}= "$ENV{ 'EXEC_HOME' }/$ENV{'TEST_ID'}"; + mkdir $ENV{'RESULTS_TOP'}; + mkdir $ENV{'RESULTS_TOP'}. "/logs", 0777; + mkdir $ENV{'RESULTS_TOP'}. "/results", 0777; + mkdir $ENV{'RESULTS_TOP'}. "/profile", 0777; + mkdir $ENV{'RESULTS_TOP'}. "/oprofile", 0777; + mkdir $ENV{'RESULTS_TOP'}. "/environment", 0777; + system "cp *.html $ENV{'RESULTS_TOP'}/"; + system "cp COPYING $ENV{'RESULTS_TOP'}/"; + system "cp -R environment/* $ENV{'RESULTS_TOP'}/environment/"; + system "cp -R logs/* $ENV{'RESULTS_TOP'}/logs/"; + system "cp -R profile/* $ENV{'RESULTS_TOP'}/profile/"; + system "cp -R oprofile/* $ENV{'RESULTS_TOP'}/oprofile/"; + system "cp $r->{ 'stp_client_log' } $ENV{'RESULTS_TOP'}/logs/stp.log.txt"; + system "cp $ENV{'TEST_ENV'} $ENV{'RESULTS_TOP'}/logs/testEnv.txt"; + system "cp /var/log/plm/plm.log $ENV{'RESULTS_TOP'}/logs/plm.log.txt"; + system "cp /var/log/dmesg $ENV{'RESULTS_TOP'}/logs/dmesg.txt"; + system "cp $ENV{ 'RESULTS_ROOT' }/script_params.txt $ENV{'RESULTS_TOP'}/results/"; + system "mv $test_name/logs/* $ENV{'RESULTS_TOP'}/logs/"; + system "mv $test_name/profile/* $ENV{'RESULTS_TOP'}/profile/"; + system "mv $test_name/oprofile/* $ENV{'RESULTS_TOP'}/oprofile/"; + system "mv -f $test_name/results/* $ENV{'RESULTS_TOP'}/results/"; + system "mv -f $test_name/*.html $ENV{'RESULTS_TOP'}"; + system "mv -f $test_name/result_email.txt $ENV{'RESULTS_TOP'}"; + + require Sys::SyslogMessages; + my $syslog = new Sys::SyslogMessages(); + $syslog->tail({'number_hours' => '6', 'output_file' => './logs/syslog.txt'}); + system "chmod 644 ./logs/syslog.txt"; + + # Go to the final location of the results + $ENV{'RESULTS_TOP'}= "$ENV{ 'EXEC_HOME' }/$ENV{'TEST_ID'}"; + chdir( $ENV{'RESULTS_TOP'} ); + # Make these files read-only + system "chown -R 444 *"; + my $res = $r->upload_all(); + chdir( $ENV{'EXEC_HOME'} ); + return; +} + + +1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <jud...@us...> - 2006-07-11 20:17:19
|
Revision: 302 Author: judith_osdl Date: 2006-07-11 13:17:16 -0700 (Tue, 11 Jul 2006) ViewCVS: http://svn.sourceforge.net/stp/?rev=302&view=rev Log Message: ----------- Fix the package name to inherit. Modified Paths: -------------- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm Modified: trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm =================================================================== --- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-11 20:14:15 UTC (rev 301) +++ trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-11 20:17:16 UTC (rev 302) @@ -18,7 +18,7 @@ package Test::Sut::Upload::Wsdl; use Data::Dumper; use Test::Sut::Upload; -use Test::Sut::Email; +use Test::Sut::Upload::Email; use Test::Transport::Wsdl; use MIME::Base64; no warnings 'redefine'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <jud...@us...> - 2006-07-18 21:15:35
|
Revision: 311 Author: judith_osdl Date: 2006-07-18 14:15:32 -0700 (Tue, 18 Jul 2006) ViewCVS: http://svn.sourceforge.net/stp/?rev=311&view=rev Log Message: ----------- Fix the Exports list. Modified Paths: -------------- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm Modified: trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm =================================================================== --- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-14 17:59:30 UTC (rev 310) +++ trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-18 21:15:32 UTC (rev 311) @@ -25,9 +25,9 @@ use Exporter; our @ISA = qw( Test::Sut::Upload Exporter); our @EXPORT = qw( upload_all - upload_result upload_results - upload_file + encrypt_results + send_results request_details request_details_file ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <jud...@us...> - 2006-07-19 21:18:08
|
Revision: 312 Author: judith_osdl Date: 2006-07-19 14:18:05 -0700 (Wed, 19 Jul 2006) ViewCVS: http://svn.sourceforge.net/stp/?rev=312&view=rev Log Message: ----------- Move create syslog log file before copies. Modified Paths: -------------- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm Modified: trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm =================================================================== --- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-18 21:15:32 UTC (rev 311) +++ trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-19 21:18:05 UTC (rev 312) @@ -64,6 +64,11 @@ syslog "uploading results to the server"; + require Sys::SyslogMessages; + my $syslog = new Sys::SyslogMessages(); + $syslog->tail({'number_hours' => '6', 'output_file' => './logs/syslog.txt'}); + system "chmod 644 ./logs/syslog.txt"; + # Move the test results to the current directory & archive them chdir( "$ENV{'EXEC_HOME'}" ); # Set new RESULTS_TOP @@ -92,11 +97,6 @@ system "mv -f $test_name/*.html $ENV{'RESULTS_TOP'}"; system "mv -f $test_name/result_email.txt $ENV{'RESULTS_TOP'}"; - require Sys::SyslogMessages; - my $syslog = new Sys::SyslogMessages(); - $syslog->tail({'number_hours' => '6', 'output_file' => './logs/syslog.txt'}); - system "chmod 644 ./logs/syslog.txt"; - # Go to the final location of the results $ENV{'RESULTS_TOP'}= "$ENV{ 'EXEC_HOME' }/$ENV{'TEST_ID'}"; chdir( $ENV{'RESULTS_TOP'} ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <jud...@us...> - 2006-07-21 17:42:26
|
Revision: 320 Author: judith_osdl Date: 2006-07-21 10:42:24 -0700 (Fri, 21 Jul 2006) ViewCVS: http://svn.sourceforge.net/stp/?rev=320&view=rev Log Message: ----------- Need to create state file here, before packing up. Modified Paths: -------------- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm Modified: trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm =================================================================== --- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-21 17:26:44 UTC (rev 319) +++ trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-21 17:42:24 UTC (rev 320) @@ -68,6 +68,11 @@ my $syslog = new Sys::SyslogMessages(); $syslog->tail({'number_hours' => '6', 'output_file' => './logs/syslog.txt'}); system "chmod 644 ./logs/syslog.txt"; + my $state = 'Completed'; + if ( $self->{'sub_test_failure'} != 0 ){ + $state = 'Failed'; + } + `echo $state > "$ENV{'SYSTEM_LOGS'}/test_request_status.txt"`; # Move the test results to the current directory & archive them chdir( "$ENV{'EXEC_HOME'}" ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <jud...@us...> - 2006-07-21 17:46:07
|
Revision: 321 Author: judith_osdl Date: 2006-07-21 10:46:02 -0700 (Fri, 21 Jul 2006) ViewCVS: http://svn.sourceforge.net/stp/?rev=321&view=rev Log Message: ----------- Fix reference name. Modified Paths: -------------- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm Modified: trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm =================================================================== --- trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-21 17:42:24 UTC (rev 320) +++ trunk/Test-Sut/lib/Test/Sut/Upload/EmailW.pm 2006-07-21 17:46:02 UTC (rev 321) @@ -69,7 +69,7 @@ $syslog->tail({'number_hours' => '6', 'output_file' => './logs/syslog.txt'}); system "chmod 644 ./logs/syslog.txt"; my $state = 'Completed'; - if ( $self->{'sub_test_failure'} != 0 ){ + if ( $r->{'sub_test_failure'} != 0 ){ $state = 'Failed'; } `echo $state > "$ENV{'SYSTEM_LOGS'}/test_request_status.txt"`; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |