All packages must pass pkgchk validation. After a package is created and before it is installed, it must be checked with the following command.
# pkgchk -d dir_name pkg_name |
Specifies the name of the directory where the package resides
Specifies the name of the package
After a package is created, it must be tested by installing it in an alternate root (/) file system location by using the -R dir_name option to pkgadd. After the package is installed, it must be checked for correctness by using pkgchk, as in this example.
# pkgadd -d . -R /a SUNWvxvm # pkgchk -R /a SUNWvxvm |
No errors should be displayed.
If a package exists at /export/SUNWvxvm, then you would issue the following command.
# pkgchk -d /export SUNWvxvm |
No errors should be displayed.
Other commands can check the package when you are creating, modifying, and deleting files. The following commands are some examples.
For example, the dircmp or fssnap commands can be used to verify that packages behave properly.
Also, the ps command can be used for testing daemon compliance by making sure daemons are not stopped or started by the package.
The truss, pkgadd -v, and pkgrm commands can test runtime package installation compliance, but might not work in all situations. In the following example, the truss command strips out all read-only, non-$TEMPDIR access and shows only non-read-only access to paths that do not lie within the specified inactive boot environment.
# TEMPDIR=/a; export TEMPDIR # truss -t open /usr/sbin/pkgadd -R ${TEMPDIR} SUNWvxvm \ 2>&1 > /dev/null | grep -v O_RDONLY | grep -v \ 'open("'${TEMPDIR} |