**[A short note on running Test/Practice Mode programs (revised draft)
4/10/2005]{.underline}**

**Installing the Test and Practice Mode executables (for installer or
developer)**

In order to run the Test/Practice Mode programs properly, you need to
have all of the following scripts and executables in the /awips/fxa/bin
directories (one on lx#-\<siteid\>, Graphic workstation and another one
on xt#-\<siteid\>, Text workstation) or where your \$FXA_HOME/bin points
to:

+-----------------------------------------------------------------------+
| \(a\) MonitorTestMode_script - use to launch TestModeMonitor program  |
|                                                                       |
| \(b\) showBanner_script - use to launch showBanner program            |
+-----------------------------------------------------------------------+
| \(a\) consoleUser - validate if a user is logged in at console        |
|                                                                       |
| \(b\) getTestMode - an interface that returns the status to the       |
| calling AWIPS applications                                            |
|                                                                       |
| \(c\) MonitorTestMode -- an interface to monitor current status       |
| (mode)                                                                |
|                                                                       |
| \(d\) showBanner -- displays a small window indicating the current    |
| mode status                                                           |
|                                                                       |
| \(e\) test_WorkstationTestMode -- a C++ example for calling           |
| getTestMode interface                                                 |
|                                                                       |
| \(f\) tmb -- a server program that keeps track of the running status. |
|                                                                       |
| \(g\) tmb_exit -- a utility program to request tmb to exit            |
|                                                                       |
| \(h\) tmbRemoteCheck -- a program calls by tmcp via a remote ssh to   |
| detect specified AWIPS applications are running or not                |
|                                                                       |
| \(i\) tmcp (runs only on lx# graphic workstation) -- a main GUI to    |
| change mode status                                                    |
+-----------------------------------------------------------------------+

**Set up the running environment within the AWIPS**

Under the "/awips/fxa/data/appLauncher/appLauncher.conf" file, we plan
to have the following lines filled in the file which allows the user to
select "Test Mode Control Program" from the appLauncher menu:

START_RECORD

Name=Test Mode Control Program

Exec=/awips/fxa/bin/tmcp

Icon=\$FXA_HOME/data/caution.gif

hostType = Graphic

siteType = WFO OCONUS

END_RECORD

Note that you have to logoff and login again to see the changes in
effect if the appLaucher server program is already running. Once the
appLauncher program comes up (by pressing Button 1 on the screen for OB5
and Button 3 for OB6-\>AWIPS), you should see the "Test Mode Control
Program" is available as shown below:

![](media/image1.png){width="2.4375in" height="3.3854166666666665in"}

**Requirements to run the Test Mode Programs**

Note that the Test Mode programs work only on a typical AWIPS lx# and
xt# workstations (where \# is station number and must be the same number
for both graphic workstation and text workstation). In other words, user
must logon to both the Graphic (lx#) and Text (xt#) workstations under
the same account. Note that the main Test Mode Controller Program (TMCP)
GUI will only launch from the lx# Graphic workstation. Currently, there
are three available modes (Test/Practice/Panic) in addition to the
operational mode. User should aware that the products generated in the
Test mode shall leave the WFO while products generated in Practice mode
shall not leave the WFO. The products from both Test/Practice modes
should have specific language inserted into the header and test
indicating "TEST" (see requirement document).

If problems with the test mode programs are detected, or if the test
mode protocols are violated in any way, the workstation goes into
"panic" mode. In panic mode a banner is displayed to the user stating
that there is a problem and that he or she should immediately start up
the main GUI program and go back to operational mode. The following are
examples of situations where the workstation will be in panic mode:

(1) The user logs off one of the workstations (text or graphic) but
    remains logged on to the other.

(2) One of the two tmb processes dies.

(3) One of the two MonitorTestMode processes dies.

**Selecting the Test (Comms Live) or Practice (In House) mode**

1\. Login to both lx#, Graphic workstation and xt#, Text workstation

2\. On any of the 3 screens under the lx# graphic station, press Button
1 (left-mouse button) to launch the appLauncher as usual and from the
menu to select \"Test Mode Control Program\". The TMCP GUI should pop up
as shown below.

![](media/image2.png){width="5.59375in" height="3.40625in"}

3\. Select either the "Change Mode to Test (Comms Live)" button or
"Change Mode to Practice (In House)" button as desired. Notice that the
"You are in Operational" button is not available for selection. Check
the scrolling text window for any informative or error messages. The
mode cannot be changed if any of the following applications are still
running on either the lx# or xt# workstations:

\(1\) D-2D or WarnGen

\(2\) WWA

\(3\) RiverPro

\(4\) GFE

\(5\) TextWS

If the Test Mode Control program detects anyone of the above programs is
running, an error message will be displayed in the text message box to
remind user to exit the corresponding application. Likewise, if the user
forgot to logon to the Text workstation, the program will remind user to
logon first. Appendix-A shows all the possible messages that the users
are expected to see. Once all the pre-conditions are checked, a banner
GUI (just a label widget) will display on each of the screens (say three
on lx# and one on xt# workstations). As a convention for now, \"Black\"
color background and with "White" color foreground is used for the test
(Comms Live) mode and \"Orange\" for practice (In House) mode. \"Red\"
will be used as panic mode. The TMCP program will exit momentarily if
the Test/Practice mode is selected and provided that all the
pre-conditions are satisfied along with the SSH connection, valid user
login and X-Window displays were all set up properly.

4\. Notice that it is very important NOT to run any AWIPS applications
until all the test/practice banners show up on the screens.

5\. User can now move on to test any of the AWIPS applications like D-2D
(WarnGen), RiverPro, WWA and Gfe/GHG via the appLauncher as usual on
both lx# and xt# workstations to proceed or conduct a Test/Practice
modes testing session.

**Requesting the current mode status (for AWIPS applications
developers)**

1\. Once the Test or Practice mode is running, any user or AWIPS testing
applications can launch the getTestMode program, an interface program to
retrieve the status (or via a shell script) as following:

\> \$FXA_HOME/bin/getTestMode \--verbose

\(a\) It should return a value of 11 if under the Test mode

\(b\) It should return a value of 12 if under the Practice mode

\(c\) It should return a value of 13 for Obnoxious or Panic mode

\(d\) It should return a value of 15 for Operational mode

For any help on usage, just type:

\> \$FXA_HOME/bin/getTestMode \--help

For more options on getTestMode, see the appendix B.

**Returning back to the Operational mode**

To return from Test/Practice mode back to Operation, just launch the
appLauncher Menu again by pressing Button 1 (left-mouse button) on the
screen of the graphical workstation to select \"Test Mode Control
Program\". The TMCP GUI should pop up as shown below and you can select
"Change to Operational mode" button to exit the Test/Practice mode.

If the pre-condition list of AWIPS applications mentioned above is still
running, you should see an error message indicate in the text message
box. The following is a screen-shot example of where D-2D is still
running under the Test (Comms Alive) mode. User should quit all the
required applications before proceeding to the Operational mode on both
the Graphic and Text workstations.

![](media/image3.png){width="5.99375in" height="5.0159722222222225in"}

**Exiting the Test Mode Control Program**

To exit the Test Mode Control Program, just select the "Cancel" button.

**Anomaly conditions**

Anytime if user is logoff from one of the Graphic or Text workstation or
the Test Mode programs encounter a problem, a red banner (panic mode)
will be displayed in the remaining running workstation. An example of
screen dump is shown below. In this situation, user should run the TMCP
GUI via the appLauncher in the graphic station to set the mode back to
operational.

![](media/image4.png){width="5.99375in" height="4.996527777777778in"}

**Appendix A** - Test Mode Program messages:

Problem with display on lx#-site. Please check.

Checking display for xt#-site \...

Problem with display on xt#-site. Please check.

Please wait\... checking preconditions.

Please logon to text workstation under your user account first!

Checking remote displays

Please wait\... checking displays

Checking preconditions for xt#-site \...

Checking display for lx#-site \...

Start Test (Comms Live) Mode and this program will exit.

You are now back in operational mode.

Found missing executable or script

Warning! Unable to set mode.

Mismatch of Graphic & Text workstation numbers.

Graphic workstation=lx#-site and Text workstation=xt?-site

Found D-2D is still running on the graphic workstation lx#-site. Please
exit D-2D first.

Found D-2D is still running on the text workstation xt#-site. Please
exit D-2D first.

Found warnGenWish is still running on the graphic workstation %s. Please
exit warnGenWish first.

Found wwa is still running on the graphic workstation %s. Please exit
wwa first.

Found RiverPro is still running on the graphic workstation %s. Please
exit RiverPro first.

Found GFE is still running on the graphic workstation %s. Please exit
GFE first.

Found TextWS is still running on the graphic workstation %s. Please exit
TextWS first.

**Appendix - B**

The getTestMode program is a transient binary executable. It is invoked
by application programs to allow them to determine the mode (test,
practice or operational) of the workstation.

NAME

getTestMode

SYNOPSIS

getTestMode: \[\--returnValue=test\|practice\|operational\]
\[\--verbose\]

DESCRIPTION

getTestMode - an interface that returns the status to the calling AWIPS
applications

OPTIONS

If the \--returnValue=\<value\> option is used, then \<value\> must be
one of the strings "test","practice", or "off". In that case,
getTestMode will ignore the mode of the workstation, and will instead
return a corresponding value. Applications will invoke getTestMode this
way to determine the meaning of the exit codes.

If the \--verbose option is used, the getTestMode will provide verbose
output.