r776 - in tags: . v7-V1-3R11/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-02-14 16:27:08 +0000 (Mon, 14 Feb 2011)
New Revision: 776
Added:
tags/v7-V1-3R11/
tags/v7-V1-3R11/v7/version.py
Log:
tag version
Copied: tags/v7-V1-3R11/v7/version.py (from rev 335, trunk/v7/version.py)
===================================================================
--- tags/v7-V1-3R11/v7/version.py (rev 0)
+++ tags/v7-V1-3R11/v7/version.py 2011-02-14 16:27:08 UTC (rev 776)
@@ -0,0 +1,5 @@
+
+# v7/version.py is automatically-generated - DO NOT EDIT
+version = '1.3'
+release = '11'
+rhel_version = '6'
13 years, 3 months
r775 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-02-14 16:26:27 +0000 (Mon, 14 Feb 2011)
New Revision: 775
Modified:
trunk/Makefile
Log:
R11
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2011-02-14 16:24:53 UTC (rev 774)
+++ trunk/Makefile 2011-02-14 16:26:27 UTC (rev 775)
@@ -14,7 +14,7 @@
# Author: Greg Nichols
V7_VERSION := 1.3
-V7_RELEASE := 10
+V7_RELEASE := 11
V7_VERSION_RELEASE := $(V7_VERSION)-$(V7_RELEASE)
V7_VERSION_PY := v7/version.py
V7_SVN_MODULE := svn+ssh://svn.fedorahosted.org/svn/v7
13 years, 3 months
r774 - trunk/test-env/www
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-02-14 16:24:53 +0000 (Mon, 14 Feb 2011)
New Revision: 774
Modified:
trunk/test-env/www/Makefile
Log:
XSLT processing of results.xml prototype
Modified: trunk/test-env/www/Makefile
===================================================================
--- trunk/test-env/www/Makefile 2011-02-14 16:24:20 UTC (rev 773)
+++ trunk/test-env/www/Makefile 2011-02-14 16:24:53 UTC (rev 774)
@@ -15,16 +15,17 @@
.PHONY: clean install
+V7_CATALOG_CCS_REPO := https://svn.devel.redhat.com/repos/hwcert-catalog/branches/catalog-v3.6-0...
+V7_CATALOG_CSS_COPY := $(shell pwd)/catalog-css
-
-SUBDIRS := cgi css images
+SUBDIRS := css cgi images
FILES := index.html
-all:
- for i in $(SUBDIRS); do $(MAKE) -C $$i; done
+catalogcss:
+ svn co $(V7_CATALOG_CCS_REPO) $(V7_CATALOG_CSS_COPY)
install:
- for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
+ for i in $(SUBDIRS); do $(MAKE) -C $$i V7_CATALOG_CSS_COPY=$(V7_CATALOG_CSS_COPY) install; done
for file in $(FILES); do cp -f $$file $(DESTDIR)/var/v7/$$file; done
chcon -R root:object_r:httpd_sys_content_t $(DESTDIR)/var/v7
13 years, 3 months
r773 - trunk/test-env/www
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-02-14 16:24:20 +0000 (Mon, 14 Feb 2011)
New Revision: 773
Modified:
trunk/test-env/www/index.html
Log:
XSLT processing of results.xml prototype
Modified: trunk/test-env/www/index.html
===================================================================
--- trunk/test-env/www/index.html 2011-02-14 16:23:33 UTC (rev 772)
+++ trunk/test-env/www/index.html 2011-02-14 16:24:20 UTC (rev 773)
@@ -25,10 +25,11 @@
<h1>Hardware Certification Test Suite</h1>
<p> Welcome to the Red Hat v7 Hardware Certification Test Suite.</p>
-
- <a href="cgi/v7web.py">Test Results</a><br>
<br>
- <a href="cgi/v7xml.py">Test Results (XML)</a><br>
+ Test Results:<br>
+ <a href="cgi/v7xml.py?sheet=summary&content=html">Summary</a><br>
+ <a href="cgi/v7xml.py">Filtered XML</a> <br>
+ <a href="results.xml">Raw XML</a<br>
<br>
<a href="docs">Documentation</a><br>
<br>
13 years, 3 months
r772 - trunk/test-env/www/css
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-02-14 16:23:33 +0000 (Mon, 14 Feb 2011)
New Revision: 772
Modified:
trunk/test-env/www/css/Makefile
Log:
XSLT processing of results.xml prototype
Modified: trunk/test-env/www/css/Makefile
===================================================================
--- trunk/test-env/www/css/Makefile 2011-02-14 16:22:39 UTC (rev 771)
+++ trunk/test-env/www/css/Makefile 2011-02-14 16:23:33 UTC (rev 772)
@@ -16,12 +16,15 @@
.PHONY: clean
+V7_CATALOG_CSS :=
+
+
FILES := v7.css results.css
clean:
rm -rf $(DESTDIR)/var/v7/css
all install:
- rm -rf $(DESTDIR)/var/v7/css
mkdir -p $(DESTDIR)/var/v7/css
for file in $(FILES); do install -m 644 $$file $(DESTDIR)/var/v7/css/$$file; done
+ for file in $(V7_CATALOG_CSS_FILES); do cp -f $(V7_CATALOG_CSS_COPY)/$$file $(DESTDIR)/var/v7/css/$$file; done
13 years, 3 months
r771 - trunk/test-env/www/cgi
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-02-14 16:22:39 +0000 (Mon, 14 Feb 2011)
New Revision: 771
Modified:
trunk/test-env/www/cgi/Makefile
trunk/test-env/www/cgi/v7xml.py
Log:
XSLT processing of results.xml prototype
Modified: trunk/test-env/www/cgi/Makefile
===================================================================
--- trunk/test-env/www/cgi/Makefile 2011-02-14 16:21:59 UTC (rev 770)
+++ trunk/test-env/www/cgi/Makefile 2011-02-14 16:22:39 UTC (rev 771)
@@ -28,6 +28,6 @@
rm -rf $(DESTDIR)/var/v7/cgi
mkdir -p $(DESTDIR)/var/v7/cgi
for file in $(FILES); do cp -f $$file $(DESTDIR)/var/v7/cgi/$$file; done
- for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
+ for i in $(SUBDIRS); do $(MAKE) -C $$i V7_CATALOG_CSS_COPY=$(V7_CATALOG_CSS_COPY) install; done
mkdir -p $(DESTDIR)/etc/httpd/conf.d
cp -f v7.conf $(DESTDIR)/etc/httpd/conf.d/.
Modified: trunk/test-env/www/cgi/v7xml.py
===================================================================
--- trunk/test-env/www/cgi/v7xml.py 2011-02-14 16:21:59 UTC (rev 770)
+++ trunk/test-env/www/cgi/v7xml.py 2011-02-14 16:22:39 UTC (rev 771)
@@ -25,17 +25,25 @@
environment = Environment()
+import cgitb
+cgitb.enable()
+
+
def getParameters():
fieldStorage = cgi.FieldStorage()
# convert to a regular dict()
- parameters = { "devices":"hide"}
+ parameters = { "sheet": "default", "content":"xml", "devices":"\'hide\'", "device-classes": "\'hide\'"}
for key in fieldStorage.keys():
- # assume all parameter values are strings (wrap them in ''s)
- parameters[key] = "\'%s\'" % fieldStorage[key].value
+ if key in ["sheet", "content"]:
+ parameters[key] = fieldStorage[key].value
+ else:
+ # assume all parameter values are strings (wrap them in ''s)
+ parameters[key] = "\'%s\'" % fieldStorage[key].value
return parameters
+
def doTransform(parameters):
- xslt = etree.parse("/var/v7/xsl/default.xsl")
+ xslt = etree.parse("/var/v7/xsl/%s.xsl" % parameters["sheet"])
transform = etree.XSLT(xslt)
results = etree.parse(environment.getResultsPath())
output = transform(results, **parameters)
@@ -45,9 +53,14 @@
output.write(sys.stdout)
sys.stdout.flush()
-print "Content-type: text/xml";
-print
parameters = getParameters()
+print "Content-type: text/%s" % parameters["content"];
+print
+print "<!--"
+for key in parameters:
+ print "%s=%s" % (key, parameters[key])
+print" -->"
+
doTransform(parameters)
sys.stdout.flush()
13 years, 3 months
r770 - trunk/test-env/www/cgi/xsl
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-02-14 16:21:59 +0000 (Mon, 14 Feb 2011)
New Revision: 770
Modified:
trunk/test-env/www/cgi/xsl/Makefile
Log:
XSLT processing of results.xml prototype
Modified: trunk/test-env/www/cgi/xsl/Makefile
===================================================================
--- trunk/test-env/www/cgi/xsl/Makefile 2011-02-14 16:21:36 UTC (rev 769)
+++ trunk/test-env/www/cgi/xsl/Makefile 2011-02-14 16:21:59 UTC (rev 770)
@@ -16,12 +16,15 @@
.PHONY: clean
-FILES := default.xsl
+FILES := default.xsl test.xsl filter.xsl summary.xsl run.xsl
+V7_CATALOG_XSL := xml-package-summary.xsl
+
clean:
rm -rf $(DESTDIR)/var/v7/xsl
-all install:
- rm -rf $(DESTDIR)/var/v7/xsl
+install:
mkdir -p $(DESTDIR)/var/v7/xsl
+ for file in $(V7_CATALOG_XSL); do cp -f $(V7_CATALOG_CSS_COPY)/$$file $(DESTDIR)/var/v7/xsl/$$file; done
for file in $(FILES); do cp -f $$file $(DESTDIR)/var/v7/xsl/$$file; done
+
13 years, 3 months
r769 - trunk/test-env/www/cgi/xsl
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-02-14 16:21:36 +0000 (Mon, 14 Feb 2011)
New Revision: 769
Added:
trunk/test-env/www/cgi/xsl/filter.xsl
trunk/test-env/www/cgi/xsl/run.xsl
trunk/test-env/www/cgi/xsl/summary.xsl
trunk/test-env/www/cgi/xsl/test.xsl
Modified:
trunk/test-env/www/cgi/xsl/default.xsl
Log:
XSLT processing of results.xml prototype
Modified: trunk/test-env/www/cgi/xsl/default.xsl
===================================================================
--- trunk/test-env/www/cgi/xsl/default.xsl 2011-02-04 20:46:58 UTC (rev 768)
+++ trunk/test-env/www/cgi/xsl/default.xsl 2011-02-14 16:21:36 UTC (rev 769)
@@ -9,41 +9,7 @@
</xsl:copy>
</xsl:template>
- <!-- only show device classes if they have planned tests -->
- <xsl:template match="device-class">
- <xsl:if test="count(test) > 0">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:if>
- </xsl:template>
+ <xsl:include href="filter.xsl"></xsl:include>
- <!-- set any <output> elements' name attributes that are not already set -->
- <xsl:template match="output[not(@name)]">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:attribute name="name"><xsl:text>Test Log</xsl:text></xsl:attribute>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- <!-- just show the name of the attached file, not the actual payload -->
- <xsl:template match="attachment">
- <attachment>attachment: <xsl:value-of select="@name"/></attachment>
- </xsl:template>
-
- <!-- by default, devices are hidden. "show" shows just the product and source, full shows all the properties -->
- <xsl:template match="device">
- <xsl:if test="$devices='show'">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- </xsl:copy>
- </xsl:if>
- <xsl:if test="$devices='full'">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:if>
- </xsl:template>
</xsl:stylesheet>
Added: trunk/test-env/www/cgi/xsl/filter.xsl
===================================================================
--- trunk/test-env/www/cgi/xsl/filter.xsl (rev 0)
+++ trunk/test-env/www/cgi/xsl/filter.xsl 2011-02-14 16:21:36 UTC (rev 769)
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <!-- general filtering of v7 results.xml files
+
+ parameters:
+ devices: hide | show | full
+ device-classes: hide | show | full
+
+ - hides attachment payloads
+
+
+ -->
+
+ <xsl:template match="device-class">
+ <xsl:if test="$device-classes = 'hide'">
+ <xsl:apply-templates select="node()"/>
+ </xsl:if>
+ <xsl:if test="$device-classes = 'show'">
+ <xsl:if test="count(test) > 0">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="$device-classes = 'full'">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- hide deleted tests -->
+ <xsl:template match="test">
+ <xsl:if test="not(@status) or (@status != 'deleted')">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- set any <output> elements' name attributes that are not already set -->
+ <xsl:template match="output[not(@name)]">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:attribute name="name"><xsl:text>Test Log</xsl:text></xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+ <!-- just show the name of the attached file, not the actual payload -->
+ <xsl:template match="attachment">
+ <attachment>attachment: <xsl:value-of select="@name"/></attachment>
+ </xsl:template>
+
+ <!-- by default, devices are hidden. "show" shows just the product and source, full shows all the properties -->
+ <xsl:template match="device">
+ <xsl:if test="$devices='show'">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ </xsl:copy>
+ </xsl:if>
+ <xsl:if test="$devices='full'">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
+
+
+</xsl:stylesheet>
+
+
Added: trunk/test-env/www/cgi/xsl/run.xsl
===================================================================
--- trunk/test-env/www/cgi/xsl/run.xsl (rev 0)
+++ trunk/test-env/www/cgi/xsl/run.xsl 2011-02-14 16:21:36 UTC (rev 769)
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="test"/>
+ <xsl:param name="run" select="'all'"/>
+ <xsl:param name="device"/>
+
+ <xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="/certification-test/device-class/test">
+ <xsl:if test="not(@status) or (@status != 'deleted')">
+ <xsl:if test="(@name = $test) and (@logical-device = $device)">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="/certification-test/device-class/test/run">
+ <xsl:choose>
+ <xsl:when test="$run = 'all'">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="@number = $run">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+
+ <xsl:include href="filter.xsl"></xsl:include>
+
+</xsl:stylesheet>
+
+
Added: trunk/test-env/www/cgi/xsl/summary.xsl
===================================================================
--- trunk/test-env/www/cgi/xsl/summary.xsl (rev 0)
+++ trunk/test-env/www/cgi/xsl/summary.xsl 2011-02-14 16:21:36 UTC (rev 769)
@@ -0,0 +1,150 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="/certification-test">
+ <!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -->
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>V7 <xsl:value-of select="hardware/vendor"/> <xsl:value-of select="hardware/model"/></title>
+ <link rel="shortcut icon" href="/v7/images/favicon.ico" />
+ <link rel="stylesheet" href="/v7/css/v7.css" />
+ </head>
+
+ <body id="mainone">
+ <div id="wrap">
+ <div id="innerwrap">
+ <!-- HEADER -->
+ <div id="header">
+ <a href="/v7"><img src="/v7/images/logo_rh_home.png" alt="Red Hat Home" width="96" height="31" id="rhLogo" /></a>
+ </div><!-- end header -->
+
+ <!-- overview -->
+ <h1>Hardware Certification Test Suite</h1>
+
+ <table class="overview">
+ <thead></thead>
+
+ <tr><td>Vendor:</td><td><xsl:value-of select="hardware/vendor"/></td></tr>
+ <tr><td>Model:</td><td><xsl:value-of select="hardware/model"/></td></tr>
+ <tr><td>Arch:</td><td><xsl:value-of select="hardware/arch"/></td></tr>
+ <tr><td>
+ OS:</td><td><xsl:value-of select="certification/os/product"/><xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
+ <xsl:value-of select="certification/os/release"/>
+ (<xsl:value-of select="certification/os/name"/>)
+ </td></tr>
+
+ <tr><td>V7:</td><td><xsl:value-of select="@v7-version"/> release <xsl:value-of select="@v7-release" /></td></tr>
+ <tr><td>Date:</td><td><xsl:value-of select="@plan-time" /></td></tr>
+ </table>
+
+
+ <table class="navigation">
+ <tr><td>See Also:</td>
+ <td><a href="v7xml.py?sheet=summary">test summary</a></td>
+
+ <td><a href="v7xml.py?sheet=device">device details</a></td>
+ </tr>
+ </table>
+
+
+ <h2>Test Results:</h2>
+ <table class="results" cellpadding="0" cellspacing="0" border="0">
+ <thead>
+ <tr>
+ <th colspan="2" align="right">Run:</th>
+ <xsl:call-template name="runTableHeader">
+ <xsl:with-param name="currentRun" select="1"/>
+ <xsl:with-param name="runs" select="@number-of-runs"/>
+ </xsl:call-template>
+ </tr>
+ </thead>
+ <xsl:for-each select="/certification-test/device-class/test">
+ <xsl:if test="not(@status) or (@status != 'deleted')">
+ <xsl:variable name="currentTest" select="." />
+ <tr>
+ <td>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>v7xml.py?sheet=run&test=</xsl:text><xsl:value-of select="@name"/>
+ <xsl:if test="@logical-device != ''">
+ <xsl:text>&device=</xsl:text><xsl:value-of select="$currentTest/@logical-device"/>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ <td><xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text><xsl:value-of select="@logical-device"/></td>
+
+ <xsl:call-template name="runTableRow">
+ <xsl:with-param name="currentRunNumber" select="1"/>
+ <xsl:with-param name="runs" select="/certification-test/@number-of-runs"/>
+ <xsl:with-param name="currentTest" select="$currentTest"/>
+ <xsl:with-param name="currentRun" select="$currentTest/run"/>
+ </xsl:call-template>
+
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ </table>
+
+ </div>
+ </div>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template name="runTableHeader">
+ <xsl:param name="currentRun"/>
+ <xsl:param name="runs"/>
+ <xsl:if test="$currentRun <= $runs">
+ <th><xsl:value-of select="$currentRun"/></th>
+ <xsl:call-template name="runTableHeader">
+ <xsl:with-param name="currentRun" select="$currentRun + 1"/>
+ <xsl:with-param name="runs" select="$runs"/>
+ </xsl:call-template>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template name="runTableRow">
+ <xsl:param name="currentRunNumber"/>
+ <xsl:param name="runs"/>
+ <xsl:param name="currentTest"/>
+ <xsl:param name="currentRun"/>
+ <xsl:if test="$currentRunNumber <= $runs">
+ <xsl:choose>
+ <xsl:when test="number($currentRun/@number) = number($currentRunNumber)">
+ <td>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>v7xml.py?sheet=run&test=</xsl:text><xsl:value-of select="$currentTest/@name"/>
+ <xsl:text>&run=</xsl:text><xsl:value-of select="$currentRun/@number"/>
+ <xsl:if test="$currentTest/@logical-device != ''">
+ <xsl:text>&device=</xsl:text><xsl:value-of select="$currentTest/@logical-device"/>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:value-of select="$currentRun/summary" />
+ </a>
+ </td>
+ <xsl:call-template name="runTableRow">
+ <xsl:with-param name="currentRunNumber" select="$currentRunNumber + 1"/>
+ <xsl:with-param name="runs" select="$runs"/>
+ <xsl:with-param name="currentTest" select="$currentTest"/>
+ <xsl:with-param name="currentRun" select="$currentRun/following::run"/>
+ </xsl:call-template>
+
+ </xsl:when>
+ <xsl:otherwise>
+ <td><xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text></td>
+ <xsl:call-template name="runTableRow">
+ <xsl:with-param name="currentRunNumber" select="$currentRunNumber + 1"/>
+ <xsl:with-param name="runs" select="$runs"/>
+ <xsl:with-param name="currentTest" select="$currentTest"/>
+ <xsl:with-param name="currentRun" select="$currentRun"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>
+
\ No newline at end of file
Added: trunk/test-env/www/cgi/xsl/test.xsl
===================================================================
--- trunk/test-env/www/cgi/xsl/test.xsl (rev 0)
+++ trunk/test-env/www/cgi/xsl/test.xsl 2011-02-14 16:21:36 UTC (rev 769)
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+
+ <xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="/certification-test/device-class/test">
+ <xsl:if test="@name = $test">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="/certification-test/device-class/test/run">
+ <xsl:if test="@number = $run">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:include href="filter.xsl"></xsl:include>
+
+</xsl:stylesheet>
+
+
13 years, 3 months
r768 - in trunk/test-env/www: . cgi cgi/xsl css
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-02-04 20:46:58 +0000 (Fri, 04 Feb 2011)
New Revision: 768
Added:
trunk/test-env/www/cgi/v7xml.py
trunk/test-env/www/cgi/xsl/
trunk/test-env/www/cgi/xsl/Makefile
trunk/test-env/www/cgi/xsl/default.xsl
Modified:
trunk/test-env/www/cgi/Makefile
trunk/test-env/www/css/results.css
trunk/test-env/www/index.html
Log:
XSLT processing of results.xml prototype
Modified: trunk/test-env/www/cgi/Makefile
===================================================================
--- trunk/test-env/www/cgi/Makefile 2011-01-31 21:20:28 UTC (rev 767)
+++ trunk/test-env/www/cgi/Makefile 2011-02-04 20:46:58 UTC (rev 768)
@@ -16,9 +16,11 @@
.PHONY: clean
-FILES := v7web.py
+FILES := v7web.py v7xml.py
+SUBDIRS := xsl
clean:
+ for i in $(SUBDIRS); do $(MAKE) -C $$i; done
rm -rf $(DESTDIR)/var/v7/cgi
rm -rf $(DESTDIR)/etc/httpd/conf.d/v7.conf
@@ -26,5 +28,6 @@
rm -rf $(DESTDIR)/var/v7/cgi
mkdir -p $(DESTDIR)/var/v7/cgi
for file in $(FILES); do cp -f $$file $(DESTDIR)/var/v7/cgi/$$file; done
+ for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
mkdir -p $(DESTDIR)/etc/httpd/conf.d
cp -f v7.conf $(DESTDIR)/etc/httpd/conf.d/.
Added: trunk/test-env/www/cgi/v7xml.py
===================================================================
--- trunk/test-env/www/cgi/v7xml.py (rev 0)
+++ trunk/test-env/www/cgi/v7xml.py 2011-02-04 20:46:58 UTC (rev 768)
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
+# Public License v.2.
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Greg Nichols
+#
+
+import os,sys,cgi,lxml
+from lxml import etree
+v7ClassLibraryPath = '/usr/share/v7/lib/'
+sys.path.append(v7ClassLibraryPath)
+os.putenv("PYTHONPATH", v7ClassLibraryPath)
+
+from v7.environment import Environment
+
+environment = Environment()
+
+def getParameters():
+ fieldStorage = cgi.FieldStorage()
+ # convert to a regular dict()
+ parameters = { "devices":"hide"}
+ for key in fieldStorage.keys():
+ # assume all parameter values are strings (wrap them in ''s)
+ parameters[key] = "\'%s\'" % fieldStorage[key].value
+ return parameters
+
+def doTransform(parameters):
+ xslt = etree.parse("/var/v7/xsl/default.xsl")
+ transform = etree.XSLT(xslt)
+ results = etree.parse(environment.getResultsPath())
+ output = transform(results, **parameters)
+
+
+ # write the transformed doc to the output
+ output.write(sys.stdout)
+ sys.stdout.flush()
+
+print "Content-type: text/xml";
+print
+parameters = getParameters()
+doTransform(parameters)
+sys.stdout.flush()
+
+
Property changes on: trunk/test-env/www/cgi/v7xml.py
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/test-env/www/cgi/xsl/Makefile
===================================================================
--- trunk/test-env/www/cgi/xsl/Makefile (rev 0)
+++ trunk/test-env/www/cgi/xsl/Makefile 2011-02-04 20:46:58 UTC (rev 768)
@@ -0,0 +1,27 @@
+# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
+# Public License v.2.
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Bill Peck
+
+.PHONY: clean
+
+
+FILES := default.xsl
+
+clean:
+ rm -rf $(DESTDIR)/var/v7/xsl
+
+all install:
+ rm -rf $(DESTDIR)/var/v7/xsl
+ mkdir -p $(DESTDIR)/var/v7/xsl
+ for file in $(FILES); do cp -f $$file $(DESTDIR)/var/v7/xsl/$$file; done
Added: trunk/test-env/www/cgi/xsl/default.xsl
===================================================================
--- trunk/test-env/www/cgi/xsl/default.xsl (rev 0)
+++ trunk/test-env/www/cgi/xsl/default.xsl 2011-02-04 20:46:58 UTC (rev 768)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+
+ <xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <!-- only show device classes if they have planned tests -->
+ <xsl:template match="device-class">
+ <xsl:if test="count(test) > 0">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- set any <output> elements' name attributes that are not already set -->
+ <xsl:template match="output[not(@name)]">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:attribute name="name"><xsl:text>Test Log</xsl:text></xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+ <!-- just show the name of the attached file, not the actual payload -->
+ <xsl:template match="attachment">
+ <attachment>attachment: <xsl:value-of select="@name"/></attachment>
+ </xsl:template>
+
+ <!-- by default, devices are hidden. "show" shows just the product and source, full shows all the properties -->
+ <xsl:template match="device">
+ <xsl:if test="$devices='show'">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ </xsl:copy>
+ </xsl:if>
+ <xsl:if test="$devices='full'">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
+
Modified: trunk/test-env/www/css/results.css
===================================================================
--- trunk/test-env/www/css/results.css 2011-01-31 21:20:28 UTC (rev 767)
+++ trunk/test-env/www/css/results.css 2011-02-04 20:46:58 UTC (rev 768)
@@ -55,15 +55,24 @@
device:before
{
display: block;
- content: attr(source) ': ' attr(product) ' (' attr(udi) ')';
-
+ font-weight: 700;
+ content: attr(product) ' ' attr(udi);
}
device
{
display: block;
margin: 10px;
}
+property:before
+{
+ content: attr(name) ': ';
+}
+property
+{
+ display: block;
+}
+
test:before
{
display: block;
@@ -80,7 +89,7 @@
run:before
{
display: block;
- content: 'run ' attr(number) ':';
+ content: 'run ' attr(number) ': ' attr(run-time);
font-weight: 700;
margin: 10px;
}
@@ -88,8 +97,14 @@
summary
{
- display: inline;
+ display: block;
}
+output:before
+{
+ display: table;
+ content: attr(name)':';
+ font-weight: 700;
+}
output
{
display: table;
@@ -103,8 +118,14 @@
margin: 10px;
}
+attachment
+{
+ display: table;
+ content: 'attachment: ' attr(name);
+ font-weight: 700;
+}
-hal, kudzu, system, test-server, property
+hal, kudzu, system, test-server
{
display: none;
}
Modified: trunk/test-env/www/index.html
===================================================================
--- trunk/test-env/www/index.html 2011-01-31 21:20:28 UTC (rev 767)
+++ trunk/test-env/www/index.html 2011-02-04 20:46:58 UTC (rev 768)
@@ -28,6 +28,8 @@
<a href="cgi/v7web.py">Test Results</a><br>
<br>
+ <a href="cgi/v7xml.py">Test Results (XML)</a><br>
+ <br>
<a href="docs">Documentation</a><br>
<br>
<a href="http://hardware.redhat.com">Red Hat Hardware Catalog</a></br>
13 years, 3 months