Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Environment variable in test script command line

On our design, we use test script with command line option.

The command line is supposed to have an environment variable inside it.
For example: %LOCATION%\script.sh.
Meaning, the location of the script depends on the value of the environment variable.
I couldn't find a way to execute this command line with environment variable. Tried %VAR%, $VAR and etc.
Is there a way to do that? 

0 votes

Comments

I'm a bit confused with what you want to achieve. If you want to execute %LOCATION%\script.sh, shouldn't you just pass a value (path) to the environment variable LOCATION? Also, how do you execute your test script?

 The value of LOCATION can be changed, actually it is different between our machines. So I can't know in advanced what will be the value.
We will trigger the test suite via an automatically tool (Jenkins) but I think it doesn't matter.

 

I'm confused. You'd better explain your use case in more details. For example, from which machine do you trigger the test script? On which machine does your test script run? What environment variables does your test script receive (you can simply dump all the variables and check)?

OK. I will try.

The CLA is installed on one of my machines. the test application is located on that machine as well.
the test suite has an environment variable called WORKSPACE.
The location of the workspace is different between the machines (workspace is where the test artifacts are, scripts and executables)
so one of the environment variables of the test suite is the location of the workspace
the location of the script that I'd like to call to in the Test Script command line depands on the value of the WORKSPACE location. 
For example: the script is located in WORKSPACE\scripts\script.sh. when WORKSPACE can be C:\temp, C:\folder and etc.
I don't have another way to call this script since I don't know before run time where the workspace is.
In general, we are integrating Jenkins with RQM. JEnkins will send REST API request that will trigger the test suite and will fill the WORKSPACE value before test suite execution.
I hope that now it is clear. Thanks a lot for your response




One answer

Permanent link

 My suggestion is to print all the execution variables in a loop and check if the required variable is getting listed or not

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,027

Question asked: Feb 12 '17, 11:35 a.m.

Question was seen: 2,455 times

Last updated: Dec 01 '17, 9:49 a.m.

Confirmation Cancel Confirm