events
news
The Linux Foundation
 
 
Using the Application Testkit

From The Linux Foundation

Contents

[edit] Installing

There are three ways to get the LSB Application Test Kit installed: via a bundle, via repositories, or via packages.

[edit] Bundle Installation

Bundles are compressed tar archives containing everything you need to do something interesting. The bundles for testing applications are here; choose the version to which you're interested in certifying.

Application test kit bundles contain binaries and manual pages; these can be used in-place by adding the "bin" directory in the unpacked tree to the PATH environment variable and the "man" directory to the MANPATH environment variable. The binaries and man pages can also be copied to system paths (such as /usr/local/bin and /usr/local/man for the binaries and man pages, respectively).

[edit] Repository Installation

The LSB provides repositories suitable for use with the yum and apt software managers on RPM-based systems and Debian, respectively.

For yum, you can download repository configuration files from our FTP server. Start here, and choose the appropriate LSB version, and the "yum" subdirectory under that. Download the appropriate file for your architecture, copy it to your repos.d directory, and run "yum update".

For apt, use the following sources.list line:

deb http://ftp.freestandards.org/pub/lsb/repositories/released-lsb-version/debian lsb main

(Substitute the appropriate LSB version for lsb-version.)

Once the package manager recognizes our repository, you can install the package lsb-task-app-testkit. This will install all the appropriate packages for the Application Test Kit.

[edit] Package Installation

RPM packages are available [/download/#application here]. The two tests required by the LSB are the "lsbappchk" and "lsbpkgchk" packages.

Download those packages, and install them. On RPM-based systems, "rpm -i rpm-file" should suffice. On Debian-based systems, install the "alien" tool from your system's apt repository, and then install the packages with "alien -ick rpm-file".

Once this is done, the tests themselves are in /opt/lsb/bin and /opt/lsb/man. Add those paths to your PATH and MANPATH environment variables.

[edit] Running

There are two phases to testing compliance with the LSB: application testing, and package testing.

[edit] Application Testing

Each individual compiled program must be checked for LSB compliance. Identify those programs, and any dynamic libraries you ship with your application that these program need.

The "lsbappchk" command checks compiled programs. You can just run it on the program, like this: "lsbappchk binary-file". If you need to give it a list of dynamic libraries you ship, you can add them one by one with "-L library-file". Or, if the library files are kept in a particular directory, you can add all the libraries in a directory with "-D library-dir". To add more than one library, or more than one directory, pass multiple -L and/or -D options.

Running lsbappchk this way prints a report to the terminal window. (You can save the report to a file with -o output-file.) This report will contain short explanations of any problems found in the program, along with URLs to pages on the Linux Foundation web site which give more information about the problem.

Once you have fixed the problems lsbappchk has found, or if you need more help with some problems and want to share your results, you can add the "-j" argument to lsbappchk to generate an official journal instead of a report. This file can be submitted to the Linux Foundation as part of your application for certification, and LF engineers can also use the journal to assist with problems.

[edit] Package Testing

All LSB-compliant applications must be installable using only the facilities provided in the LSB. For example, you can use a custom installation program, as long as that program is itself LSB-compliant, or you can distribute the application in a standard compressed tar archive.

The LSB includes a package format, which is basically a subset of RPM, which can be used to install your application. If you elect to distribute your application as a RPM, you need to certify your package as LSB-compliant. This is done with the "lsbpkgchk" command.

To check your package, run lsbpkgchk on it, like this: lsbpkgchk rpm-file. This will create a journal file. Look in that journal file for failures (marked "FAIL" in the journal), along with explanations for them. The "tjreport" tool (contained in the LSB distribution testkit, or in the package "lsb-tet3-lite" included on the [/download/ download page]) can reformat journals into a more readable format, and tell you what problems your package contains.


[Article] [Discussion] [Edit] [History]