[LU-11673] Correct shell issues/mistakes in Lustre test suites Created: 15/Nov/18 Updated: 04/Mar/22 Resolved: 15/Aug/19 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.12.0 |
| Fix Version/s: | Lustre 2.13.0, Lustre 2.12.4 |
| Type: | Improvement | Priority: | Minor |
| Reporter: | James Nunez (Inactive) | Assignee: | James Nunez (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | test_script_improvements, tests | ||
| Issue Links: |
|
||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
Running the Lustre test suites with shellcheck (https://github.com/koalaman/shellcheck), used in CodeFactor (https://www.codefactor.io/), has brought out a few issues. We need to correct any valid issues that these utilities bring out. As an example, shellcheck pointed out the following issue in sanity test 405
18918 test_405() {
18919 [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.6.92) -o \
18920 [ $(lustre_version_code client) -lt $(version_code 2.6.99) ] &&
18921 skip "Layout swap lock is not supported"
although in not the most straight forward way $ shellcheck myscript
Line 18918:
test_405() {
^-- SC1009: The mentioned syntax error was in this brace group.
Line 18919:
[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.6.92) -o \
^-- SC1073: Couldn't parse this test expression. Fix to allow more checks.
Line 18920:
[ $(lustre_version_code client) -lt $(version_code 2.6.99) ] &&
^-- SC1026: If grouping expressions inside [..], use \( ..\).
^-- SC1072: Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again.
In addition, the OpenGroup, has marked the use of some functionality as obsolete and “functionality described may be removed in a future version of this volume of POSIX.1-2017. Strictly Conforming POSIX Applications and Strictly Conforming XSI Applications shall not use obsolescent features.” In particular, under the test ([) page at http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html , use of the following are marked as obsolete: expression1 -a expression2
[OB XSI]
True if both expression1 and expression2 are true; otherwise, false. The -a binary primary is left associative. It has a higher precedence than -o.
expression1 -o expression2
[OB XSI]
True if either expression1 or expression2 is true; otherwise, false. The -o binary primary is left associative.
For a better explanation, see https://github.com/koalaman/shellcheck/wiki/SC2166. |
| Comments |
| Comment by Gerrit Updater [ 15/Nov/18 ] |
|
James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33670 |
| Comment by Gerrit Updater [ 30/Apr/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33670/ |
| Comment by Peter Jones [ 30/Apr/19 ] |
|
Landed for 2.13 |
| Comment by James Nunez (Inactive) [ 30/Apr/19 ] |
|
Reopening this ticket because there are a few more test script issues that should be cleaned up under this ticket. |
| Comment by Gerrit Updater [ 06/Jun/19 ] |
|
James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35079 |
| Comment by Gerrit Updater [ 06/Jun/19 ] |
|
James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35080 |
| Comment by Gerrit Updater [ 12/Jun/19 ] |
|
James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35210 |
| Comment by Gerrit Updater [ 27/Jun/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35079/ |
| Comment by Gerrit Updater [ 01/Aug/19 ] |
|
James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35669 |
| Comment by Gerrit Updater [ 15/Aug/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35080/ |
| Comment by Gerrit Updater [ 15/Aug/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35669/ |
| Comment by Peter Jones [ 15/Aug/19 ] |
|
All open patches seem to have landed for 2.13 |
| Comment by Gerrit Updater [ 05/Dec/19 ] |
|
James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36926 |
| Comment by Gerrit Updater [ 05/Dec/19 ] |
|
James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36927 |
| Comment by Gerrit Updater [ 05/Dec/19 ] |
|
James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36928 |
| Comment by Gerrit Updater [ 05/Dec/19 ] |
|
James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36929 |
| Comment by Gerrit Updater [ 12/Dec/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36926/ |
| Comment by Gerrit Updater [ 20/Dec/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36927/ |
| Comment by Gerrit Updater [ 20/Dec/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36928/ |
| Comment by Gerrit Updater [ 03/Jan/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36929/ |