Testing with Istio

When you have applications hosted in a Kubernetes cluster that have Istio as a service-mesh, you can virtualize the services in the cluster by creating stubs in HCL OneTest API.


Istio is an open-source service mesh that layers transparently onto existing distributed applications. Istio lets you connect, secure, control, and observe services deployed on cloud platforms.

Before you begin

You must have completed the setting up of the Istio control plane on Kubernetes in your IT infrastructure. For more information, refer to the Istio Documentation.

About testing with Istio

For testing with Istio, set up a Kubernetes with Istio cluster, and then you can create and publish stubs from HCL OneTest API so that stubs can be run within Kubernetes. The stubs published can be co-located with existing services running within the Kubernetes cluster.

You can create stubs for the following types of requests received or sent by the Istio service mesh:
  • Requests received by services in the Istio service mesh.
  • Requests sent from namespaces in the Istio service mesh to external services that are not in the Istio service mesh.

Tasks for testing with Istio

You can find information about the tasks that you can perform in HCL OneTest API for testing with Istio after you have set up Istio in a Kubernetes cluster:
Table 1. Tasks for creating stubs for an Istio service
Task More information


You must create a logical HTTP connection in the Architectural School perspective for the HTTP transport.

Creating logical HTTP connections


You must create an HTTP transport for the HTTP logical connection.

In the Web Server dialog box, configure the following details in the Settings tab:
  • Configure the name of the service in the Kubernetes cluster that you want to virtualize, in the Host field.
    Note: If you intend to run the Istio stubs on HCL OneTest Server, you must enter the fully qualified domain name in the Host field. For example, if the application or microservice called reviews runs in the namespace test-system within the service svc in the cluster cluster.local, then the <fully_qualified_host_name> is reviews.test-system.svc.cluster.local.
  • Configure the service port in the Kubernetes cluster that is used by the service to send and receive HTTP requests, in the Port field.

Creating HTTP transports

Creating physical web server resources


You must set up a Service Component that uses a Web Server as the physical resource for the HTTP transport before you can create stubs.

Creating a service component


You must set up an Operation that uses a Web Server as the physical resource for the HTTP transport before you can create stubs.

Creating an operation


You can specify the stubbing settings based on the message exchange pattern (MEP) for the HTTP transport.

Stubbing settings for Istio stubs


You must create stubs by using MEP.

Creating a stub by using MEP


You can publish the stubs that you create.

Publishing and running stubs

Table 2. Tasks for publishing stubs to Istio
Task More information


Publish one or more stubs to Istio by using any of the following methods:
  • User interface
  • Command line
  • Ant task


Check whether the stub that you want to publish is based on a transport that is supported.

Supported transports to publish stubs to Istio or Kubernetes


Verify that the stub is published, by checking the output directory from the publish step.

Verifying stub publication in Istio or Kubernetes

Table 3. Tasks for running stubs in Istio
Task More information


Run stubs in Istio.

Note: You cannot run the stubs on HCL OneTest API.
You can add the stubs to a project on HCL OneTest Server, and then run the stubs from the Execution page. Refer to the HCL OneTest Server documentation.

Running stubs in Istio or Kubernetes


View Kubernetes deployment information.

Getting stub information in Kubernetes deployments


Stop a stub or delete the deployment of the stub in Istio.

Stopping stubs that are running in Istio or Kubernetes