Printer FriendlyEmail Article Link

Spirent TestCenter: How to pass the 'username' environment variable from user.config to STC

Environment/Versions
 
  • Spirent TestCenter
  • user.config
  • Chassis IP list
  • Windows Server
A Windows Server 2022 has been implemented for multiple users to use Spirent Test Center under Remote Desktop Services, the Users' account profiles are set to 'Mandatory' (official Windows feature) meaning users preferences will be discarded after logging out. Additionally, Windows considers profiles 'Temporary', thus the account name of the account changes every session Sometimes labeled as 'TEMP', sometimes it appears as 'TEMP.RDS.1'

That being said, the user logs into essentially a new profile every time, so the Chassis IP list (Under GUI - Reservation Port window/section) clears out and the users need to re-enter the chassis' IP every time.

To try to tackle that down and  trying to have the chassis IPs pre-populated in STC before the user logs in the following has been attempted:

On Windows, Under C:\Users\\AppData\Local\Spirent_Communications\C:\Users\gtac\AppData\Local\Spirent_Communications\TestCenter.exe_\5.37.0.0\ there is a file 'user.config'

In user.config, Trying to insert a windows environment variable in the following:


C:\Users\johnsmith\Documents

to look like this:


C:\Users\%username%\Documents

In other words, trying to use the Windows Environment Variable %username% so that the BaseUserDataPath path is set properly and to stage the file C:\Users\johnsmith\AppData\Local\Spirent_Communications\TestCenter.exe_\5.37.0.0\user.config such as the Chassis IPs were always 'preinstalled' for the users. Since the temporary profile acts as a 'moving target', this was an attempt to specify the exact user data path before STC generates it.

However, when I launch STC using this, it throws an exception asking for the correct path, so it appears %username% has a problem getting passed from the config XML to the Windows dialog. Also, the exception dialog does not like when I manually enter %username% in the path, however, when I enter this into Windows Explorer or CMD, it works.
 
Answer
 
  • As up to 5.37 release this is not possible, env variable %username% has some problems getting passed, the workaround will be to simply have the user populate the chassis IPs on their own every time.

Product : Windows GUI,Spirent TestCenter