Upgrading the server software by using the in-place upgrade method

When you want to install the latest version of the server software in the same location that contained the V10.1.3, then you can upgrade HCL OneTest Server by using the helm upgrade command.

Before you begin

You must have completed the following tasks:

  • Informed users that HCL OneTest Server is offline temporarily during the upgrade process.

  • Installed Helm V3.5.2. For more information, refer to the Installing a Helm chart on an OpenShift Container Platform cluster section in the Red Hat OpenShift documentation.

  • Completed all test executions that are running on the existing version of HCL OneTest Server.

  • Stopped all stub executions that are running on the existing version of HCL OneTest Server.

  • Canceled any scheduled test runs that have a future date or time.

  • Copied the Secret key from the Harbor repository.

Optional. You can back up the user data from the previous version of the product. If the upgrade fails, then you can use that backup file to restore it on V10.2.0. See Backing up the server data on Red Hat OpenShift.

Procedure

  1. Log in to your OCP cluster as a cluster administrator by running the oc login command.
  2. Add the software registry to Helm to access the server install charts by running the following command:
    helm repo add hclsoftware https://hclcr.io/chartrepo/ot --username {okta-email-address} --password {harbor-cli-secret}
    Note: You must replace {okta-email-address} with the user name of the Harbor repository and replace {harbor-cli-secret} with the secret key that you copied from the Harbor repository.

    If the user name contains any special characters, such as $, you must enclose it within single quotes.

  3. Run the following command to get the latest updates from the repository:
    helm repo update
  4. Run the following command to retrieve the charts:
    helm pull --untar hclsoftware/hcl-onetest-server --version 5.1020.0
  5. Create a Secret to pull images that are used by HCL OneTest Server by running the following commands:
    oc create secret docker-registry hclcr.io \
    -n test-system \
    --docker-server=hclcr.io \
    --docker-username={okta-email-address} \
    --docker-password={harbor-cli-secret} \
    --docker-email=example@abc.com
    Notes:
    • You must replace {okta-email-address} with the user name of the Harbor repository and replace {harbor-cli-secret} with the secret key that you copied from the Harbor repository.

      If the user name contains any special characters, such as $, you must enclose it within single quotes.

    • You can replace example@abc.com with the email address of the administrator if required.

    Remember: test-system is the name of the namespace. If you created a namespace by using a different value, then you must use that value in place of the test-system in all the instances in this procedure.
  6. Perform the following steps to upgrade the server software:
    1. Run the following commands to update the runAsUser and fsGroup to match the Security Context Constraints (SCC):
      sed -i -e "s/runAsUser: 1001/runAsUser: $(oc get project test-system -oyaml \
        | sed -r -n 's# *openshift.io/sa.scc.uid-range: *([0-9]*)/.*#\1#p')/g;
                 s/fsGroup: 1001/fsGroup: $(oc get project test-system -oyaml \
        | sed -r -n 's# *openshift.io/sa.scc.supplemental-groups: *([0-9]*)/.*#\1#p')/g" hcl-onetest-server/values-openshift.yaml

      HCL OneTest Server is compatible with the restricted Security Context Constraint. You must run this command to ensure that the runAsUser and fsGroup strategies match with the SCC policy.

    2. Perform one of the steps described in the following table to upgrade the server software based on your requirement:
      Step description Step no

      To upgrade the server software

      Perform 6.b.i

      To upgrade the server software and enable the OpenShift Service Mesh service virtualization through Istio, a Tech Preview feature

      Perform 6.b.ii and 6.b.iii

      To upgrade the server software and enable Jaeger for performance and Web UI tests logs

      Perform 6.b.iv
      1. Run the following command to upgrade the server software:

        helm upgrade {my-ots} ./hcl-onetest-server -n test-system \
        -f hcl-onetest-server/values-openshift.yaml \
        --set global.persistence.rwxStorageClass=rook-ceph-file
        --set global.hclOneTestIngressDomain=onetest.{openshift-cluster-dns-name} \
        --set global.hclImagePullSecret=hclcr.io \
        --set global.hclOneTestPasswordAutoGenSeed={password-seed}
        Note: You must use the --set global.hclCertSecretOptional=false parameter in the helm upgrade command only if you created an ingress Secret to store the CA during the previous installation of the server software.
      2. Run the following command to upgrade the server software and to enable the OpenShift Service Mesh service virtualization feature:

        helm upgrade {my-ots} ./hcl-onetest-server -n test-system \
        -f hcl-onetest-server/values-openshift.yaml \
        --set global.persistence.rwxStorageClass=rook-ceph-file
        --set global.hclOneTestIngressDomain=onetest.{openshift-cluster-dns-name} \
        --set global.hclImagePullSecret=hclcr.io \
        --set global.hclOneTestPasswordAutoGenSeed={password-seed} \
        -f hcl-onetest-server/values-openshift-demo.yaml
      3. Run the following command to enable service virtualization through Istio, a Tech Preview feature in the specific namespace:

        oc create rolebinding istio-virtualization-enabled -n bookinfo --clusterrole={my-ots}-execution-istio-test-system --serviceaccount=test-system:{my-ots}-execution

        Where, {my-ots} is the name of the release that you provided during the installation of the server software.

        Note: When you uninstall the chart, the manually created role bindings are not deleted from the namespace. You can run the following command to delete the role bindings:
        oc delete rolebinding istio-virtualization-enabled -n bookinfo
      4. Run the following command to upgrade the server software and to enable Jaeger for performance and Web UI tests logs:

        helm upgrade {my-ots} ./hcl-onetest-server -n test-system \
        -f hcl-onetest-server/values-openshift.yaml \
        --set global.persistence.rwxStorageClass=rook-ceph-file
        --set global.hclOneTestIngressDomain=onetest.{openshift-cluster-dns-name} \
        --set global.hclImagePullSecret=hclcr.io \
        --set global.hclOneTestPasswordAutoGenSeed={password-seed} \
        --set-string execution.annotations.sidecar\\.jaegertracing\\.io/inject=true \
        --set global.jaegerAgent.internalHostName=localhost \
        --set global.jaegerDashboard.externalURL={my-jaeger-dashboard-url}
        Note: You must use the --set global.hclCertSecretOptional=false parameter in the helm upgrade command only if you created an ingress Secret to store the CA during the previous installation of the server software.
  7. Run the following command to verify and test the upgraded server software:
    $ helm test {my-ots} -n test-system

    where {my-ots} is the name of the release that was provided during the installation of the server software.

Results

On the successful upgrade of HCL OneTest Server, the output displays the following information:
  • Keycloak URL to manage and authenticate users.

  • A URL to access the HCL OneTest Server UI.