Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

chkclasses(N)

NAME

chkclasses − test class action scripts. 

SYNOPSIS

chkclasses −bbasedir −ccmpdir −ppkgdir [ −aarch ] [ -C|-E class[,class...] ] [ −rmxkvlq ]

DESCRIPTION

chkclasses automatically tests class action scripts used for upgrading  releases.  For testing, chkclasses uses two directory trees derived from build proto areas.  The  basedir, or destination, is a previous release and the cmpdir, or source, is the release currently under development.  chkclasses creates a copy of the destination file for a class action scripts to work on.  After each script is executed, the modified destination file is compared with the source file and any functional differences are reported as an error. 

There is no requirement that the upgraded file exactly match the release file.  Thus, some scripts may add functionality to the end of the user’s file instead of installing it in same place as the release file.  chkclasses attempts to recognize files which do not exactly match but are functionally equivalent. 

chkclasses tests only a single architecture at a time.  The architecture may be specified with the -a option.  If no arch is given, it will try to be determined by looking in the compare tree. 

The base and compare trees are assumed to be in the structure of a build proto area.  It is not required that either tree be fully populated but they are expected to contain the files listed in the editable classes.  Most likely the compare tree will be a build of the release currently being developed.  It is not practical or necessary for the base tree to be a full build.  The script mkclassproto can be used to create a directory structure from a build area which only contains the files found in the editable classes.  The −l option may be used to generate a list of files in the editable classes. 

The list of classes and files in those classes is built from a package definition directory tree.  The tree is recursively searched for directories which define packages.  A package definition is assumed to be a directory with contains a pkginfo and prototype files.  The pkginfo may be named anything as long as it starts with pkginfo.  The top prototype file must be named either prototype or prototype_<arch>.  The "!include" syntax of the prototype file is understood so that prototype files may be nested.  The path1=path2 syntax of the prototype is supported where path1 indicates the installed pathname (destination) and path2 indicates where the file resides on the machine which contains the actual data (source).  In such cases, the source path (path2) is used.  Common classes such as none and renamenew which do not merge user changes are excluded from testing.  Additional classes may be excluded using the -E option. 

Class action scripts are tested for re-entrance.  If the generated file compares correctly, the script will be run again with this file as the destination and the resulting file compared with the compare file to ensure it is not modified a second time.  Re-entrant testing may be disabled with the -r option. 

Class action scripts are required to preserve any users’ changes.  If a file exists in the base area under the same pathname and ends in a .mod, this is assumed to be a modified version representing a file with changes a user might make.  It will be compared against the normal base file and the differences recorded.  The class action script will then be run with this file as the destination and the resulting file compared to the compare file.  Any discrepancies between the two diffs will be considered an error.  Modification testing may be disabled by the -m option.  The .mod file will also be tested for re-entrance unless the -r option is given.  Missing .mod files will be reported as a warning unless the -q option is specified. 

When a test fails, the class, package, and pathname along with the output of diff, are written to stdout.  The -x option may be used t get context diffs. 

OPTIONS

−bbasedir Root directory of the base proto tree. 

−ccmpdir Root directory of the compare proto tree. 

−ppkgdir Root directory of the package definition tree. 

−aarch Specify the architecture.  Different platforms of the same architecture are translated to the base architecture.  Thus sun4, sun4c, sun4m, etc. are translated to sparc. 

−Cclass A comma separated list of classes to test. 

−Eclass A comma separated list of classes to exclude from testing. 

−r Disable re-entrant testing. 

−m Disable modification (preservation of user’s changes) testing. 

−x Display context diffs. 

−k Keep copies of files which failed a test.  Files are saved in the directory /tmp/class.keep.<user>. 

−v Verbose; list each class/file as it is tested. 

−l Generate a list files found in the editable classes.  If the verbose option (-v) is specified, class and package names are included in the listing. 

−q Turns on quiet mode and suppresses the printing of warning messages. 

SEE ALSO

mkclassproto(N), chkclassproto(N), syncprotos(N)

CAVEATS

The comma separated list of classes for the -C and -E options must be passed as a single argument.  Therefore, there can be no spaces between the commas or the entire list needs to be quoted. 

The algorithm for recognizing functional differences is simplistic.  All the adds/deletes of one file much exactly match the adds/deletes of the other file.  This can cause erroneous errors to reported such as a blank line being added to a comment. 

In the ON consolidation, several of the files contained within the editable classes are installed in the proto build area with restricted read permissions.  It may be necessary to run chkclasses as root to test all of the files. 

The list of supported architectures is hard-coded and currently only sparc and i386 are supported. 

SunOS WorkShop_4.2  —  Last change: 07 Mar 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026