This package contains some functions, which are likely to be shared between modules.
When decide to put a function here?:
- When it’s enough universal to be used with multiple modules
- It can’t be parameter for py.test
Variables: | audrey_service_path – Where are all Audrey services from XML located |
---|
Finds potentially dangerous func-calls in desired file
Parameters: | filename (str) – File to check |
---|---|
Returns: | list of the potentially dangerous func-calls |
Return type: | str |
This function returns state of task with given UUID. Useful when polling certain task if finished or not.
Parameters: |
|
---|---|
Returns: | Reported task state |
Return type: | str |
This function installs package into guest system via Katello request. Basically, it tells Katello “Hey, Katello, install these packages into machine with that UUID”
Parameters: |
|
---|---|
Raises : | pytest.Failed |
This function adds a system to a specified system group
Parameters: |
|
---|---|
Raises : | pytest.Failed |
This function creates a system group via a katello API request.
Parameters: |
|
---|---|
Raises : | pytest.Failed |
Downloads file from desired URL. Can be specified as bulletproof, if downloading from Gitweb-site
Parameters: |
|
---|
This function lists opened files of certain process specified by PID
Parameters: | pid (int) – PID of the process |
---|
Contains messages reported by RPM tests for each problem
This function checks for errors in text and returns text unchanged
Parameters: | text (str) – text to be checked |
---|---|
Returns: | text |
Return type: | str |
Performs a ‘rpm -e’ command
Parameters: | package (str) – Package to be removed |
---|
This function imports all keys in directory ‘/etc/pki/rpm-gpg’ by default
Returns build host of the package.
Parameters: | package (str) – Package to check |
---|---|
Returns: | Build host of the package |
Return type: | str |
Returns whether is package installed or not
Parameters: | package (str) – Package name |
---|---|
Returns: | True when package is installed, otherwise False |
Return type: | bool |
This functions returns reported problems with package
Parameters: | package (str) – Package to check |
---|---|
Returns: | STDOUT of rpm -V |
Return type: | str |
Performs a ‘rpm -q’ command with optional –qf parameter
Parameters: |
|
---|---|
Returns: | Package informations |
Return type: | str |
Performs a ‘rpm -qa’ command with optional –qf parameter
Parameters: | qf (str) – --qf parameter value |
---|---|
Returns: | Package informations |
Return type: | str |
Performs a ‘rpm -ql’ command
Parameters: | package (str) – Package to be listed |
---|
Returns lines with signature informations of package
Parameters: | package_lines (list[str]) – rpm –verify output for the package |
---|---|
Returns: | List of lines speaking about signatures |
Return type: | list(str) |
Verifies package in RPM database.
Checks output of the rpm -Vvv and looks for files, which have some problems (see http://www.rpm.org/max-rpm/s1-rpm-verify-output.html) When using RHEL5, $? is ignored.
Parameters: | package (str) – Package to check |
---|---|
Returns: | Bool whether verification succeeded |
Return type: | bool |
Bases: object
New class for running shell commands. To run a command, use the Run.command(...) class method. Result contains stdout, stderr, rc and run command: self.stdout, self.stderr, self.rc, self.command. Result is usable in if, if the $?=0, if evaluates as True.
Run.bash() runs bash script provides as a parameter.
Uses Run.command(...) to open bash shell and feed it with script from string script_body.
Returns: | Run() instance with resulting data |
---|
Runs specified command.
The command can be fed with data on stdin with parameter stdin. The command can also be treated as a shell command with parameter shell. Please refer to subprocess.Popen on how does this stuff work
Returns: | Run() instance with resulting data |
---|
DEPRECATED, PLEASE DO NOT USE IN THE NEW CODE!!!!!
Function used for calling shell commands rather than invoking programs.
Parameters: | command (str) – Command to be launched |
---|---|
Returns: | tuple of STDOUT and RC of the command |
Raises : | AssertionError |
DEPRECATED, PLEASE DO NOT USE IN THE NEW CODE!!!!!
Function used for calling shell commands rather than invoking programs. It also returns stderr output, so it’s basically the same as the preceeding function, just return tuple extended
Parameters: | command (str) – Command to be launched |
---|---|
Returns: | tuple of STDOUT and RC of the command |
Raises : | AssertionError |
This function looks whether a file exists in system PATH or actual directory.
Parameters: |
|
---|---|
Returns: | File existence True or False |
Return type: | bool |
DEPRECATED, PLEASE DO NOT USE IN THE NEW CODE!!!!!
This function runs desired command and checks whether it has failed or not
Parameters: |
|
---|---|
Returns: | STDOUT of called process |
Return type: | str, int |
Raises : | AssertionError |
This function appends one file to another. It’s possible to strip the content from blank characters at beginning and end + separate the contents by
Parameters: |
|
---|---|
Returns: | None |
Return type: | None |
Using the ‘yum check-update <package>’ command, determines whether an update is available for the provided package.
Parameters: | package_name (str) – Name of the package to be checked for update (eg. katello-all) |
---|---|
Raises : | AssertionError |
Does the ‘yum groupinstall <package>’ command.
Parameters: | package_name (str) – Name of the group to install (eg. katello-all) |
---|---|
Raises : | AssertionError |
Does the ‘yum install <package>’ command.
Parameters: | package_name (str) – Name of the package to install (eg. katello-all) |
---|---|
Raises : | AssertionError |
Does the ‘yum remove <package>’ command.
Parameters: | package_name (str) – Name of the package to be removed (eg. katello-all) |
---|---|
Raises : | AssertionError |
Does the ‘yum search <package>’ command.
Parameters: | package_name (str) – Name of the package to install (eg. katello-all) |
---|---|
Raises : | AssertionError |
Enables or disables all sections in Yum config files
Parameters: |
|
---|