[oe-commits] org.oe.dev contrib/qa/bugzilla.py: Add the standalone test bugzilla sucker

freyther commit openembedded-commits at lists.openembedded.org
Wed Mar 7 00:47:12 UTC 2007


contrib/qa/bugzilla.py: Add the standalone test bugzilla sucker
    This file can extract the bug number and status from a
    query page of bugzilla. And will be used by the "automatic
    test monkey class"

Author: freyther at openembedded.org
Branch: org.openembedded.dev
Revision: 17bbc549e6078abaa5a1805c959fe70698c51d1c
ViewMTN: http://monotone.openembedded.org/revision.psp?id=17bbc549e6078abaa5a1805c959fe70698c51d1c
Files:
1
contrib/qa/bugzilla.py
Diffs:

#
# mt diff -r46f2b0c4e2cf0609a732a9e8c2dd683a0d199b1e -r17bbc549e6078abaa5a1805c959fe70698c51d1c
#
# 
# 
# add_file "contrib/qa/bugzilla.py"
#  content [f4059250a502c96458201f47101adbdff60f54bd]
# 
============================================================
--- contrib/qa/bugzilla.py	f4059250a502c96458201f47101adbdff60f54bd
+++ contrib/qa/bugzilla.py	f4059250a502c96458201f47101adbdff60f54bd
@@ -0,0 +1,4644 @@
+#
+# BugZilla query page scanner to work with ancient
+# Debian Stable bugzilla installationss
+#
+# This includes three test sites
+#   site contains one bug entry
+#   all_bugs contains all OpenMoko bugs as of \today
+#   no_bug  is a query which showed no bug
+#
+
+from HTMLParser import HTMLParser
+
+class BugQueryExtractor(HTMLParser):
+    STATE_NONE             = 0
+    STATE_FOUND_TR         = 1
+    STATE_FOUND_NUMBER     = 2
+    STATE_FOUND_PRIO       = 3
+    STATE_FOUND_PRIO2      = 4
+    STATE_FOUND_NAME       = 5
+    STATE_FOUND_PLATFORM   = 6
+    STATE_FOUND_STATUS     = 7
+    STATE_FOUND_WHATEVER   = 8 # I don't know this field
+    STATE_FOUND_DESCRIPTION =9
+
+    def __init__(self):
+        HTMLParser.__init__(self)
+        self.state = self.STATE_NONE
+        self.bugs = []
+
+    def handle_starttag(self, tag, attr):
+        if self.state == self.STATE_NONE and tag.lower() == "tr":
+            if len(attr) == 1 and attr[0] == ('class', 'bz_normal bz_P2 '):
+                print "Found tr %s %s" % (tag, attr)
+                self.state = self.STATE_FOUND_TR
+        elif self.state == self.STATE_FOUND_TR and tag.lower() == "td":
+            self.state += 1
+
+    def handle_endtag(self, tag):
+        if tag.lower() == "tr":
+            print "Going back"
+            if self.state != self.STATE_NONE:
+                self.bugs.append( (self.bug,self.status) )
+            self.state = self.STATE_NONE
+        if self.state > 1 and tag.lower() == "td":
+            print "Next TD"
+            self.state += 1
+
+    def handle_data(self,data):
+        data = data.strip()
+
+        # skip garbage
+        if len(data) == 0:
+            return
+    
+        if self.state == self.STATE_FOUND_NUMBER:
+            print "Bug Number '%s'" % data.strip()
+            self.bug = data
+           
+        elif self.state == self.STATE_FOUND_STATUS:
+            print "Status Name '%s'" % data.strip()
+            self.status = data
+
+    def result(self):
+        print "Found bugs"
+        return self.bugs
+
+#
+site = """<!-- 1.0 at bugzilla.org -->
+
+
+
+
+
+
+
+
+
+
+
+<!-- 1.0 at bugzilla.org -->
+
+
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Bug List</title>
+
+
+    
+    
+    
+    <link href="/style/style.css" rel="stylesheet" type="text/css" />
+    
+        <link href="/bugzilla/css/buglist.css" rel="stylesheet" type="text/css">
+  
+  </head>
+  
+
+
+  <body bgcolor="#FFFFFF" onload="">
+
+
+<!-- 1.0 at bugzilla.org -->
+
+
+
+
+        <div id="header">
+                <a href="http://bugzilla.openmoko.org/cgi-bin/bugzilla/" id="site_logo"><img src="/style/images/openmoko_logo.png" alt="openmoko.org" /></a>
+                
+                <div id="main_navigation">
+                        <ul>
+                                <li><a href="http://www.openmoko.org/" class="nav_home"><span>Home</span></a></li>
+                                <li><a href="http://wiki.openmoko.org/" class="nav_wiki"><span>Wiki</span></a></li>
+                                <li><a href="http://bugzilla.openmoko.org/" class="nav_bugzilla selected"><span>Bugzilla</span></a></li>
+                                <li><a href="http://planet.openmoko.org/" class="nav_planet"><span>Planet</span></a></li>
+                                <li><a href="http://projects.openmoko.org/" class="nav_projects"><span>Projects</span></a></li>
+                                <li><a href="http://lists.openmoko.org/" class="nav_lists"><span>Lists</span></a></li>
+                        </ul>
+                </div>
+        </div>
+
+        <div class="page_title">
+                <strong>Bug List</strong> 
+        </div>
+    
+ <div class="container">
+
+<div align="center">
+  <b>Tue Mar  6 19:01:13 CET 2007</b><br>
+
+
+    <a href="quips.cgi"><i>Free your problems
+</i></a>
+
+</div>
+
+
+<hr>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<!-- 1.0 at bugzilla.org -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  <table class="bz_buglist" cellspacing="0" cellpadding="4" width="100%">
+    <colgroup>
+      <col class="bz_id_column">
+      <col class="bz_severity_column">
+      <col class="bz_priority_column">
+      <col class="bz_platform_column">
+      <col class="bz_owner_column">
+      <col class="bz_status_column">
+      <col class="bz_resolution_column">
+      <col class="bz_summary_column">
+    </colgroup>
+
+    <tr align="left">
+      <th colspan="1">
+        <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.bug_id">ID</a>
+      </th>
+
+<th colspan="1">
+    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.bug_severity,bugs.bug_id">Sev</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.priority,bugs.bug_id">Pri</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.rep_platform,bugs.bug_id">Plt</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=map_assigned_to.login_name,bugs.bug_id">Owner</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.bug_status,bugs.bug_id">State</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.resolution,bugs.bug_id">Result</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.short_desc,bugs.bug_id">Summary</a>
+  </th>
+
+
+    </tr>
+
+  <tr class="bz_normal bz_P2 ">
+
+    <td>
+      <a href="show_bug.cgi?id=238">238</a>
+    </td>
+
+    <td><nobr>nor</nobr>
+    </td>
+    <td><nobr>P2</nobr>
+    </td>
+    <td><nobr>Mac</nobr>
+    </td>
+    <td><nobr>mickey at vanille-media.de</nobr>
+    </td>
+    <td><nobr>NEW</nobr>
+    </td>
+    <td><nobr></nobr>
+    </td>
+    <td>manual test bug
+    </td>
+
+  </tr>
+
+  
+    </table>
+
+
+
+
+
+  One bug found.
+
+
+<br>
+
+
+
+
+
+
+
+
+
+
+
+
+  <form method="post" action="long_list.cgi">
+    <input type="hidden" name="buglist" value="238">
+    <input type="submit" value="Long Format">
+
+    <a href="query.cgi">Query Page</a> &nbsp;&nbsp;
+    <a href="enter_bug.cgi">Enter New Bug</a> &nbsp;&nbsp;
+    <a href="colchange.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds">Change Columns</a> &nbsp;&nbsp;
+
+
+
+    <a href="query.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds">Edit this Query</a> &nbsp;&nbsp;
+
+  </form>
+
+
+
+
+
+
+<!-- 1.0 at bugzilla.org -->
+
+
+
+  
+
+  
+</div>
+
+<div class="footer">
+        <div class="group">This is <b>Bugzilla</b>: the Mozilla bug system.  For more information about what Bugzilla is and what it can do, see <a href="http://www.bugzilla.org/">bugzilla.org</a>.</div>
+        <!-- 1.0 at bugzilla.org -->
+
+
+
+
+
+
+<form method="get" action="show_bug.cgi">
+        <div class="group">
+                <a href="enter_bug.cgi">New</a> | <a href="query.cgi">Query</a> | <input type="submit" value="Find"> bug # <input name="id" size="6"> | <a href="reports.cgi">Reports</a> | <a href="votes.cgi?action=show_user">My Votes</a> 
+        </div>
+ 
+        <div class="group">
+        Edit <a href="userprefs.cgi">prefs</a> 
+        | <a href="relogin.cgi">Log&nbsp;out</a>&nbsp;&nbsp;freyther at yahoo.com
+        </div>
+
+    
+    
+      
+    <div class="group">
+                  Preset&nbsp;Queries:
+
+          <a href="buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=freyther%40yahoo.com&amp;emailtype1=exact&amp;emailassigned_to1=1&amp;emailreporter1=1">My&nbsp;Bugs</a>
+
+    </div>
+</form>
+</div>  
+
+</body>
+</html>
+"""
+
+all_bugs = """<!-- 1.0 at bugzilla.org -->
+
+
+
+
+
+
+
+
+
+
+
+<!-- 1.0 at bugzilla.org -->
+
+
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Bug List</title>
+
+
+    
+    
+    
+    <link href="/style/style.css" rel="stylesheet" type="text/css" />
+    
+        <link href="/bugzilla/css/buglist.css" rel="stylesheet" type="text/css">
+  
+  </head>
+  
+
+
+  <body bgcolor="#FFFFFF" onload="">
+
+
+<!-- 1.0 at bugzilla.org -->
+
+
+
+
+        <div id="header">
+                <a href="http://bugzilla.openmoko.org/cgi-bin/bugzilla/" id="site_logo"><img src="/style/images/openmoko_logo.png" alt="openmoko.org" /></a>
+                
+                <div id="main_navigation">
+                        <ul>
+                                <li><a href="http://www.openmoko.org/" class="nav_home"><span>Home</span></a></li>
+                                <li><a href="http://wiki.openmoko.org/" class="nav_wiki"><span>Wiki</span></a></li>
+                                <li><a href="http://bugzilla.openmoko.org/" class="nav_bugzilla selected"><span>Bugzilla</span></a></li>
+                                <li><a href="http://planet.openmoko.org/" class="nav_planet"><span>Planet</span></a></li>
+                                <li><a href="http://projects.openmoko.org/" class="nav_projects"><span>Projects</span></a></li>
+                                <li><a href="http://lists.openmoko.org/" class="nav_lists"><span>Lists</span></a></li>
+                        </ul>
+                </div>
+        </div>
+
+        <div class="page_title">
+                <strong>Bug List</strong> 
+        </div>
+    
+ <div class="container">
+
+<div align="center">
+  <b>Tue Mar  6 20:09:40 CET 2007</b><br>
+
+
+    <a href="quips.cgi"><i>Don't complain -- it could be worse!
+</i></a>
+
+</div>
+
+
+<hr>
+
+
+
+
+
+228 bugs found.
+
+
+
+
+
+
+
+
+
+
+
+<!-- 1.0 at bugzilla.org -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  <table class="bz_buglist" cellspacing="0" cellpadding="4" width="100%">
+    <colgroup>
+      <col class="bz_id_column">
+      <col class="bz_severity_column">
+      <col class="bz_priority_column">
+      <col class="bz_platform_column">
+      <col class="bz_owner_column">
+      <col class="bz_status_column">
+      <col class="bz_resolution_column">
+      <col class="bz_summary_column">
+    </colgroup>
+
+    <tr align="left">
+      <th colspan="1">
+        <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.bug_id">ID</a>
+      </th>
+
+<th colspan="1">
+    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.bug_severity,bugs.bug_id">Sev</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.priority,bugs.bug_id">Pri</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.rep_platform,bugs.bug_id">Plt</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?product=OpenMoko&amp;order=map_assigned_to.login_name,bugs.bug_id">Owner</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.bug_status,bugs.bug_id">State</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.resolution,bugs.bug_id">Result</a>
+  </th><th colspan="1">
+    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.short_desc,bugs.bug_id">Summary</a>
+  </th>
+
+
+    </tr>
+
+  <tr class="bz_critical bz_P2 ">
+
+    <td>
+      <a href="show_bug.cgi?id=1">1</a>
+    </td>
+
+    <td><nobr>cri</nobr>
+    </td>
+    <td><nobr>P2</nobr>
+    </td>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>laforge at openmoko.org</nobr>
+    </td>
+    <td><nobr>CLOS</nobr>
+    </td>
+    <td><nobr>FIXE</nobr>
+    </td>
+    <td>kernel is running way too slow
+    </td>
+
+  </tr>
+
+  
+
+
+  
+
+  <tr class="bz_normal bz_P2 ">
+
+    <td>
+      <a href="show_bug.cgi?id=2">2</a>
+    </td>
+
+    <td><nobr>nor</nobr>
+    </td>
+    <td><nobr>P2</nobr>
+    </td>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>laforge at openmoko.org</nobr>
+    </td>
+    <td><nobr>RESO</nobr>
+    </td>
+    <td><nobr>FIXE</nobr>
+    </td>
+    <td>SD card driver unstable
+    </td>
+
+  </tr>
+
+  
+
+
+  
+
+  <tr class="bz_normal bz_P2 ">
+
+    <td>
+      <a href="show_bug.cgi?id=4">4</a>
+    </td>
+
+    <td><nobr>nor</nobr>
+    </td>
+    <td><nobr>P2</nobr>
+    </td>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>laforge at openmoko.org</nobr>
+    </td>
+    <td><nobr>ASSI</nobr>
+    </td>
+    <td><nobr></nobr>
+    </td>
+    <td>random crashes of gsmd
+    </td>
+
+  </tr>
+
+  
+
+
+  
+
+  <tr class="bz_normal bz_P2 ">
+
+    <td>
+      <a href="show_bug.cgi?id=5">5</a>
+    </td>
+
+    <td><nobr>nor</nobr>
+    </td>
+    <td><nobr>P2</nobr>
+    </td>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>laforge at openmoko.org</nobr>
+    </td>
+    <td><nobr>RESO</nobr>
+    </td>
+    <td><nobr>FIXE</nobr>
+    </td>
+    <td>call progress information is lacking
+    </td>
+
+  </tr>
+
+  
+
+
+  
+
+  <tr class="bz_normal bz_P2 ">
+
+    <td>
+      <a href="show_bug.cgi?id=7">7</a>
+    </td>
+
+    <td><nobr>nor</nobr>
+    </td>
+    <td><nobr>P2</nobr>
+    </td>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>laforge at openmoko.org</nobr>
+    </td>
+    <td><nobr>CLOS</nobr>
+    </td>
+    <td><nobr>FIXE</nobr>
+    </td>
+    <td>PMU RTC driver date/time conversion is erroneous
+    </td>
+
+  </tr>
+
+  
+
+
+  
+
+  <tr class="bz_critical bz_P5 ">
+
+    <td>
+      <a href="show_bug.cgi?id=8">8</a>
+    </td>
+
+    <td><nobr>cri</nobr>
+    </td>
+    <td><nobr>P5</nobr>
+    </td>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>laforge at openmoko.org</nobr>
+    </td>
+    <td><nobr>RESO</nobr>
+    </td>
+    <td><nobr>FIXE</nobr>
+    </td>
+    <td>SD/MMC: Card sometimes not detected
+    </td>
+
+  </tr>
+
+  
+
+
+  
+
+  <tr class="bz_normal bz_P2 ">
+
+    <td>
+      <a href="show_bug.cgi?id=9">9</a>
+    </td>
+
+    <td><nobr>nor</nobr>
+    </td>
+    <td><nobr>P2</nobr>
+    </td>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>laforge at openmoko.org</nobr>
+    </td>
+    <td><nobr>ASSI low (kernel part)
+    </td>
+
+  </tr>
+
+  
+
+
+  
+
+  <tr class="bz <a href="show_bug.cgi?id=10">10</a>
+    </td>
+
+    <td><nobr>e>
+    </td>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>la>
+    <td><nobr>CLOS</nobr>
+    </td>
+    <td><nobr>FIXE</nobr>ng
+    </td>
+
+  </tr>
+
+  
+
+
+  
+
+  <tr class="bz_blocker bz_P2 "><nobr>blo</nobr>
+    </td>
+    <td><nobr>P2</nobr>
+    </td>
+ /nobr>
+    </td>
+    <td><nobr>ken_zhao at fic-sh.com.cn</nobr>
+  ><nobr>FIXE</nobr>
+    </td>
+    <td>u-boot lacks USB DFU suppo2">12</a>
+    </td>
+
+    <td><nobr>nor</nobr>
+    </td>
+    <td>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>gordon_hsu at f<td>Boot speed too low (bootloader part)
+    </td>
+
+  </tr>
+
+  ug.cgi?id=13">13</a>
+    </td>
+
+    <td><nobr>nor</nobr>
+    </d>
+    <td><nobr>Neo</nobr>
+    </td>
+    <td><nobr>teddy at fic-snobr>RESO</nobr>
+    </td>
+    <td><nobr>FIXE</nobr>
+    </td>
+  
+
+  <tr class="bz_minor bz_P2 ">
+
+    <td>
+      <a href="shonobr>min</nobr>
+    </td>
+    <td><nobr>P2</nobr>
+    </td>
+   nobr>
+    </td>
+    <td><nobr>RESO</nobr>
+    </td>
+    <td><noe before booting th...
+    </td>
+
+  </tr>
+
+  
+
+
+  
+
+  <tr class=15">15</a>
+    </td>
+
+    <td><nobr>nor</nobr>
+    </td>
+    <oko.org</nobr>%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list