Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 315825 Details for
Bug 446593
FEAT: HwCert catalog should reject results from testing versions of HTS
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch Improve:
hts_version.patch (text/plain), 17.43 KB, created by
XINSUN
on 2008-09-05 03:37:19 UTC
(
hide
)
Description:
Patch Improve:
Filename:
MIME Type:
Creator:
XINSUN
Created:
2008-09-05 03:37:19 UTC
Size:
17.43 KB
patch
obsolete
>? A >? a.patch >? aa >? c >? comment.patch >? hts_version.patch >? readme >? data/template >? data/tm >? data/tmp >? data/versioncache >? data/rpms/051a8e6a427d6fb180532a2f06ff59b0 >? data/rpms/0836ba9fd4e94b6f5332e863ce11cc22 >? data/rpms/9e8445ce4925d3a3209479168b4f8600 >? data/scratch/9e8445ce4925d3a3209479168b4f8600 >? template/en/default/bug/hts_version.html.tmpl >Index: attachment.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/attachment.cgi,v >retrieving revision 1.18 >diff -u -r1.18 attachment.cgi >--- attachment.cgi 18 Aug 2008 07:32:56 -0000 1.18 >+++ attachment.cgi 5 Sep 2008 03:36:15 -0000 >@@ -148,6 +148,7 @@ > validateContentType() unless $::FORM{'ispatch'}; > validateObsolete() if $::FORM{'obsolete'}; > validateMd5sumOverride() if $::FORM{'md5sumOverride'}; >+ validateHtsNvrOverride() if $::FORM{'hts_nvr_override'}; > insert($data); > } > elsif ($action eq "edit") >@@ -399,7 +400,18 @@ > # do not get sent in HTML requests. > $::FORM{'md5sumoverride'} = $::FORM{'md5sumoverride'} ? 1 : 0; > UserInGroup('hwcert_edit') || >- ThrowUserError("md5sum_override_permission_deny"); >+ ThrowUserError("md5sum_override_permission_denied"); >+} >+ >+sub validateHtsNvrOverride >+{ >+ # Verify that the $hts_nvr_override is legal either way and that the user >+ # has permissions to set it , since the UI uses >+ # an HTML checkbox to represent this flag, and unchecked HTML checkboxes >+ # do not get sent in HTML requests. >+ $::FORM{'hts_nvr_override'} = $::FORM{'hts_nvr_override'} ? 1 : 0; >+ UserInGroup('hwcert_edit') || >+ ThrowUserError("hts_nvr_override_permission_denied"); > } > > sub validateData >@@ -942,6 +954,7 @@ > $vars->{'bugassignee_id'} = $assignee_id; > $vars->{'bugsummary'} = $bugsummary; > $vars->{'GetBugLink'} = \&GetBugLink; >+ $vars->{'supported_hts_nvr_list'} = GetSupportedHtsVersions(); > > print Bugzilla->cgi->header(); > >@@ -956,7 +969,8 @@ > my ($data) = shift @_; > my $isprivate = $::FORM{'isprivate'} ? 1 : 0; > my $md5sum = GenMd5File($filename, $data); >- my $md5sumoverride = $::FORM{'md5sumoverride'} ? 1 : 0; >+ my $md5sumoverride = $::FORM{'md5sumoverride'} ? 1 : 0; >+ my $hts_nvr_override = $::FORM{'hts_nvr_override'} ? 1 : 0; > my $duplicatepackagecomment = ""; > > SendSQL2("SELECT cert_rpms.attach_id, cert_records.bug_id FROM cert_records, cert_rpms " . >@@ -1019,7 +1033,7 @@ > # Support hwcert results package parsing when mimetype is right and checkbox "attachasresult" is checked. > if ( $contenttype =~ /redhat-package-manager|x-rpm|octet-stream|x-pn-realaudio/ && $attachasresult eq "true") > { >- $comment.= processResultsRpm($::FORM{'bugid'}, $filename, $md5sum, $attachid, $attachasresult, $data ); >+ $comment.= processResultsRpm($::FORM{'bugid'}, $filename, $md5sum, $attachid, $attachasresult, $hts_nvr_override, $data ); > } > > use Text::Wrap; >Index: enter.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/enter.cgi,v >retrieving revision 1.4 >diff -u -r1.4 enter.cgi >--- enter.cgi 14 May 2008 13:29:30 -0000 1.4 >+++ enter.cgi 5 Sep 2008 03:36:15 -0000 >@@ -40,6 +40,7 @@ > use Bugzilla; > use Bugzilla::Constants; > require "CGI.pl"; >+require "hwcert.pl"; > > use vars qw( > $unconfirmedstate >@@ -393,6 +394,7 @@ > $default{category} = "Server"; > > $vars->{'default'} = \%default; >+$vars->{'supported_hts_nvr_list'} = GetSupportedHtsVersions(); > > my $format = > GetFormat("bug/create/create", scalar $cgi->param('format'), >Index: hwcert.pl >=================================================================== >RCS file: /cvs/qa/hwcert/hwcert.pl,v >retrieving revision 1.58 >diff -u -r1.58 hwcert.pl >--- hwcert.pl 3 Sep 2008 05:11:04 -0000 1.58 >+++ hwcert.pl 5 Sep 2008 03:36:15 -0000 >@@ -965,6 +965,70 @@ > } > } > >+sub GetHtsVersionFromRpm{ >+ my ($scratchlocation, $tmpfilename) = @_; >+ my $version; >+ my $release; >+ >+ foreach my $i (0..500) { >+ my $info_run = "$scratchlocation/var/log/rhr/$tmpfilename/var/log/rhr/runs/$i/INFO/output.log"; >+ if (! -e $info_run) { >+ $info_run = "$scratchlocation/var/log/hts/$tmpfilename/var/log/hts/runs/$i/INFO/output.log"; >+ } >+ >+ open (INFO_RUN, "<$info_run") || next; >+ my @info_rundata = <INFO_RUN>; >+ close (INFO_RUN); >+ >+ foreach my $line (@info_rundata) { >+ if ($line =~ /HTS version (.+), release (\d+)/) { >+ $version = $1; >+ $release = $2; >+ last; >+ } >+ } >+ last if ($version && $release); >+ } >+ if (!$version || !$release) { >+ return undef; >+ } else { >+ my $hts_nvr = "hts-$version-$release"; >+ return $hts_nvr; >+ } >+} >+ >+sub GetOfficialHtsVersions { >+ my $query = "SELECT NVR FROM hts_version ORDER BY release_date DESC"; >+ SendSQL2($query); >+ my @official_hts_nvr_list; >+ while (MoreSQLData2()) { >+ push(@official_hts_nvr_list, FetchOneColumn2()); >+ } >+ return \@official_hts_nvr_list; >+} >+ >+sub GetSupportedHtsVersions { >+ my $query = "SELECT NVR FROM hts_version WHERE supported = 1 ORDER BY release_date DESC"; >+ SendSQL2($query); >+ my @supported_hts_nvr_list; >+ while (MoreSQLData2()) { >+ push(@supported_hts_nvr_list, FetchOneColumn2()); >+ } >+ return \@supported_hts_nvr_list; >+} >+ >+sub ValidateHtsVersion { >+ my $hts_nvr = shift @_; >+ my @official_hts_nvr_list = GetOfficialHtsVersions(); >+ my @supported_hts_nvr_list = GetSupportedHtsVersions(); >+ if (lsearch(@supported_hts_nvr_list, $hts_nvr) >= 0) { >+ return "valid"; >+ } elsif (lsearch(@official_hts_nvr_list, $hts_nvr) >= 0) { >+ return "expired"; >+ } else { >+ return "undefined"; >+ } >+} > sub CheckRequiredTests { > my ($kickstart, $tests_ran_ref) = @_; > my @tests_ran = @{$tests_ran_ref}; >@@ -1007,7 +1071,8 @@ > my $filename = shift @_; > my $md5sum = shift@_; > my $attachid = shift @_; >- my $attachasresult =shift @_; >+ my $attachasresult = shift @_; >+ my $hts_nvr_override = shift @_; > my ($data) = @_; > > # Create a local package >@@ -1049,6 +1114,24 @@ > my ($name,$version) = NameVerRel($rpmlocation); > my $tmpfilename = "$name-$version"; > >+ # Get the hts nvr >+ my $hts_nvr = GetHtsVersionFromRpm($scratchlocation, $tmpfilename); >+ >+ my $validate_result = ValidateHtsVersion($hts_nvr); >+ >+ if ($validate_result ne "valid" && !$hts_nvr_override) { >+ #Clean up before throw user error >+ UnlinkPath($scratchlocation); >+ UnlinkPath($rpmlocation); >+ if ($validate_result eq "expired") { >+ my $supported_hts_nvr_list = GetSupportedHtsVersions(); >+ my $current_hts_nvr = shift @$supported_hts_nvr_list; >+ ThrowUserError("invalid_hts_version_expired",{hts_nvr=> "$hts_nvr", filename=> "$filename", current_hts_nvr=> "$current_hts_nvr"}); >+ } else { >+ ThrowUserError("invalid_hts_version_unknown",{hts_nvr=> "$hts_nvr"}); >+ } >+ } >+ > # Use GetTestInfo to grab each of the hardware and output.log files from the scratch dir > my ($testsref, $listref, $kernelver); > ($testsref, $listref, $kernelver) = GetTestInfo($scratchlocation, $tmpfilename); >Index: post.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/post.cgi,v >retrieving revision 1.63 >diff -u -r1.63 post.cgi >--- post.cgi 3 Sep 2008 03:02:04 -0000 1.63 >+++ post.cgi 5 Sep 2008 03:36:15 -0000 >@@ -236,6 +236,32 @@ > > if ($cgi->param('md5') || $cgi->upload('data')) { > >+ my $hts_nvr_override = $cgi->param('hts_nvr_override') ? 1 : 0; >+ # Valide the hts_nvr_override permission >+ if ($hts_nvr_override && !UserInGroup('hwcert_edit')) { >+ UnlinkPath($scratchlocation); >+ UnlinkPath($rpmlocation); >+ ThrowUserError("hts_nvr_override_permission_denied"); >+ } >+ >+ # Get the hts nvr >+ my $hts_nvr = GetHtsVersionFromRpm($scratchlocation, $tmpfilename); >+ >+ my $validate_result = ValidateHtsVersion($hts_nvr); >+ >+ if ($validate_result ne "valid" && !$hts_nvr_override) { >+ # Clean up before throw user error >+ UnlinkPath($scratchlocation); >+ UnlinkPath($rpmlocation); >+ if ($validate_result eq "expired") { >+ my $supported_hts_nvr_list = GetSupportedHtsVersions(); >+ my $current_hts_nvr = shift @$supported_hts_nvr_list; >+ ThrowUserError("invalid_hts_version_expired",{hts_nvr=> "$hts_nvr", filename=> "$filename", current_hts_nvr=> "$current_hts_nvr"}); >+ } else { >+ ThrowUserError("invalid_hts_version_unknown",{hts_nvr=> "$hts_nvr"}); >+ } >+ } >+ > # Use GetTestInfo to grab each of the hardware and output.log files from the scratch dir > my ($testsref, $listref); > ($testsref, $listref, $kernelver, $platform) = GetTestInfo($scratchlocation, $tmpfilename); >Index: process.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/process.cgi,v >retrieving revision 1.37 >diff -u -r1.37 process.cgi >--- process.cgi 3 Sep 2008 05:07:42 -0000 1.37 >+++ process.cgi 5 Sep 2008 03:36:15 -0000 >@@ -2723,6 +2723,7 @@ > } > $vars->{'cert_types'} = \@::test_types; > $vars->{'current_tab'} = $cgi->param('current_tab'); >+ $vars->{'supported_hts_nvr_list'} = GetSupportedHtsVersions(); > > $template->process("bug/process/next.html.tmpl", $vars) > || ThrowTemplateError($template->error()); >Index: show.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/show.cgi,v >retrieving revision 1.16 >diff -u -r1.16 show.cgi >--- show.cgi 24 Jul 2008 13:07:42 -0000 1.16 >+++ show.cgi 5 Sep 2008 03:36:15 -0000 >@@ -221,6 +221,7 @@ > } > > $vars->{'cert_types'} = \@::test_types; >+$vars->{'supported_hts_nvr_list'} = GetSupportedHtsVersions(); > > print $cgi->header($format->{'ctype'}); > >Index: css/master.css >=================================================================== >RCS file: /cvs/qa/hwcert/css/master.css,v >retrieving revision 1.3 >diff -u -r1.3 master.css >--- css/master.css 4 Sep 2007 20:09:37 -0000 1.3 >+++ css/master.css 5 Sep 2008 03:36:15 -0000 >@@ -9,11 +9,11 @@ > > -------------------------------------------------------------------- created June 2004 */ > >-@import url(/css/global.css); >-@import url(/css/navigation.css); >-@import url(/css/headings.css); >-@import url(/css/tables.css); >-@import url(/css/pagelayout.css); >+@import url(/hwcert-xisun4/css/global.css); >+@import url(/hwcert-xisun4/css/navigation.css); >+@import url(/hwcert-xisun4/css/headings.css); >+@import url(/hwcert-xisun4/css/tables.css); >+@import url(/hwcert-xisun4/css/pagelayout.css); > > /* ---------------------------------------------------------------- ns4 styles - bah! */ > >Index: data/params >=================================================================== >RCS file: /cvs/qa/hwcert/data/params,v >retrieving revision 1.12 >diff -u -r1.12 params >--- data/params 29 Feb 2008 12:07:11 -0000 1.12 >+++ data/params 5 Sep 2008 03:36:15 -0000 >@@ -1,9 +1,9 @@ > %param = ( >- 'limits_file' => '/var/www/html/hwcert/data/limits.xml', >- 'homedir' => '/var/www/html/hwcert', >- 'rpmdir' => '/var/www/html/hwcert/data/rpms', >- 'scratchdir' => '/var/www/html/hwcert/data/scratch', >- 'tmpdir' => '/var/www/html/hwcert/data/tmp', >+ 'limits_file' => '/var/www/html/hwcert-xisun4/data/limits.xml', >+ 'homedir' => '/var/www/html/hwcert-xisun4', >+ 'rpmdir' => '/var/www/html/hwcert-xisun4/data/rpms', >+ 'scratchdir' => '/var/www/html/hwcert-xisun4/data/scratch', >+ 'tmpdir' => '/var/www/html/hwcert-xisun4/data/tmp', > 'LDAPBaseDN' => '', > 'LDAPbinddn' => '', > 'LDAPfilter' => '', >@@ -29,7 +29,7 @@ > 'commentonresolve' => 0, > 'commentonverify' => 0, > 'confirmuniqueusermatch' => 1, >- 'cookiepath' => '/hwcert', >+ 'cookiepath' => '/hwcert-xisun4', > 'cookie_expire_days' => '3', > 'cookie_secure' => 0, > 'createemailregexp' => '.*', >Index: template/en/default/bug/upload_packages.html.tmpl >=================================================================== >RCS file: /cvs/qa/hwcert/template/en/default/bug/upload_packages.html.tmpl,v >retrieving revision 1.5 >diff -u -r1.5 upload_packages.html.tmpl >--- template/en/default/bug/upload_packages.html.tmpl 30 Jul 2008 16:31:34 -0000 1.5 >+++ template/en/default/bug/upload_packages.html.tmpl 5 Sep 2008 03:36:15 -0000 >@@ -37,6 +37,18 @@ > <input type="hidden" name="action" value="insert"> > <input type="hidden" name="contenttypemethod" value="autodetect"> > <em>Enter the path to the results package or spec file on your computer.</em><br/> >+ [% count = 0 %] >+ [% IF supported_hts_nvr_list.size > 0 %] >+ <em>Currently supported versions of hts: >+ [% FOREACH hts_nvr = supported_hts_nvr_list %] >+ [% IF count == 0 %] >+ <b>[% hts_nvr FILTER html %]</b> >+ [% ELSE %] >+ ,[% hts_nvr FILTER html %] >+ [% END %] >+ [% count = count + 1 %] >+ [% END %].</em> >+ [% END %] > <input type="file" name="data" id="data" size="50" onchange="verify_filename();" > > <div id="attachasresult_warning" style="display:none;" class="clearBox"> > <p> >@@ -66,10 +78,12 @@ > <tr> > <th>Options:</th> > <td> >- <input type="checkbox" name="attachasresult" id="attachasresult" value="true" checked>Attach as result >+ <input type="checkbox" name="attachasresult" id="attachasresult" value="true" checked>Attach as result</input> > [% IF UserInGroup('hwcert_edit') %] > <br> >- <input type="checkbox" name="md5sumoverride" value="false">Override md5sum check >+ <input type="checkbox" name="md5sumoverride" value="false">Override md5sum check</input> >+ <br> >+ <input type="checkbox" name="hts_nvr_override" value="true">Override HTS version check</input> > [% END %] > </td> > </tr> >Index: template/en/default/bug/create/create.html.tmpl >=================================================================== >RCS file: /cvs/qa/hwcert/template/en/default/bug/create/create.html.tmpl,v >retrieving revision 1.14 >diff -u -r1.14 create.html.tmpl >--- template/en/default/bug/create/create.html.tmpl 21 Jul 2008 06:11:05 -0000 1.14 >+++ template/en/default/bug/create/create.html.tmpl 5 Sep 2008 03:36:15 -0000 >@@ -171,6 +171,18 @@ > <td> > <em>Enter the path to the certification package on your computer.<br/> > This file can be found in /redhatready or /var/hts on your machine being certified.</em><br> >+ [% count = 0 %] >+ [% IF supported_hts_nvr_list.size > 0 %] >+ <em>Currently supported versions of hts: >+ [% FOREACH hts_nvr = supported_hts_nvr_list %] >+ [% IF count == 0 %] >+ <b>[% hts_nvr FILTER html %]</b> >+ [% ELSE %] >+ ,[% hts_nvr FILTER html %] >+ [% END %] >+ [% count = count + 1 %] >+ [% END %].</em> >+ [% END %] > <input type="file" name="data" size="50"> > </td> > </tr> >@@ -179,7 +191,16 @@ > <td> > <input type=text" name="description" size="50"> > </td> >- <table> >+ </tr> >+ [% IF UserInGroup('hwcert_edit') %] >+ <tr> >+ <th>Options</th> >+ <td> >+ <input type="checkbox" name="hts_nvr_override" value="true">Override HTS version check</input> >+ </td> >+ </tr> >+ [% END %] >+ </table> > </p> > <br /> > >Index: template/en/default/global/user-error.html.tmpl >=================================================================== >RCS file: /cvs/qa/hwcert/template/en/default/global/user-error.html.tmpl,v >retrieving revision 1.21 >diff -u -r1.21 user-error.html.tmpl >--- template/en/default/global/user-error.html.tmpl 3 Sep 2008 05:07:43 -0000 1.21 >+++ template/en/default/global/user-error.html.tmpl 5 Sep 2008 03:36:15 -0000 >@@ -392,6 +392,14 @@ > [% END %] > ). > >+ [% ELSIF error == "invalid_hts_version_expired" %] >+ [% title = "Invalid HTS version (expired)" %] >+ [% hts_nvr FILTER html %] used in package [% filename FILTER html %] has been replaced by [% current_hts_nvr FILTER html %] and is no longer accepted. Please use <a href=https://rhn.redhat.com/rhn/channels/software/Search.do?search_string=hts&view_mode=search_name&relevant=true>[% current_hts_nvr FILTER html %]</a> for submitting official test results. >+ >+ [% ELSIF error == "invalid_hts_version_unknown" %] >+ [% title = "Invalid HTS version (unknown)" %] >+ [% hts_nvr FILTER html %] is not an official release and can not be used for official certifications. >+ > [% ELSIF error == "invalid_maxrows" %] > [% title = "Invalid Max Rows" %] > The maximum number of rows, '[% maxrows FILTER html %]', must be >@@ -448,6 +456,11 @@ > [% title = "HTS Package Required" %] > Test results not found: Data can only be parsed from hts test result packages. > >+ [% ELSIF error == "hts_nvr_override_permission_denied"%] >+ [% title = "HTS version Override Permission Denied" %] >+ You are not authorized to override the HTS version check. >+ >+ > [% ELSIF error == "hwcert_group_access_denied" %] > [% title = "Permission Denied" %] > You do not have permission to [% action FILTER html %]. >@@ -899,8 +912,8 @@ > "[% description FILTER html %]"<br> > [% END %] > >- [% ELSIF error == "md5sum_override_permission_deny"%] >- [% title = "Md5sum Override Permission Deny" %] >+ [% ELSIF error == "md5sum_override_permission_denied"%] >+ [% title = "Md5sum Override Permission Denied" %] > You are not authorized to override the duplicate md5sum check. > > [% ELSE %]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 446593
:
315671
|
315672
|
315825
|
315833
|
315834
|
316167
|
316168