Joe,

The only way that you can currently change/set environment variables for a 
process started via STAF is using the PROCESS service's ENV option.  Since 
you can't do that for some reason, the only other way that I can think of 
to do this is to change the environment variables that STAFProc is using. 
You could do this in one of the following ways:

- Shutdown STAFProc  on the machine where you want to change/set 
environment variables, and then change/set the environment variables, and 
restart STAFProc in this new environment, so that when you start a process 
on this machine, it will be started using this environment.

- OR -

- Start another instance of STAFProc on the machine where you want to 
change/set environment variables and start this instance after 
changing/setting the environment variables you require.
 (how to do this is talked about in section "5.1.1 Running Multiple 
Instances of STAFProc" in the STAF User's Guide at 
http://staf.sourceforge.net/current/STAFUG.htm#HDRSTPROC.) and then submit 
the PROCESS START request to this instance of STAFProc (e.g. by specifying 
the port, serv...@6502, if you configured a tcp interface with port 6502 
in this new instance of STAFProc).

Note that there is an open feature request, #1766115 "STAF never re-reads 
STAF/Env/Path", at 
http://sourceforge.net/tracker/?func=detail&aid=1766115&group_id=33142&atid=407384
 
that requests basically the same thing you want.  I suggested the same 
workarounds in this feature and the person who submitted this featuer 
request is using a workaround.  As talked about in the feature request, we 
have some concerns on providing this capability because in a shared 
environment, changing the environment variables may cause problems for 
others.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




Joseph J Veilleux/Lexington/IBM
06/02/2010 07:58 AM

To
Sharon Lucas/Austin/i...@ibmus
cc
staf-users@lists.sourceforge.net
Subject
Re: [staf-users] Question on Setting values to an Environmental Variable





Sharon, your suggestion is indeed the most straightforward one but 
unfortunately it is not available to us.

Please allow me to elaborate on our situation:

Our team is developing an outer-level automation framework which runs 
testcases that use a variety of specific automation tools (Rational 
Functional Tester for GUI tests, JUnit and various in-house-developed 
tools for lower-level tests, etc). The specific target of our test is the 
Lotus Domino server. Our tests are initiated via the Lotus Automator UI, 
which causes LA on the LA server to initiate our STAX job (our automation 
framework) via STAX on the LA server. Then, the real target-of-test is a 
specified collection of test machines (typically one Windows client 
machine with Lotus Notes installed, and several server machines which may 
be Windows, AIX, Solaris, or Linux, with Lotus Domino Server software 
installed).

The situation that my colleague is asking about is the following:

There are some testcases which execute on the client system-under-test, 
and stop and start the Domino server by forming a command and then issuing 
it via STAF. The command is issued on the local machine (i.e. the client 
system-under-test) targeting execution on one of the server 
systems-under-test.

In the context of this operation (stop/start the Domino server), for 
reasons too arcane to delve into here, we need the PATH environment 
variable on the Domino server to be set to a specific value. ...but... 
here's the kicker: we don't have control over the STAF command that's 
being issued to do this operation... the testcase itself (which we cannot 
modify) builds and issues this command. Therefore we don't have the 
flexibility to simply add the "ENV" argument to that command. Our 
challenge is to set the environment somehow into a state so that when the 
command (built and issued by the testcase) fires, the PATH will already be 
set in the manner that we require.

So, we have tried a couple of approaches, including the one my colleague 
referred to below: using the STAF VAR service to set the PATH in a 
particular way, so that later, several layers down, when the testcase 
builds and fires its command, the PATH would be set the way we want it. 
This attempt failed, for reasons that you explained in your message.

Can you suggest some other way we might approach this problem, so as to 
achieve our goal of having the PATH already set the way we need it, 
*without* modifying the testcase that actually issues the STAF command?

Thanks in advance!

---------------------------------------------------------------------------------------
Joe Veilleux
IBM/Lotus Domino Server Quality Engineering
550 King Street
Littleton MA 01460
Email: joeveill...@us.ibm.com




Sharon Lucas/Austin/i...@ibmus 
06/01/2010 11:00 AM

To
Siu Tam/Westford/i...@lotus
cc
staf-users@lists.sourceforge.net
Subject
Re: [staf-users] Question on Setting values to an Environmental Variable







When STAFProc is started, it runs with the environment variables that were 
set at that time.  You can't change the environment variables for STAFProc 
(or really for any application) after it has started.  STAF/Env/xxx 
variables like STAF/Env/Path are basically "read-only" variables that show 
you the environment variables settings for STAFProc.  You should not be 
changing the values of STAF/Env/xxx variables. 

When you use the STAF PROCESS service to run a command, it runs in the 
same environment as STAFProc.  To change or set a new environment variable 
when running a command via a PROCESS START request, you can use the ENV 
option(s) to set  environment variables.  For example: 

C:\>STAF local PROCESS START SHELL COMMAND "set" ENV 
PATH=C:\value;{STAF/Env/Path} RETURNSTDOUT STDERRTOSTDOUT WAIT 
Response 
-------- 
{ 
  Return Code: 0 
  Key        : <None> 
  Files      : [ 
    { 
      Return Code: 0 
      Data       : <Removed environment variables prior to PATH> 
Path=C:\value;
C:\jdk1.5.0_07\bin;C:\STAF\bin;C:\WINNT\system32;C:\WINNT;<Removed rest of 
PATH output> 
<Removed environment variables after PATH> 

    } 
  ] 
} 

See the STAF User's Guide for more information on the ENV option at 
http://staf.sourceforge.net/current/STAFUG.htm#HDRPROCSRV. 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313



Siu Tam/Westford/i...@lotus 
06/01/2010 08:34 AM 


To
staf-users@lists.sourceforge.net 
cc

Subject
[staf-users] Question on Setting values to an Environmental Variable








I am trying to set a value to an environment variable so that the 
processes
proceeding directly after will be able to use the values. 

I am using the VAR service command staf <IP Address> var set var 
STAF/Env/Path="c:\value".

The variable appears to be set properly since when the command staf <IP 
Address> var list is used the newly set values do show up. 
However, a command that is passed in directly after does not recognize the 
new path variable.

Is this the proper command to use, or is there another way to do this?

Thanks
-Larry
------------------------------------------------------------------------------

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users


------------------------------------------------------------------------------

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to