Skip to content

Deployment acceptance (e2e)

A deliberately small check that an installed platform works end to end on its target host. It is not a regression suite (that is Regression): three tests, one per business surface, each driving the platform through its external interface and checking the database.

Test Path exercised Passes when
test_e2e_prepaid.py DIAMETER CCR-Initial + CCR-Termination over TLS → prepaid role both answered 2001, 30 s × 0.10 EUR debited from the balance, one online charge row
test_e2e_postpaid.py home_v1 usage CSV → mediation → cdr_loader a rated offline row (60 s × 0.10 EUR, status RATED, home) appears and the file is consumed
test_e2e_crm.py CRM web sign-in → PHP + ext-grpc → JWT/TLS gRPC → crm role login lands on the dashboard and its GetStatistics call succeeds

Every row and file a test creates uses the reserved e2e MSISDN range 407999xxxxx (or a throwaway e2e_* CRM user) and is deleted in teardown, so the pack is safe to run against a live installation. The seeded admin account is never used.

Where it comes from

The suite lives in usr/share/tests/e2e/ and ships two ways:

  • inside the backend / all archives, like the regression suite;
  • as a standalone pack, pack.sh --load tests --version X.Y.Z → dist/microbss-tests-X.Y.Z-noarch.tar.gz, which unpack.sh installs under <backend-prefix>/usr/share/tests/e2e.

Either way, unpack.sh builds its virtualenv (.venv, pip install -e .). Its only dependencies are pytest and PyMySQL (with the rsa extra for MySQL's default caching_sha2_password auth), and it uses no gRPC/protobuf stubs. The host's php CLI hashes the temporary CRM user's password.

Running it

Run as the platform's operator user on the target, with the platform started (sbin/run.sh all):

cd $BSS_HOME/usr/share/tests/e2e
./run_e2e.sh --crm-url https://crm.example.com

run_e2e.sh sources the deployment's own sbin/dev_env.sh, so database credentials and paths come from the installation (etc/db.local.env, written by set_env.sh). Options:

Flag Meaning
--crm-url URL CRM base URL as served by the web server (default $MICROBSS_CRM_URL or https://localhost); TLS is verified against the system trust store
--bring-up start the platform with sbin/run.sh all first and stop it on exit — kills any running bin/server, so not for a live system
-- ARGS passed to pytest (e.g. -- -k prepaid)

If ports :10100 / :50051 are closed the run stops immediately with a pointer to run.sh, rather than timing out test by test.

Strict TLS and older certificates

The prepaid test verifies the DIAMETER TLS chain against etc/certs/ca.crt. Certificates generated before the cert-recipe fix lack the keyUsage / Authority-Key-Identifier extensions that strict X.509 verifiers (Python ≥ 3.13) require, so the client relaxes only that strictness flag (non-conformity NC-17). Regenerating the pair with the current Installation §5 recipe removes the need for it.