Rechercher une page de manuel

Chercher une autre page de manuel:

beakerlib-infrastructure

Langue: en

Version: 2010-05-12 (fedora - 01/12/10)

Section: 1 (Commandes utilisateur)

NAME

BeakerLib - infrastructure - mounting, backup and service helpers

DESCRIPTION

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

FUNCTIONS

Mounting

rlMount

Create mount point (if neccessary) and mount a NFS share.

     rlMount server share mountpoint
 
 
server
NFS server hostname.
share
Shared directory name.
mountpoint
Local mount point.

Returns 0 if mounting the share was successful.

rlCheckMount

Check whether a share is mounted.

     rlCheckMount server share mountpoint
 
 
server
NFS server hostname.
share
Shared directory name.
mountpoint
Local mount point.

Returns 0 when specified mount point exists and NFS share is mounted.

rlAssertMount

Assertion making sure that given NFS share is mounted.

     rlAssertMount server share mountpoint
 
 
server
NFS server hostname.
share
Shared directory name.
mountpoint
Local mount point.

Returns 0 and asserts PASS when specified mount point exists and NFS share is mounted.

Backup and Restore

rlFileBackup

Create a backup of files or directories (recursive). Can be used multiple times to add more files to backup. Backing up an already backed up file overwrites the original backup.

     rlFileBackup [--clean] file [file...]
 
 
--clean
If this option is provided (have to be first option of the command), then file/dir backuped using this command (provided in next options) will be (resursively) removed before we will restore it.
file
Files and/or directories to be backed up.

Returns 0 if the backup was successful.

Example with --clean:

     touch cleandir/aaa
     rlFileBackup --clean cleandir/
     touch cleandir/bbb
     ls cleandir/
     aaa   bbb
     rlFileRestore
     ls cleandir/
     aaa
 
 

rlFileRestore

Restore backed up files to their original location. "rlFileRestore" does not remove new files appearing after backup has been made. If you don't want to leave anything behind just remove the whole original tree before running "rlFileRestore", or see "--clean" option of "rlFileBackup".

     rlFileRestore
 
 

Returns 0 if backup dir is found and files are restored successfully.

Services

Following routines implement comfortable way how to start/stop system services with the possibility to restore them to their original state after testing.

rlServiceStart

Make sure the given "service" is running with fresh configuration. (Start it if it's stopped and restart if it is already running.) In addition, when called for the first time, the current state is saved so that the "service" can be restored to its original state when testing is finished, see "rlServiceRestore".

     rlServiceStart service [service...]
 
 
service
Name of the service(s) to start.

Returns number of services which failed to start/restart; thus zero is returned when everything is OK.

rlServiceStop

Make sure the given "service" is stopped. Stop it if it is running and do nothing when it is already stopped. In addition, when called for the first time, the current state is saved so that the "service" can be restored to its original state when testing is finished, see "rlServiceRestore".

     rlServiceStop service [service...]
 
 
service
Name of the service(s) to stop.

Returns number of services which failed to become stopped; thus zero is returned when everything is OK.

rlServiceRestore

Restore given "service" into its original state (before the first "rlServiceStart" or "rlServiceStop" was called).

     rlServiceRestore service [service...]
 
 
service
Name of the service(s) to restore to original state.

Returns number of services which failed to get back to their original state; thus zero is returned when everything is OK.

AUTHORS

*
Petr Muller <pmuller@redhat.com>
*
Jan Hutar <jhutar@redhat.com>
*
Petr Splichal <psplicha@redhat.com>
*
Ales Zelinka <azelinka@redhat.com>
Soit un cardinal A. On dit qu'il a pour "divisant" un cardinal B si la division d'A par B n'a aucun rompu, c-à-d si A vaut B plus B plus B... (n fois). Nommons "primitif" (on aurait pu choisir "primal") un cardinal A qui n'a aucun divisant plus grand qu'un.
Montrons qu'il y a toujours un primitif plus grand qu'un cardinal pris au hasard, donc qu'ils s'accroîtront jusqu'à l'infini. Tout d'abord, nous connaissons la proposition 1 (qu'on pourrait garantir sans aucun mal si on voulait) : si A a pour divisant B (pour tout B plus grand qu'un), alors A+1 n'a jamais pour divisant B. On sait aussi (proposition 2) qu'un cardinal ayant au moins un divisant, a toujours au moins un divisant primitif (car s'il a un divisant non primitif, son divisant a aussi un divisant ; or tout divisant d'un divisant d'un cardinal produira aussi un divisant du cardinal). Supposons donc (supposition 1) qu'il y ait N primitifs au total (pour un N fini), ni plus ni moins, soit p1, p2, ..., pN. On a alors un cardinal X produit par la multiplication :
X=p1 fois p2 fois ... fois pN.
On voit qu'X a pour divisant p1, p2, ...,pN. Voyons alors par quoi nous divisons Y=X+1. Suivant la proposition 1, Y n'a pour divisant ni p1, ni p2, ..., ni pN. Il n'a donc pour divisant aucun primitif (car nous supposons ici qu'il n'y a aucun primitif à part p1, p2, ..., pN). Or, suivant la proposition 2 (par contraposition), s'il n'a aucun divisant primitif, il n'a aucun divisant du tout. On voit donc qu'il y a un cardinal Y qui n'a aucun divisant, c-à-d un primitif, qui n'apparaît pas dans p1, p2, ..., pN. D'où la contradiction qu'on voulait par rapport à la supposition 1. Conclusion : on pourra toujours bâtir un primitif plus grand qu'un cardinal fourni, ad infinitum. CQFD.
-- Graner, Nicolas