Merge lp:~nelson-chu/opencompute/add-ocp-pch-job into lp:opencompute/checkbox

Proposed by Nelson Chu
Status: Rejected
Rejected by: Jeff Lane 
Proposed branch: lp:~nelson-chu/opencompute/add-ocp-pch-job
Merge into: lp:opencompute/checkbox
Diff against target: 158 lines (+131/-0)
5 files modified
data/whitelists/opencompute-certify-local.whitelist (+43/-0)
jobs/TC-001-0002-Platform_Controller_Hub.txt (+13/-0)
jobs/local.txt.in (+7/-0)
scripts/check_sata_port (+34/-0)
scripts/check_usb_port (+34/-0)
To merge this branch: bzr merge lp:~nelson-chu/opencompute/add-ocp-pch-job
Reviewer Review Type Date Requested Status
Open Compute Developers Pending
Review via email: mp+205754@code.launchpad.net

Description of the change

Add OCP PCH job

To post a comment you must log in.
Revision history for this message
Jeff Lane  (bladernr) wrote :

Comments, I had some free time, so I fixed some issues before merging your code. But for the future, please note the following:

1: you run dmesg to get your data when the tests run. This is prone to failure as dmesg is a dump of the kernel ring buffer. If there is something dumping a lot of data to the ring buffer, the info you want on both SATA and USB ports will be flushed from the buffer. This can also happen simply if the machine is booted and sits long enough for routine kernel messages to fill the buffer. It's probably not a major issue, just one I thought was worth mentioning as a potential issue if you start seeing false failures during testing.

On Ubuntu, you can look at /var/log/dmesg which is the dmesg dump immediately after booting and does not change until the next boot.

2: You have comparisons like this:
[ $output == "2.0" ]

You need to put the $output in quotes like this:
[ "$output" == "2.0" ] to ensure you're doing string comparisons. Otherwise, an error is generated like this when the script runs:
./check_usb_port: line 28: [: ==: unary operator expected

Revision history for this message
Jeff Lane  (bladernr) wrote :

https://code.launchpad.net/~bladernr/opencompute/checkbox-merge-nelsons-pch-jobs/+merge/205811

I rejected your merge proposal and pushed my own. The link is above.

That is basically your branch, but I fixed the quotation mark issue in number 2 above. So your code has now landed in trunk.

I wish there was a cleaner way to do it, but tis is the only way. Next time, I'll just have you fix the issues yourself and re-submit.

Thanks for the submission, the code should be merged in soon once Tarmac picks it up.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'data/whitelists/opencompute-certify-local.whitelist'
2--- data/whitelists/opencompute-certify-local.whitelist 1970-01-01 00:00:00 +0000
3+++ data/whitelists/opencompute-certify-local.whitelist 2014-02-11 12:21:29 +0000
4@@ -0,0 +1,43 @@
5+# Resource Jobs
6+block_device
7+cdimage
8+cpuinfo
9+device
10+dmi
11+dpkg
12+efi
13+environment
14+gconf
15+lsb
16+meminfo
17+module
18+optical_drive
19+package
20+sleep
21+uname
22+#Info attachment jobs
23+__info__
24+cpuinfo_attachment
25+dmesg_attachment
26+dmi_attachment
27+dmidecode_attachment
28+efi_attachment
29+lspci_attachment
30+lshw_attachment
31+mcelog_attachment
32+meminfo_attachment
33+modprobe_attachment
34+modules_attachment
35+sysctl_attachment
36+sysfs_attachment
37+udev_attachment
38+lsmod_attachment
39+acpi_sleep_attachment
40+info/hdparm
41+info/hdparm_.*.txt
42+installer_debug.gz
43+info/disk_partitions
44+# Actual test cases
45+__TC-001-0002-Platform_Controller_Hub__
46+TC-001-0002-001-SATA_port
47+TC-001-0002-002-USB_2.0
48
49=== added file 'jobs/TC-001-0002-Platform_Controller_Hub.txt'
50--- jobs/TC-001-0002-Platform_Controller_Hub.txt 1970-01-01 00:00:00 +0000
51+++ jobs/TC-001-0002-Platform_Controller_Hub.txt 2014-02-11 12:21:29 +0000
52@@ -0,0 +1,13 @@
53+plugin: shell
54+name: TC-001-0002-001-SATA_port
55+command: check_sata_port
56+description:
57+ 1. Use dmesg command to gather SATA information.
58+ 2. Criteria: SATA port speed up to 6.0Gps.
59+
60+plugin: shell
61+name: TC-001-0002-002-USB_2.0
62+command: check_usb_port
63+description:
64+ 1. Use dmesg command to gather USB information.
65+ 2. Criteria: USB version must be 2.0.
66
67=== modified file 'jobs/local.txt.in'
68--- jobs/local.txt.in 2013-10-01 00:55:26 +0000
69+++ jobs/local.txt.in 2014-02-11 12:21:29 +0000
70@@ -109,3 +109,10 @@
71 command:
72 shopt -s extglob
73 cat $CHECKBOX_SHARE/jobs/sniff.txt?(.in)
74+
75+name: __TC-001-0002-Platform_Controller_Hub__
76+plugin: local
77+_description: Verify platform controller hub functionality
78+command:
79+ shopt -s extglob
80+ cat $CHECKBOX_SHARE/jobs/TC-001-0002-Platform_Controller_Hub.txt?(.in)
81
82=== added file 'scripts/check_sata_port'
83--- scripts/check_sata_port 1970-01-01 00:00:00 +0000
84+++ scripts/check_sata_port 2014-02-11 12:21:29 +0000
85@@ -0,0 +1,34 @@
86+#!/bin/bash
87+#
88+# Copyright (C) 2010-2013 by Cloud Computing Center for Mobile Applications
89+# Industrial Technology Research Institute
90+#
91+# check_sata_port
92+# 1. Use dmesg command to gather SATA information.
93+# 2. Criteria: SATA port speed up to 6.0Gps.
94+#
95+# Authors
96+# Nelson Chu <Nelson.Chu@itri.org.tw>
97+#
98+# This program is free software: you can redistribute it and/or modify
99+# it under the terms of the GNU General Public License version 3,
100+# as published by the Free Software Foundation.
101+#
102+# This program is distributed in the hope that it will be useful,
103+# but WITHOUT ANY WARRANTY; without even the implied warranty of
104+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
105+# GNU General Public License for more details.
106+#
107+# You should have received a copy of the GNU General Public License
108+# along with this program. If not, see <http://www.gnu.org/licenses/>.
109+#
110+
111+output=`dmesg |grep -i "SATA link up"| awk '{print $7}'`
112+
113+if [ $output == "6.0" ]; then
114+ echo "Support SATA 6Gps ports"
115+ exit 0
116+fi
117+
118+echo "Do not support SATA 6Gps ports"
119+exit 1
120
121=== added file 'scripts/check_usb_port'
122--- scripts/check_usb_port 1970-01-01 00:00:00 +0000
123+++ scripts/check_usb_port 2014-02-11 12:21:29 +0000
124@@ -0,0 +1,34 @@
125+#!/bin/bash
126+#
127+# Copyright (C) 2010-2013 by Cloud Computing Center for Mobile Applications
128+# Industrial Technology Research Institute
129+#
130+# check_usb_port
131+# 1. Use dmesg command to gather USB information.
132+# 2. Criteria: USB version must be 2.0.
133+#
134+# Authors
135+# Nelson Chu <Nelson.Chu@itri.org.tw>
136+#
137+# This program is free software: you can redistribute it and/or modify
138+# it under the terms of the GNU General Public License version 3,
139+# as published by the Free Software Foundation.
140+#
141+# This program is distributed in the hope that it will be useful,
142+# but WITHOUT ANY WARRANTY; without even the implied warranty of
143+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
144+# GNU General Public License for more details.
145+#
146+# You should have received a copy of the GNU General Public License
147+# along with this program. If not, see <http://www.gnu.org/licenses/>.
148+#
149+
150+output=`dmesg |grep -i ehci_hcd:| awk '{print $5}'`
151+
152+if [ $output == "2.0" ]; then
153+ echo "Support USB 2.0 ports"
154+ exit 0
155+fi
156+
157+echo "Do not support USB 2.0 ports"
158+exit 1

Subscribers

People subscribed via source and target branches