[LU-12761] sanity test 103a syntax error using version_code Created: 13/Sep/19  Updated: 11/Jul/20  Resolved: 01/Mar/20

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.13.0, Lustre 2.12.3
Fix Version/s: Lustre 2.14.0, Lustre 2.12.6

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: Oleg Drokin
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   
        # LU-1482 mdd: Setting xattr are properly checked with and without ACLs
        if [ $MDS1_VERSION -gt $(version_code 2.8.55) ] ||
                { [ $MDS1_VERSION -lt $(version_code 2.6) ] &&
                        [ $MDS1_VERSION -ge $(version_code 2.5.29) ]; }

is incorrect since version_code() expects argument in the form of X.Y.Z-blah

The result is this syntax error:

[284] $ rm -rf d -- ok
101 commands (101 passed, 0 failed)
/home/green/git/lustre-release/lustre/tests/test-framework.sh: line 443: (2 << 16) | (6 << 8) | : syntax error: operand expected (error token is "| ")
/home/green/git/lustre-release/lustre/tests/sanity.sh: line 8620: [: -a: integer expression expected
performing setfacl...


 Comments   
Comment by Andreas Dilger [ 14/Sep/19 ]

It looks like the following will work:

        echo -n "$(((${1:-0} << 16) | (${2:-0} << 8) | ${3:-0}))"
Comment by Gerrit Updater [ 23/Sep/19 ]

Oleg Drokin (green@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36275
Subject: LU-12761: tests: make version_code() accept two number versions too
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 9924d4c9aadfff03fdc83537251756bca77ef1ed

Comment by Gerrit Updater [ 01/Mar/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36275/
Subject: LU-12761: tests: make version_code() accept two number versions too
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 6521dda6f4377c9c688ce4905cd94adf9f99013f

Comment by Peter Jones [ 01/Mar/20 ]

Landed for 2.14

Comment by Gerrit Updater [ 25/May/20 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/38715
Subject: LU-12761: tests: make version_code() accept two number versions too
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 947d491af9f07a64a782d68a16b8257432129550

Comment by Gerrit Updater [ 11/Jul/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38715/
Subject: LU-12761: tests: make version_code() accept two number versions too
Project: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: 551eba665c19a43f54ccbcc4eb0030effb5bbeee

Generated at Sat Feb 10 02:55:25 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.