[LU-16804] Exported variable not available in test scripts Created: 03/May/23  Updated: 30/Nov/23  Resolved: 31/May/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Minor
Reporter: Sebastien Buisson Assignee: Sebastien Buisson
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

I have a strange behavior with a custom test for the patch https://review.whamcloud.com/c/fs/lustre-release/+/50825.

I specify env=SHARED_KEY=true, and it seems to be taken into account, but not from the beginning. With a grep on the debug traces I added, we can see:

2023-05-03T21:41:51 export SHARED_KEY="true"
2023-05-03T21:41:51 SHARED_KEY=false LGSS_SK= GSS_SK=false
2023-05-03T21:41:51 LGSS_SK=
2023-05-03T21:42:26 trevis-129vm4: SHARED_KEY=false LGSS_SK= GSS_SK=false
2023-05-03T21:42:26 trevis-129vm4: LGSS_SK=
2023-05-03T21:42:26 trevis-129vm5: SHARED_KEY=false LGSS_SK= GSS_SK=false
2023-05-03T21:42:26 trevis-129vm5: LGSS_SK=
2023-05-03T21:42:26 trevis-129vm3: SHARED_KEY=false LGSS_SK= GSS_SK=false
2023-05-03T21:42:26 trevis-129vm3: LGSS_SK=
2023-05-03T21:43:46 SHARED_KEY=true LGSS_SK= GSS_SK=false
2023-05-03T21:43:46 SHARED_KEY=true LGSS_SK= GSS_SK=true
2023-05-03T21:43:56 LGSS_SK=

While we can see "export SHARED_KEY="true"" to start, SHARED_KEY appears to be set to false in function init_test_env(). And later on in init_gss(), it gets proper value.

Any idea why init_test_env() does not see the correct value? Could it be fixed?

Thanks,
Sebastien.



 Comments   
Comment by Sebastien Buisson [ 03/May/23 ]

Full logs of lustre-initialization-1.autotest.onyx-124vm1.log are at:
https://testing.whamcloud.com/test_logs/82e925b7-762e-4c69-a55f-c6a70b09b0cf/show_text

Comment by Charlie Olmstead [ 08/May/23 ]

Move to an LU Jira as this is not an ATM issue since it's in the Lustre code base.

init_test_env doesn't see the proper SHARED_KEY value because init_test_env doesn't load CONFIG until the end of the function.

180:init_test_env() {
450:    . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} 
Comment by Gerrit Updater [ 10/May/23 ]

"Sebastien Buisson <sbuisson@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50914
Subject: LU-16804 tests: load CONFIG at beginning of init_test_env
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: df7d39a9027633eb7e173f78373c3cc1477ca855

Comment by Gerrit Updater [ 31/May/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/50914/
Subject: LU-16804 tests: load CONFIG at beginning of init_test_env
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: fdbb2bc8495064e1d9e61f02bcfd13b1e6aec8da

Comment by Peter Jones [ 31/May/23 ]

Landed for 2.16

Comment by Gerrit Updater [ 20/Jun/23 ]

"Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51383
Subject: LU-16804 tests: rename 'complete' to 'complete_test'
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 81c4cd81c26b688b67363a8a2c9417499bd53106

Comment by Gerrit Updater [ 28/Jun/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51383/
Subject: LU-16804 tests: rename 'complete' to 'complete_test'
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 6884b8af231c2c39f60eae44ebbd32e82ca5ca91

Generated at Sat Feb 10 03:30:09 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.