MTF toolchain installation for Linux

Prerequisites

Before installing the MTF (Modular Test Framework) toolchain on linux, ensure that your system has the following prerequisites:

  • Valid License: Make sure you have obtained a valid license for the MTF toolchain. Please refer to the Linux License request page for instructions on how to request and activate your license.

  • Docker engine: Please follow this Docker tutorial to get the Docker up and running. Make sure that your PC can download any packets from internet (e.g. ensure your proxy settings are correct).

  • Access to our Docker Registry: You need to have access to docker.technica-engineering.net.

Important to know

Here is important Docker-related information that the user should know:

Running MTF Docker Container

In this section, we are going to run an MTF container on your system

Important

  • Depending on how you have installed docker on your system, you might see a permission denied error after running the below commands. Since you are on Linux, prefix your docker commands with sudo.

  • Alternatively, you can create a docker group to get rid of this issue.

Step1:

../../../../_images/docker_mtf_installation1.png

Open a Terminal using one of these methods:

  • Keyboard Shortcut: Press CTRL + ALT + T simultaneously

  • Application Menu: Open the application menu in the Dash Bar and search for ‘Terminal’.

Step2:

../../../../_images/docker_mtf_installation2.png
Optional: Connect to the docker registry.
Anonymous pull access is allowed in our Docker registry, this step is optional.
docker login docker.technica-engineering.net
  • To log in you need to provide your username and password

Step3:

../../../../_images/docker_mtf_installation3.png
Fetch the MTF image from the docker registry and save it to your system.
docker pull docker.technica-engineering.net/mtf-pyapi:1.10.0
To determine the appropriate image version for download please create a ticket in the
In this example 1.10.0 is the MTF image version

Step4:

../../../../_images/docker_mtf_installation4.png
You can use this command to see a filtered list of images on your system that are
from technica-engineering registry.
(MTF image pull is successful)
docker images docker.technica-engineering.net/mtf-pyapi

Step5:

../../../../_images/docker_mtf_installation5.png

Now run a Docker container based on this image.

docker container run -it --name demo_mtf_tool_chain_container_1_10_0 --pid host
--privileged --net host -v /home/workspaces/:/home/workspaces/
docker.technica-engineering.net/mtf-pyapi:1.10.0
-it:
-it flag attaches us to an interactive terminal within the container.
demo_mtf_tool_chain_container_1_10_0:
This is the name of the container, and you have the flexibility to name
your container as desired.
-v /home/workspaces/:/home/workspaces/:
Mounts the local folder “/home/workspaces” and its contents to the corresponding location
within the container.
This folder is supposed to be your whole workspace (test cases, config files, etc.).
Any file modifications made on the host are reflected in the container, and vice versa.

Step6:

../../../../_images/docker_mtf_installation6.png
Now that MTF Toolchain is installed inside your container,
you can run as many commands in the container as you want. For example:
pip show mtf
cd /home/workspaces
xtr --test_bench my_testbench_name --test_series my_testserie.xml
--output_path Results --search_paths /home/workspaces
--config_file
/home/workspaces/Config/TestBenchConfig/my_testbench_name/my_testbench_config_file.yaml
--testing_project my_testing_project_name --HTML_gen True

Step7:

../../../../_images/docker_mtf_installation6.png
You can verify whether your license is valid and active through the terminal.
Ensure that the CodeMeter Runtime Service is started.
You can verify this by launching the CodeMeter Control Center.
../../../../_images/docker_mtf_installation8.png
In case CodeMeter Runtime Service is not running,
please attempt to execute this command on the host machine:
sudo service codemeter start
Open the CodeMeter Control Center again.
You should see something similar to the following screenshot:
../../../../_images/docker_mtf_installation9.png

Start Python, by entering the following command in the command prompt:

python3

Once Python is running, import the ‘mtf’ module by entering the following command:

import mtf

In case you have exited your container (closed the window, restarted the system, etc.)

Check if the docker container is still running by executing this command:

docker ps -a
../../../../_images/docker_mtf_installation10.png

If the Status of your container is Up, run this command:

docker exec -it demo_mtf_tool_chain_container_1_10_0 bash

Now you can run as many commands in the container as you want.

../../../../_images/docker_mtf_installation11.png

If the Status of your container is Exited run these commands:

docker start demo_mtf_tool_chain_container_1_10_0
docker exec -it demo_mtf_tool_chain_container_1_10_0 bash

Now you can run as many commands in the container as you want.