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

NAME

6       BeakerLib - infrastructure - mounting, backup and service helpers
7

DESCRIPTION

9       BeakerLib functions providing checking and mounting NFS shares, backing
10       up and restoring files and controlling running services.
11

FUNCTIONS

13   Mounting
14       rlMount
15
16       Create mount point (if neccessary) and mount a NFS share.
17
18           rlMount server share mountpoint
19
20       server
21           NFS server hostname.
22
23       share
24           Shared directory name.
25
26       mountpoint
27           Local mount point.
28
29       Returns 0 if mounting the share was successful.
30
31       rlCheckMount
32
33       Check whether a share is mounted.
34
35           rlCheckMount server share mountpoint
36
37       server
38           NFS server hostname.
39
40       share
41           Shared directory name.
42
43       mountpoint
44           Local mount point.
45
46       Returns 0 when specified mount point exists and NFS share is mounted.
47
48       rlAssertMount
49
50       Assertion making sure that given NFS share is mounted.
51
52           rlAssertMount server share mountpoint
53
54       server
55           NFS server hostname.
56
57       share
58           Shared directory name.
59
60       mountpoint
61           Local mount point.
62
63       Returns 0 and asserts PASS when specified mount point exists and NFS
64       share is mounted.
65
66   Backup and Restore
67       rlFileBackup
68
69       Create a backup of files or directories (recursive). Can be used
70       multiple times to add more files to backup. Backing up an already
71       backed up file overwrites the original backup.
72
73           rlFileBackup [--clean] file [file...]
74
75       --clean
76           If this option is provided (have to be first option of the
77           command), then file/dir backuped using this command (provided in
78           next options) will be (resursively) removed before we will restore
79           it.
80
81       file
82           Files and/or directories to be backed up.
83
84       Returns 0 if the backup was successful.
85
86       Example with --clean:
87
88           touch cleandir/aaa
89           rlFileBackup --clean cleandir/
90           touch cleandir/bbb
91           ls cleandir/
92           aaa   bbb
93           rlFileRestore
94           ls cleandir/
95           aaa
96
97       rlFileRestore
98
99       Restore backed up files to their original location.  "rlFileRestore"
100       does not remove new files appearing after backup has been made.  If you
101       don't want to leave anything behind just remove the whole original tree
102       before running "rlFileRestore", or see "--clean" option of
103       "rlFileBackup".
104
105           rlFileRestore
106
107       Returns 0 if backup dir is found and files are restored successfully.
108
109   Services
110       Following routines implement comfortable way how to start/stop system
111       services with the possibility to restore them to their original state
112       after testing.
113
114       rlServiceStart
115
116       Make sure the given "service" is running with fresh configuration.
117       (Start it if it's stopped and restart if it is already running.) In
118       addition, when called for the first time, the current state is saved so
119       that the "service" can be restored to its original state when testing
120       is finished, see "rlServiceRestore".
121
122           rlServiceStart service [service...]
123
124       service
125           Name of the service(s) to start.
126
127       Returns number of services which failed to start/restart; thus zero is
128       returned when everything is OK.
129
130       rlServiceStop
131
132       Make sure the given "service" is stopped. Stop it if it is running and
133       do nothing when it is already stopped. In addition, when called for the
134       first time, the current state is saved so that the "service" can be
135       restored to its original state when testing is finished, see
136       "rlServiceRestore".
137
138           rlServiceStop service [service...]
139
140       service
141           Name of the service(s) to stop.
142
143       Returns number of services which failed to become stopped; thus zero is
144       returned when everything is OK.
145
146       rlServiceRestore
147
148       Restore given "service" into its original state (before the first
149       "rlServiceStart" or "rlServiceStop" was called).
150
151           rlServiceRestore service [service...]
152
153       service
154           Name of the service(s) to restore to original state.
155
156       Returns number of services which failed to get back to their original
157       state; thus zero is returned when everything is OK.
158

AUTHORS

160       ·   Petr Muller <pmuller@redhat.com>
161
162       ·   Jan Hutar <jhutar@redhat.com>
163
164       ·   Petr Splichal <psplicha@redhat.com>
165
166       ·   Ales Zelinka <azelinka@redhat.com>
167
168
169
170perl v5.10.1                      2010-05-12              INFRASTRUCTURE.SH(1)
Impressum