~bladernr/checkbox/1095713-set-pipefail-on-sleep-jobs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
    <html>
    <head>
        <title>System Testing Report</title>
        <link rel="stylesheet" type="text/css" href="%(CHECKBOX_SHARE)s/report/styles.css" />
        <script type="text/javascript" src="%(CHECKBOX_SHARE)s/report/checkbox.js">
        </script>
    </head>
    <body>
        <!-- Quick and dirty preload to have disclosure triangle images cached -->
        <img src="%(CHECKBOX_SHARE)s/report/images/open.png" style="display: none;" /><img src="%(CHECKBOX_SHARE)s/report/images/closed.png" style="display: none;" />
        <div id="container">
            <div id="container-inner">

                <div id="title">
                    <h1>System Testing<span class="grey"> Report</span></h1>
                </div>
                <div id="content" class="clearfix">
                    <h2>Hardware Information</h2>
                    <xsl:apply-templates select=".//hardware/dmi" />
                    <xsl:apply-templates select=".//hardware/sysfs-attributes" />
                    <xsl:apply-templates select=".//hardware/processors" />
                    <xsl:apply-templates select=".//hardware/lspci" />
                </div>
                <div id="content" class="clearfix">
                    <h2>Software Information</h2>
                    <xsl:apply-templates select=".//software/packages" />
                    <xsl:apply-templates select=".//software/lsbrelease" />
                </div>
                <div id="content" class="clearfix">
                    <h2>Tests Performed</h2>
                    <xsl:apply-templates select=".//questions" />
                </div>
                <div id="content" class="clearfix">
                    <h2>Log Files and Environment Information</h2>
                    <xsl:apply-templates select=".//context" />
                </div>
            </div>
        </div>
    </body>
    </html>
</xsl:template>

<xsl:template match="summary">
    <h3 id="summary">Summary</h3>
    <p>This report was created using <xsl:value-of select="client/@name" /> <xsl:text> </xsl:text><xsl:value-of select="client/@version" /> on <xsl:value-of select="date_created/@value" />, on <xsl:value-of select="distribution/@value" /><xsl:text> </xsl:text><xsl:value-of select="distroseries/@value" /> (<xsl:value-of select="architecture/@value" />).</p>
    <p>You can view other reports for this system <a href="https://launchpad.net/+hwdb/+fingerprint/{system_id/@value}">here</a>.</p>
</xsl:template>

<xsl:template match="hardware/udev">
    <div onClick="showHide('udev');">
        <h3 id="udev"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />Devices detected in the system (udev)</h3>
    </div>
    <div class="data" id="udev-contents">
        <pre><xsl:value-of select="." /></pre>
    </div>
</xsl:template>

<xsl:template match="hardware/dmi">
    <span onClick="showHide('dmi');"><h3 id="dmi"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />Desktop Management Interface information</h3></span>
    <div class="data" id="dmi-contents" style="overflow: auto;">
        <pre><xsl:value-of select="." /></pre>
    </div>
</xsl:template>

<xsl:template match="hardware/sysfs-attributes">
    <span onClick="showHide('sysfs-attributes');"><h3 id="sysfs-attributes"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />sysfs-attributes</h3></span>
    <div class="data" id="sysfs-attributes-contents">
        <pre><xsl:value-of select="." /></pre>
    </div>
</xsl:template>

<xsl:template match="hardware/processors">
    <span onClick="showHide('processors');"><h3 id="processors"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />Processors</h3></span>
    <div class="data" id="processors-contents">
    <xsl:for-each select="processor">
        <h3><u>Processor <xsl:value-of select='@name' /></u></h3>
        <table>
            <tr>
                <th>Property</th>
                <th>Value</th>
            </tr>
        <xsl:for-each select="property">
            <tr>
                <td class="label"><xsl:value-of select="@name" /></td>
                <td class="property"><xsl:value-of select="." /></td>
            </tr>
        </xsl:for-each>
        </table>
	<br />
    </xsl:for-each>
    </div>
</xsl:template>

<xsl:template match="software/lsbrelease">
    <h3 id="lsbrelease">Installed version of Ubuntu</h3>
    <table>
        <xsl:for-each select="property">
            <tr>
                <td class="label"><xsl:value-of select="@name" /></td>
                <td><xsl:value-of select="." /></td>
            </tr>
        </xsl:for-each>
    </table>
</xsl:template>
<xsl:template match="software/packages">
    <span onClick="showHide('packages');"><h3 id="packages"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />Packages Installed</h3></span>
    <div class="data" id="packages-contents">
    <table>
        <tr>
            <th>Name</th>
            <th>Description</th>
        </tr>
        <xsl:for-each select="package">
            <tr>
                <td class="label"><xsl:value-of select="@name" /></td>
                <td><xsl:value-of select="property" /></td>
            </tr>
        </xsl:for-each>
    </table>
    </div>
</xsl:template>


<xsl:template match="questions">
    <h3 id="questions">Tests</h3>
        <table style="width: 700px">
        <tr>
            <th> </th>
            <th>Name</th>
            <th style="width: 15em;">Result</th>
            <th>Comment</th>
        </tr>
        <xsl:for-each select="question">
            <tr>
                <xsl:choose>
                    <xsl:when test="normalize-space(answer) = 'fail'">
                        <td><img class='resultimg' src='%(CHECKBOX_SHARE)s/report/images/fail.png' /></td>
                        <td class="label"><xsl:value-of select="@name" /></td>
                        <td style='background-color: #f00'>FAILED</td>
                        <td><xsl:value-of select="comment" /></td>
                    </xsl:when>
                    <xsl:when test="normalize-space(answer) = 'pass'">
                        <td><img class='resultimg' src='%(CHECKBOX_SHARE)s/report/images/pass.png' /></td>
                        <td class="label"><xsl:value-of select="@name" /></td>
                        <td style='background-color: #0f0'>PASSED</td>
                        <td><xsl:value-of select="comment" /></td>
                    </xsl:when>
                    <xsl:when test="normalize-space(answer) = 'unsupported'">
                        <td></td>
                        <td class="label"><xsl:value-of select="@name" /></td>
                        <td style='background-color: #888'>not required on this system</td>
                        <td><xsl:value-of select="comment" /></td>
                    </xsl:when>
                    <xsl:when test="normalize-space(answer) = 'untested'">
                        <td><img class='resultimg' src='%(CHECKBOX_SHARE)s/report/images/skip.png' /></td>
                        <td class="label"><xsl:value-of select="@name" /></td>
                        <td style='background-color: #888'>skipped</td>
                        <td><xsl:value-of select="comment" /></td>
                    </xsl:when>
                    <xsl:otherwise>
                        <td></td>
                        <td class="label"><xsl:value-of select="@name" /></td>
                        <td><xsl:value-of select="answer" /></td>
                        <td><xsl:value-of select="comment" /></td>
                    </xsl:otherwise>
                </xsl:choose>
            </tr>
        </xsl:for-each>
    </table>
</xsl:template>

<xsl:template match="context">
    <div id="packages-contents">    
    <xsl:for-each select="info">
	<span onClick="showHide('{generate-id(.)}');"><h3 id="{generate-id(.)}"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />
        <xsl:value-of select="@command" /></h3></span>
	<div class="data" id="{generate-id(.)}-contents" style="overflow: auto;">
	        <pre><xsl:value-of select="." /></pre>
	</div>
    </xsl:for-each>
    </div>
</xsl:template>

</xsl:stylesheet>