Test Access Gateway
This guide covers tips for quickly validating AGW changes.
Run all unit tests
Unit testing for AGW can be done either inside the magma-dev VM, or inside the devcontainer or bazel-base Docker containers.
To SSH into the magma-dev VM, run
[HOST] cd $MAGMA_ROOT/lte/gateway
[HOST] vagrant up magma
[HOST] vagrant ssh magma
To start the devcontainer, run
[HOST] cd $MAGMA_ROOT
[HOST] docker run -v ${MAGMA_ROOT}:/workspaces/magma/ -v ${MAGMA_ROOT}/lte/gateway/configs:/etc/magma/ -it ghcr.io/magma/magma/devcontainer:latest /bin/bash
To start the bazel-base container, run
[HOST] cd $MAGMA_ROOT
[HOST] docker run -v ${MAGMA_ROOT}:/workspaces/magma/ -v ${MAGMA_ROOT}/lte/gateway/configs:/etc/magma/ -it ghcr.io/magma/magma/bazel-base:latest /bin/bash
To run all existing unit tests, run the following command from inside the repository
bazel test //...
Test Python AGW services
To run only the Python unit tests, run the following command from inside the repository
bazel test //lte/gateway/python/... //orc8r/gateway/python/...
To run unit tests of an arbitrary service or library, run commands of the following form. E.g. for the magmad unit tests, run
bazel test //orc8r/gateway/python/magma/magmad/...
and for the unit tests of the common library, run
bazel test //orc8r/gateway/python/magma/common/...
Test C/C++ AGW services
We have several C/C++ services that live in lte/gateway/c/. We will list some of the useful commands here, but please refer to the Bazel user guide for a complete overview.
From inside the repository, run
bazel test //lte/gateway/c/session_manager/...:* # to test all targets under lte/gateway/c/session_manager
bazel test //orc8r/gateway/c/...:* //lte/gateway/c/...:* # to test all C/C++ targets