anchor.diff:  ====
   
   [id="cnf-performing-end-to-end-tests-running-the-tests_{context}"]
  -== Running the tests
  +== Running the latency tests
   Assuming the `kubeconfig` file is in the current folder, the command for running the test suite is:
   
   [source,terminal]
  
positive.code: 
  This allows your `kubeconfig` file to be consumed from inside the running container.
  
  [id="cnf-performing-end-to-end-tests-running-the-latency_tests"]
  === Running the latency tests
  In {product-title} {product-version}, you can also run latency tests from the CNF-test container. The latency test allows you to set a latency limit so that you can determine performance, throughput, and latency.
  
  The latency test runs the `oslat` tool, which is an open source program to detect OS level latency. For more information, see the Red Hat Knowledgebase solution link:https://access.redhat.com/solutions/5315541[How to measure OS and hardware latency on isolated CPUs?].
  
  By default, the latency tests are disabled. To enable the latency test, you must add the `LATENCY_TEST_RUN` variable and set its value to `true`. For example, `LATENCY_TEST_RUN=true`.
  
  Additionally, you can set the following environment variables for latency tests:
  
  * `LATENCY_TEST_RUNTIME` - Specifies the amount of time (in seconds) that the latency test must run.
  * `OSLAT_MAXIMUM_LATENCY` - Specifies the maximum latency (in microseconds) that is expected from all buckets during the `oslat` test run.
  
  To perform the latency tests, run the following command:
  
  [source,termina]
  ----
  $ docker run -v $(pwd)/:/kubeconfig -e KUBECONFIG=/kubeconfig/kubeconfig -e LATENCY_TEST_RUN=true -e LATENCY_TEST_RUNTIME=600 -e OSLAT_MAXIMUM_LATENCY=20 registry.redhat.io/openshift4/cnf-tests-rhel8:v4.8 /usr/bin/test-run.sh
  ----
  [NOTE]
  ====
  You must run the latency test in discovery mode. For more information, see the Discovery mode section.
  ====
  
  .Excerpt of a sample result of a 10-second latency test using the following command:
  [source,terminal]
  ----
  [root@cnf12-installer ~]# podman run --rm -v $KUBECONFIG:/kubeconfig:Z -e PERF_TEST_PROFILE=worker-cnf-2 -e KUBECONFIG=/kubeconfig -e LATENCY_TEST_RUN=true -e LATENCY_TEST_RUNTIME=10 -e OSLAT_MAXIMUM_LATENCY=20 -e DISCOVERY_MODE=true registry.redhat.io/openshift4/cnf-tests-rhel8:v4.8 /usr/bin/test-run.sh
  -ginkgo.focus="Latency"
  running /0_config.test -ginkgo.focus=Latency
  ----
  .Example output
  [source,terminal]
  ----
  I1106 15:09:08.087085       7 request.go:621] Throttling request took 1.037172581s, request: GET:https://api.cnf12.kni.lab.eng.bos.redhat.com:6443/apis/autoscaling.openshift.io/v1?timeout=32s
  Running Suite: Performance Addon Operator configuration
  
  Random Seed: 1604675347
  Will run 0 of 1 specs
  
  JUnit report was created: /unit_report_performance_config.xml
  
  Ran 0 of 1 Specs in 0.000 seconds
  SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 1 Skipped
  PASS
  running /4_latency.test -ginkgo.focus=Latency
  I1106 15:09:10.735795      23 request.go:621] Throttling request took 1.037276624s, request: GET:https://api.cnf12.kni.lab.eng.bos.redhat.com:6443/apis/certificates.k8s.io/v1?timeout=32s
  Running Suite: Performance Addon Operator latency e2e tests
  
  Random Seed: 1604675349
  Will run 1 of 1 specs
  
  I1106 15:10:06.401180      23 nodes.go:86] found mcd machine-config-daemon-r78qc for node cnfdd8.clus2.t5g.lab.eng.bos.redhat.com
  I1106 15:10:06.738120      23 utils.go:23] run command 'oc [exec -i -n openshift-machine-config-operator -c machine-config-daemon --request-timeout 30 machine-config-daemon-r78qc -- cat /rootfs/var/log/oslat.log]' (err=<nil>):
    stdout=
  Version: v0.1.7
  
  Total runtime: 		10 seconds
  Thread priority: 	SCHED_FIFO:1
  CPU list: 		3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50
  CPU for main thread: 	2
  Workload: 		no
  Workload mem: 		0 (KiB)
  Preheat cores: 		48
  
  Pre-heat for 1 seconds...
  Test starts...
  Test completed.
  
  Core: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
  CPU Freq: 2096 2096 2096 2096 2096 2096 2096 2096 2096 2096 2096 2096 2096 2092 2096 2096 2096 2092 2092 2096 2096 2096 2096 2096 2096 2096 2096 2096 2096 2092 2096 2096 2092 2096 2096 2096 2096 2092 2096 2096 2096 2092 2096 2096 2096 2096 2096 2096 (Mhz)
  ...
  Maximum: 3 4 3 3 3 3 3 3 4 3 3 3 3 4 3 3 3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3 3 3 3 3 4 3 3 3 3 3 4 3 3 3 4 (us)
  ----
  
  [id="cnf-performing-end-to-end-tests-image-parameters_{context}"]
  == Image parameters
  
negative.code: [id="cnf-performing-end-to-end-tests-cleaning-up_{context}"]
  === Cleaning up
  
  After running the test suite, all the dangling resources are cleaned up.