Code review comment for lp:~nelson-chu/opencompute/add-ocp-pch-job

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

« Back to merge proposal