Skip to content
Tristan Israël edited this page Feb 25, 2026 · 3 revisions

This page describes the quality process and the tests made for Safecor.

Unit tests

The python source code is covered with unit tests. It includes the library and part of the scripts in safecor-core.

Run the tests and verify quality

The tests can be ran in a python environment following this procedure (on Alpine Linux):

tests.sh

# Install python3 
apk add python3 py3-pip
python3 -m pip install --upgrade pip
python3 -m venv .venv

# Install dependencies
source .venv/bin/activate
cd python
python3 -m pip install -r requirements.txt
python3 -m pip install black ruff mypy coverage bandit pip-audit

# Format check            
black --check .
    
# Lint
ruff check .

# Type checking
mypy .

# Unit tests and calculate coverage
coverage run --omit="tests/*,*/tests/*" -m unittest discover -s tests -v
coverage report --fail-under=80

Functional and non-regression tests

The Tests app is designed to run all functional and non-regression tests on a fully compatible system.

Run the tests

  • Download the ISO image
  • Put it on a USB key using Rufus or dd
  • Boot on the USB key

Functional tests

This section describes the functional and non-regression tests.

Multiple partitions reading

Steps:

  • Partition an external storage with multiple partitions (for example FAT and ExFAT or ExFAT and NTFS).
  • Run the script fill-test-input-disk.sh and give the path of one of the mount points as argument. For example $ ./fill-test-input-disk.sh /media/part_fat.
  • Run the script again to fill the other partitions created.
  • Start the test appliance.
  • Run the test plan.
  • Connect the storage when asked.

Clone this wiki locally