Tests/misc Tools
From ISP_RAS
Description
Tools from 'tests/misc' are used while generating test sets on different specification aspects. In new Bazaar repository these tools are situated in the 'misc-test' directories.
AppChk
This test performs a static analysis of an application to ensure that it only uses libraries and interfaces specified by the LSB. There are no scripts that deal with database to generate this test suite; generateg files from elfchk and rpmchk are used.
CmdChk
The cmdchk test suite is used for check if the commands specified are located on the system in an expected place. In 'cmdchk' module the following scripts deal with database:
| Script | Description |
|---|---|
| mkcmdlist | generates 'cmds.h' file with all commands. Commands are orginized as an array of structures { "<name>", "<path>" }. Two arrays are generated - with 'core' and 'desktop' commands |
| mkcmdlist2 | generates 'cmdlist' file with all commands for the Python cmdchk. 'cmdlist' is a simple text file, each line contains command name and command path |
DevChk
The devchk test suite, also known as lsb-hdrchk, is used for development environment verification. This test suite verifies binary values in specific header files. At the moment, this test is only used for internal activities and is not released as part of the certification program.
More information about DevChk can be found on its page.
In 'devchk' module the following scripts deal with database:
| Script | Description |
|---|---|
| mktests | for each header with 'Included' status generates source file <headerName>.c that verify binary values in that header - constants, types (size, members/ offsets/bitfiels, if any) and interfaces. Each .c file contains one function that perform all tests. All names of such functions are declared in 'testdefs.h' file. For each header ".inc" file can be provided containing headers that should be included in source where given header is used. Note: such tests are not generated for Qt4 headers - records from Header tables with Hid in [229...487] range are ignored. The script also generates:
|
DynChk
This test is used to measure an applications use of the LSB interfaces during its execution. This test suite is under development now. In 'dynchk' module the following scripts deal with database:
| Script | Description |
|---|---|
| libs/gen_lib.pl | generates checkers of interface usage for all 'Included' interfaces, grouped by library. Each checker is a separate .c file |
| tests/gen_tests.pl | generates 'validate_struct_*.c' files that validate each structure from Type table that are no excluded or indirect and belong to 'Included' headers |
ElfChk
The elfchk test suite is used to check sections of ELF files. In 'elfchk' module the following scripts deal with database:
| Script | Description |
|---|---|
| mkdtneededlist | used to generate 'dtneeded.c' file containing an array of strings - run-names of libraries with 'Included' status. If the library is defined not for all architectures, the appropriate string is enclosed in "ifdef <archSymbol>" macro |
| mkdyntags | used to generate 'dyntags.c' file containing declaration and initialization of array of 'DynamicInfo' structs ('DynamicInfo' is defined in 'dynamic.h' and contains information about dynamic entry - entry name and pointer to 'check' function for this entry). If dynamic entry is defined not for all architectures, the appropriate struct declaration is enclosed in "ifdef <archSymbol>" macro |
| mkmodlist | generates 'modules.h' and 'modules.c' files. 'modules.h' contains #define macros for each module from database and declaration of struct 'lsb_module' { <moduleName>, <flag> }, where <flag> can be one of the values from #define macros. In 'modules.c' an array of such structs is declared and initialized - one struct per module |
| mksectinfo | used to generate 'sectinfo.c' file containing declaration and initialization of array of 'SectionInfo' structs ('SectionInfo' is defined in 'sections.h' and contains information about elf section - name, type, attributes and pointer to 'check' function for this section). If section is defined not for all architectures, the appropriate struct declaration is enclosed in "ifdef <archSymbol>" macro |
| mksecttype | used to generate 'secttype.c' file containing declaration and initialization of array of 'SectionType' structs ('SectionType' is defined in 'sections.h' and contains information about the type of elf section - type name ant pointer to 'check' function for this type). If type is defined not for all architectures, the appropriate struct declaration is enclosed in "ifdef <archSymbol>" macro |
| mkfunclist | used to generate 'dynsyms.c' file containing declaration and initialization of array of 'versym' structs ('versym' is defined in 'elfchk.h' and contains information about Interface - name, version, deprecated flag and module name). If interface is defined not for all architectures, the appropriate struct declaration is enclosed in "ifdef <archSymbol>" macro. Information is printed only about interfaces with 'Included' status |
| mkfunclist2 | used to generate 'dynsyms.c.chk' file. This tool is similar to mkfunc list, the only difference is that mkfunclist process interfaces with 'Included' status,while mkfunclist2 processes interfaces included in LibGroups from Libraries with 'Included' status |
LibChk
The libchk test suite is used for check if the runtime libraries contain all of the interfaces with correct versions as specified by LSB specification. In 'libchk' module the following scripts deal with database:
| Script | Description |
|---|---|
| mkfunclist | generates files "<libname>.c" and "<libname>.txt" files for libraries. Each ".c" file contains information about entities from library to be checked - interfaces, classes and all around them, organized in structs from elfchk/elfchk.h. Each "*.txt" file contains a list of interfaces in library that are valid not in all architectures and interfaces whose Iid don't appear in ArchInt table. This script also generates:
|
RpmChk
The rpmchk is used to check the given rpm file structure. In 'rpmchk' module the following scripts deal with database:
| Script | Description |
|---|---|
| mktaghdr | used to create 'rpmtag.h' file containing typedef of RpmIndexTag (enum of all rpm tags) and some other necessary declarations |
| mktagtbl | used to create 'idxtbl.c' file with information necessary for rpm tags checking (different tag information and the name of the function that will check the tag) |
Usage
All scripts from tests/misc except dump_modules and mksecttype have the only '-v' option after which the LSB version should be stated. This option is mandatory. dump_modules and mksecttype don't require any arguments. Simply execute them and they'll generate necessary files.
Dependencies on DB
cmdchk/mkcmdlist
| Table | Insert | Select |
|---|---|---|
| Command | - | + |
| ModCmd | - | + |
cmdchk/mkcmdlist2
| Table | Insert | Select |
|---|---|---|
| ModCmd | - | + |
| Command | - | + |
devchk/ts/devchk/mktests
| Table | Insert | Select |
|---|---|---|
| ArchConst | - | + |
| ArchInt | - | + |
| Architecture | - | + |
| ArchType | - | + |
| Constant | - | + |
| Header | - | + |
| HeaderGroup | - | + |
| Interface | - | + |
| Parameter | - | + |
| Type | - | + |
| TypeMember | - | + |
| TypeMemberExtras | - | + |
dynchk/libs/gen_lib.pl
| Table | Insert | Select |
|---|---|---|
| ArchInt | - | + |
| Architecture | - | + |
| ArchType | - | + |
| Header | - | + |
| HeaderGroup | - | + |
| Interface | - | + |
| Library | - | + |
| Parameter | - | + |
| Type | - | + |
| TypeMember | - | + |
| TypeType | - | + |
| Version | - | + |
dynchk/tests/gen_tests.pl
| Table | Insert | Select |
|---|---|---|
| Architecture | - | + |
| ArchType | - | + |
| Header | - | + |
| HeaderGroup | - | + |
| Type | - | + |
| TypeMember | - | + |
| TypeType | - | + |
elfchk/mkdtneededlist
| Table | Insert | Select |
|---|---|---|
| Architecture | - | + |
| ArchLib | - | + |
| Library | - | + |
elfchk/mkdyntags
| Table | Insert | Select |
|---|---|---|
| ArchDE | - | + |
| Architecture | - | + |
| DynamicEntries | - | + |
elfchk/mkmodlist
| Table | Insert | Select |
|---|---|---|
| SubModule | - | + |
elfchk/mkfunclist
| Table | Insert | Select |
|---|---|---|
| ArchInt | - | + |
| Architecture | - | + |
| Interface | - | + |
| LGInt | - | + |
| LibGroup | - | + |
| Library | - | + |
| ModLib | - | + |
| SubModule | - | + |
| Version | - | + |
elfchk/mkfunclist2
| Table | Insert | Select |
|---|---|---|
| ArchInt | - | + |
| Architecture | - | + |
| Interface | - | + |
| LGInt | - | + |
| LibGroup | - | + |
| Library | - | + |
| ModLib | - | + |
| SubModule | - | + |
| Version | - | + |
elfchk/mksectinfo
| Table | Insert | Select |
|---|---|---|
| ArchES | - | + |
| Architecture | - | + |
| ElfSections | - | + |
| SectionTypes | - | + |
elfchk/mksecttype
| Table | Insert | Select |
|---|---|---|
| Architecture | - | + |
| SectionTypes | - | + |
libchk/mkfunclist
| Table | Insert | Select |
|---|---|---|
| ArchClass | - | + |
| ArchInt | - | + |
| Architecture | - | + |
| ArchLib | - | + |
| ArchType | - | + |
| BaseTypes | - | + |
| ClassInfo | - | + |
| ClassVtab | - | + |
| Interface | - | + |
| LGInt | - | + |
| LibGroup | - | + |
| Library | - | + |
| ModLib | - | + |
| SubModule | - | + |
| Version | - | + |
| VMIBaseTypes | - | + |
| Vtable | - | + |
rpmchk/mktaghdr
| Table | Insert | Select |
|---|---|---|
| RpmTag | - | + |
rpmchk/mktagtbl
| Table | Insert | Select |
|---|---|---|
| RpmTag | - | + |