mosadm run-smoke-tests
Description
mosadm run-smoke-tests
runs smoke tests on MATLAB®
Online Server™.
Smoke tests reveal simple failures severe enough to impact operations. The smoke test tool that comes with MATLAB Online Server runs a set of tests against a MATLAB Online Server implementation. The tool returns information on installation setup, Kubernetes® elements, and the MATLAB Online Server microservices. The information provided by these smoke tests can help focus troubleshooting strategies for MATLAB Online Server.
Note
To run smoke tests, verify that your system meets the prerequisites specified in Smoke Test Prerequisites
For details on interpreting the results, see Address Smoke Test Failures
mosadm run-smoke-tests
runs smoke tests using the specified configuration options.option1 ... optionN
Note
mosadm run-smoke-tests
interacts with Docker®. If you do not have sudo
administration privileges for
Docker, then this command also requires sudo
.
Examples
Run Default Smoke Tests
sudo ./mosadm run-smoke-tests
YYYY/MM/DD hh:mm:ss Smoke-Tests--------------------------------------------------------------------- YYYY/MM/DD hh:mm:ss Commands--------------------------------------------------------------------- YYYY/MM/DD hh:mm:ss docker : PASS YYYY/MM/DD hh:mm:ss kubectl : PASS YYYY/MM/DD hh:mm:ss helm : PASS YYYY/MM/DD hh:mm:ss Commands : PASS YYYY/MM/DD hh:mm:ss ----------------------------------------------------------------------------- YYYY/MM/DD hh:mm:ss Properties------------------------------------------------------------------- YYYY/MM/DD hh:mm:ss DomainBaseLookup : PASS YYYY/MM/DD hh:mm:ss DomainBaseSecurelyReachable : PASS YYYY/MM/DD hh:mm:ss Properties : PASS ...
Run Smoke Tests with Verbose Output
sudo ./mosadm run-smoke-tests --verbose
YYYY/MM/DD hh:mm:ss Smoke-Tests--------------------------------------------------------------------- YYYY/MM/DD hh:mm:ss Commands--------------------------------------------------------------------- YYYY/MM/DD hh:mm:ss docker-------------------------------------------------------------------- YYYY/MM/DD hh:mm:ss docker version : Client: Version: 20.10.12 API version: 1.41 Go version: go1.17.3 Git commit: 20.10.12-0ubuntu4 Built: Mon Mar 7 17:10:06 YYYY OS/Arch: linux/amd64 Context: default Experimental: true ...
Input Arguments
option1 ... optionN
— One or more configuration options
strings
One or more configuration options, specified as strings corresponding to valid configuration options from these tables.
Specific to mosadm run-smoke-tests
Option | Description |
---|---|
--container-log-tail-lines
| Number of lines from the end of the container log to display. Default:
|
--deployment-image-registry | Image registry to use for the deployment. Example: |
--deployment-image-repository | Image repository to use for the deployment images. Example:
|
--domain-base
| Domain where MATLAB
Online Server is running. By default,
|
--image-flavor | Container image flavor, specified as Default: |
--license-port
| Port number used to connect to MathWorks® License Manager. Specify
Default: |
--no-certificate-check | If the certificate deployed at MATLAB Online Server does not match its domain, many tests fail. Specify this argument to ignore this certificate mismatching. |
--no-secure-http | If no certificate is deployed at MATLAB
Online Server, run tests that require HTTP calls using only nonsecure HTTP.
Use this option to check whether MATLAB
Online Server is deployed properly before deploying the appropriate
certificate. If you specify this option, then |
--no-terminal-colors | Skip printing output using the default terminal colors to aid accessibility. |
--skip-tests | Names of tests to be skipped. |
--time-out
| Number of seconds to wait to start running tests before canceling the operation. Default:
|
Common to All mosadm
Commands
Option | Description |
---|---|
| Name of the MATLAB
Online Server
Specify
Example:
Default:
|
| Name of the MATLAB
Online Server
Specify
Example:
Default:
|
| Print out the commands that would have run without this option specified but do not run the operation. Specify this option to test that the operation produces the expected results before actually executing it. |
| Output help for mosadm run-smoke-tests to
the command line. |
| Path to the Kubernetes cluster configuration file. Specify
Example:
By
default,
|
| MATLAB
Online Server root folder, specified as an
absolute path or a path relative to the current
folder, that is, the folder in which you can run
Default: |
| Name of the MATLAB
Online Server
Specify
Example:
Default:
|
| Print only the most useful or relevant output
from the |
--skip-log-file | Skip creating the
|
--skip-prompt, -y | Force acceptance of the terms of use for the
|
--tmp-dir
| Name of MATLAB Online Server temporary folder to use. Specify
By default,
|
--verbose | Output extra details about the
|
More About
Smoke Test Prerequisites
Set and export your test username and password environment variables
MOS_TEST_USERNAME
andMOS_TEST_PASSWORD
. Their default values are admin and password, respectively. The username and password should be valid credentials for signing in to your MATLAB Online Server session via the browser.If you have installed MATLAB Online Server using the
mosadm
command,mosadm
applies the correctKube-Config
and properly sets the environment variableKUBECONFIG
.
Set and export your test username and password environment variables
MOS_TEST_USERNAME
andMOS_TEST_PASSWORD
. Their default values are admin and password, respectively.Make sure that you can access your Kubernetes cluster via
kubectl
.Your
~/.kube/config
should point to your cluster and namespaceKube-Config
file, or yourKUBECONFIG
environment variable should be set to the right path of yourKube-Config
file.KUBECONFIG
has priority over~/.kube/config
.
Address Smoke Test Failures
Before proceeding with troubleshooting failures shown by the smoke tests, make sure that the prerequisites stated in the MATLAB Online Server Administrator Guide are satisfied.
Examine the results of the smoke tests and determine if all tests passed or if there are failures that you must investigate.
If you get a PASS result on all smoke tests, then you have properly deployed MATLAB Online Server, and you are ready to access it from your browser.
If you get a FAIL for one or more sub smoke tests, then you must find the root cause of their failures before proceeding further.
The smoke tests are divided into several parts, where each part has a subset of tests that target a specific part of configuration or behavior of your local setup, Kubernetes configuration, or MATLAB Online Server setup.
If you get a FAIL on any sub smoke test, rerun the smoke tests with the argument –verbose. This argument gives you more details on the failures.
The commands tests check if the commands docker
,
kubectl
, and helm
run properly from the machine on
which you are running the mosadm
command. If the
–verbose
option is enabled, you get more details on their
versions.
If any of the subtests fails, you can manually check if the related command
(docker
, kubect,l
or helm
) is
installed on your machine and properly working.
The properties checks focus on tests related to your MATLAB
Online Server
domain
.
DomainBaseLookup
checks if your domain is reachable securely via HTTPS.DomainBaseSecurelyReachable
checks if your domain is resolvable to an IP address.DomainBaseValidateCertificate
checks if your domain SSL certificate matches your domain name.
While the MATLAB Online Server installation instructions specify that you have a valid SSL certificate that matches your MATLAB Online Server domain name, you may not have it initially ready. However, you can still run the smoke tests.
If you don’t have a valid SSL certificate or you have one but it does not match your
domain (for example, you may have a self-signed certificate), you can have the smoke test
bypass the certificate requirement by passing the no-secure-http
and
no-certificate-check
arguments to the smoke tests
option:
mosadm run-smoke-tests --no-secure-http --no-certificate-check
The Docker tests check properties related your local Docker environment. The test checks for the Docker Root Directory disk space (refer to Hardware Requirements for details on disk space requirements).
If the available disk space under this directory disk partition is low, then that might be a root cause for some deployment failures. Consider increasing this disk space, or re-install or re-configure Docker to use a Root Directory under a partition with more disk space.
The Kubernetes tests run a set of tests related to your Kubernetes cluster.
GetKubernetesClient
checks if the test can communicate with your Kubernetes cluster. If this test fails, then make sure that yourKUBECONFIG
environment variable (or~/.kube/config
file) is set properly and you can access it successfully from your installation machine using thekubectl
command.CheckKubernetesNamespace
verifies that your configured namespace, which defaults tomathworks
, exists under your Kubernetes cluster. If the configured namespace is not present under your Kubernetes cluster, then your MATLAB Online Server is not deployed properly or is deployed under the wrong namespace.GetPodsList
displays all pods under your configured namespace. This test is mainly informative. It displays all existing pods under your Kubernetes namespace.MOS-Core-ServicesPodsAreReady
lists only the MATLAB Online Server core service pods. If a pod is running properly, the test shows the status READY next to the service. Otherwise, the test shows which underlying container is failing, along with any error messages that apply.
MATLAB Online Server runs targeted tests against each MATLAB Online™ core service.
AuthNZ
checks if the authentication (authnz
) service can authenticate users via their usernames and passwords. Under Smoke Test Prerequisites, you set two environment variables:MOS_TEST_USERNAME
andMOS_TEST_PASSWORD
. These variables store the valid username and password, respectively, for accessing your MATLAB Online Server from the browser. These variables default to admin and password.If this
AuthNZ
test fails, even if those environment variables are set properly, then check if theLicense
test is failing. If this is the case, first fix theLicense
service and then re-run the smoke tests. If the License test passes and theAuthNZ
test is still failing, then check theAuthNZ
service logs for further troubleshooting.CoreUI
,Gateway
,MATLABPoolUI
andResource
run a set of internal MATLAB Online Server tests. LikeAuthNZ
, if any of these services tests fails, first check if theLicense
service is passing its test before troubleshooting any of them.License
checks if the MATLAB Online Server License service is responding to requests. If this test shows the status PASS but other MATLAB Online Server services are still failing their tests, check if your network license manager server is accessible, through its ports, from your Kubernetes pods. To check if a server is accessible via specific port, you can use thenetcat
(nc
) command.
Also check if your license file (license.dat
) contains your
MATLAB licenses as well as your MATLAB
Online Server license.
Help
tests if the Help content is accessible by MATLAB Online Server users. Even if these tests are failing, it does affect the remaining MATLAB Online Server services.
If you get many MATLAB Online Server services smoke tests failing, start by troubleshooting the License service and then proceed further with the remaining services.
As a best practice, after fixing each single failed sub smoke test, re-run all smoke tests. Some services depend on others, and fixing one of them, like the License service, can in many cases fix other failures.
If you continue to see errors in some sub smoke tests of some MATLAB Online Server services, check their logs (see Configure Log Shipping), as these files often provide useful information on the root causes of such failures.
If you are still experiencing failures after applying the troubleshooting suggestions, perform the following:
Save the logs folder, generated by the smoke tests, as a zip file.
Run the command
sudo ./mosadm gather-system-info
. This command generates the fileinstall.log
.Contact MathWorks Support.
Version History
Introduced in R2020a
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)