tcms_api package

This module provides a dictionary based Python interface for the Kiwi TCMS test management system. It operates via the XML-RPC protocol.

Installation:

pip install tcms-api

If you want to use Kerberos then:

pip install tcms-api[gssapi]

WARNING: on Windows you need to install MIT Kerberos and make sure C:\Program Files\MIT\Kerberos\bin is included in %PATH% - this is usually the case when you install and restart! It must be a 64bit installation, see MIT Kerberos for Windows 4.1

WARNING: on Linux you will need gcc, Python and kerberos devel packages to build gssapi because it doesn’t provide binary packages via PyPI. Try dnf install gcc krb5-devel python3-devel (Red Hat/Fedora) or apt-get install gcc libkrb5-dev libpython3-dev (Debian/Ubuntu).

Minimal config file ~/.tcms.conf:

[tcms]
url = https://tcms.server/xml-rpc/
username = your-username
password = your-password

For Kerberos specify the use_kerberos = True key without username and password! Also make sure that your /etc/krb5.conf contains:

[libdefaults]
default_realm = .EXAMPLE.COM

where EXAMPLE.COM matches the realm in your organization.

Important

The filename ~/.tcms.conf is expanded to something like /home/tcms-bot/.tcms.conf on Linux and C:\Users\tcms-bot\.tcms.conf on Windows, where tcms-bot is the username on the local computer.

It’s also possible to provide system-wide config in /etc/tcms.conf on Linux and C:\tcms.conf on Windows!

Execute the following Python snippet to find the exact location on your system:

import os
print(os.path.expanduser('~/.tcms.conf'))

Connect to backend:

from tcms_api import TCMS

rpc_client = TCMS()

for test_case in rpc_client.exec.TestCase.filter({'pk': 46490}):
    print(test_case)

Important

For a list of available RPC methods see https://kiwitcms.readthedocs.io/en/latest/modules/tcms.rpc.api.html

Example(s) and API scripts contributed by the Kiwi TCMS community can be found at https://github.com/kiwitcms/api-scripts. You are welcome to open a pull request with your own examples!

class tcms_api.TCMS[source]

Bases: object

Takes care of initiating the connection to the TCMS server and parses user configuration using a utilities class!

property exec

Property that returns the underlying XML-RPC connection on which you can call various server-side functions.

Submodules