VDD Check-out Scripts

Abacus Technology

Background

This paper describes the VBScripts I developed to verify the accuracy of file listings in Version Description Documents (VDDs) prior to being used by Server Admins and DBAs on Production deployment nights.


During the early years of the Information Management and Communications Support (IMCS) contract at Kennedy Space Center (KSC), the Mission Assurance QA Group was responsible for ensuring the accuracy of VDDs. One area in the VDD where accuracy was critical, was the listing of the files to be deployed to Production. During the test phase of the software development lifecycle, it was possible that the VDD file listings could get out of sync with the file versions to be deployed. If the Server Admin or DBA discovered that the file listings in the VDD didn’t match the physical files in the staging area, then the release was pulled from the deployment.

Verifying VDD content was a manually intensive and error prone process. The likelihood of not catching errors increased proportionally to the number of files in the deployment list. It was not uncommon to have hundreds of files listed. The tester had to check each file’s date/time stamp and size. In addition, the status of missing or excess files had to be verified from both the VDD to the staging area and from the staging area to the VDD—a very tedious and time consuming task.

The solution took the form of a VBScript which would perform the file comparisons and produce a report that could easily be sent to the development team for resolution.

CheckVDD.vbs

Script Design

Sub ReportFileStatus()

Subroutine which compares the file attributes in the VDD with the file attributes in the staging area and writes the results to a log file.

Sub ProcessFile()

Subroutine which parses out files from the VDD. Calls ReportFileStatus().

Sub ShowFileList(folderspec)

Subroutine which builds an array of filenames from the staging area. Called by ShowFolderList(folderspec)

Function ShowFolderList(folderspec)

A function which traverses the folders in the root directory recursively. Calls ShowFileList(folderspec).

Sub FindMissingVddFiles

Subroutine which compares an array of files from the staging area with an array of files from the VDD and writes the results to a log file.

Sub ReadThrough

Subroutine which reads the text version of the VDD and sets the position in the file at the start of the file listing.

The main script section defines and initializes all variables and constants; prompts the tester for the application’s root directory path; initializes the log file; reads through and processes the input VDD text file; and writes summary information to a log.

NOTE: If you are running Windows 7 or Vista, you may get the following error message when trying to run scripts with the .vbs extension: There is no script engine for file extension ‘.vbs’. A registry fix is required to resolve the problem. I have a script available for Download. Remember to back up your registry before running the update.

Set Up

      1. Create the following directories:
  1. Run the DIR command from a CMD window to create the input text file. The following is used as an example:

Running CheckVDD.vbs

  1. Invoke the CheckVDD.vbs script and when prompted, enter the UNC path of the root directory as shown in the example below:
    Script prompt
  2. If the tester happens to enter a path that doesn’t exist the script displays the following message:
    Script prompt
  3. The file list in the VDD is compared to the Root Directory and the results written to D:\vdd\out\results.htm

Results

The following are the results of our sample run (text in highlighted rows are displayed in RED when viewed in a Browser):

Ancillary Scripts

After completing the CheckVDD script I decided to write two follow-on scripts: CopyVDDFiles and FolderCompare. I adapted the algorithms from CheckVDD to create these two other scripts.

CopyVDDFiles prompts for the source folder because in practice, the files may not be copied from the same source folder where the DIR command was run.

The CopyVDDFiles script turned out to be an exercise and was never used to copy files to the Production staging area due to security restrictions in place at the time. Eventually, the Software Services group developed an automated deployment script framework for copying files to the test, development, and production servers.

The FolderCompare script has become obsolete since the commercial application Beyond Compare was acquired.

CopyVDDFiles.vbs

Set Up

  1. Create the following directories:
  1. Run the DIR command from a CMD window to create the input text file. The following is used as an example:

Running CopyVDDFiles.vbs

  1. Invoke the CopyVDDFiles.vbs script
  2. When prompted, enter the path of the source directory as shown in the example below:
    copyvdd_diag1
  3. When prompted, enter the path of the target directory as shown in the example below:
    copyvdd_diag2
  4. If the target folder doesn’t exist, the following prompt will be displayed:
    copyvdd_diag3
  5. Respond OK to create the target folder
  6. The files are copied and the results written to D:\vdd\out\fileCopyRes.htm

Results

The following are the results of our sample run (instances of “Copied to:” text are displayed in BOLD when viewed in a Browser):

FolderCompare.vbs

Set Up

  1. For this example, the script will compare the folders copied using the CopyVDDFiles.vbs script from the previous section. Some errors were introduced for illustration purposes.

Running FolderCompare.vbs

  1. Invoke the FolderCompare.vbs script
  2. Respond to the primary folder prompt as follows:
    fldrcomp_diag1
  3. Respond to the secondary folder prompt as follows:
    fldrcomp_diag2
  4. Respond to the results file prompt as follows:
    fldrcomp_diag3
  5. The script compares the two folder locations and writes the results to the specified log file

Results

The following are the results of our sample run (text in highlighted rows are displayed in RED when viewed in a Browser):

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *