1LIBRARIES.SH(1)       User Contributed Perl Documentation      LIBRARIES.SH(1)
2
3
4

NAME

6       BeakerLib - libraries - mechanism for loading shared test code from
7       libraries
8

DESCRIPTION

10       This file contains functions for bringing external code into the test
11       namespace.
12

FUNCTIONS

14       rlImport
15
16       Imports code provided by one or more libraries into the test namespace.
17       The library search mechanism is based on Beaker test hierarchy system,
18       i.e.:
19
20       /component/type/test-name/test-file
21
22       When test-file calls rlImport with 'foo/bar' parameter, the libraries
23       are searched in following locations: these are the possible path
24       prefixes
25
26           - colon-separated paths from $BEAKERLIB_LIBRARY_PATH
27           - /mnt/tests
28           - /usr/share/beakerlib-libraries
29
30       the next component of the path is one of the following:
31
32           - /foo/Library/bar
33           - /foo/bar
34           - /libs/foo/bar
35           - /*/foo/Library/bar
36           - /libs/*/foo/Library/bar
37           - /libs/*/foo/bar
38
39       the directory path is then constructed as prefix/path/lib.sh If the
40       library is still not found an upwards directory traversal is used, and
41       a check for presence of the library in the above mentioned possible
42       paths is to be performed. This means this function needs to be called
43       from the test hierarchy, not e.g. the /tmp directory.
44
45       Once library is found, it is sourced and a verifier function is called.
46       The verifier function is cunstructed by composing the library prefix
47       and LibraryLoaded. Library prefix can be defined in the library itself.
48       If the verifier passes the library is ready to use. Also variable
49       <PREFIX>LibraryDir is created and it points to the library folder.
50
51       Usage:
52
53           rlImport --all
54           rlImport LIBRARY [LIBRARY2...]
55
56       --all
57           Read $BEAKERLIB_DIR/metadata.yaml or ./Makefile, pickup the library
58           requirements and import them all.
59
60       LIBRARY
61           Must have 'component[/path]' format. Identifies the library to
62           import.
63
64       Returns 0 if the import of all libraries was successful. Returns non-
65       zero if one or more library failed to import.
66

AUTHORS

68       ·   Petr Muller <muller@redhat.com>
69
70       ·   Dalibor Pospisil <dapospis@redhat.com>
71
72
73
74perl v5.32.1                      2021-03-25                   LIBRARIES.SH(1)
Impressum