Skip to content

Conversation

@nirs
Copy link
Member

@nirs nirs commented Nov 29, 2023

Demo for testing multiple applications on Kubernetes and OpenShift clusters in parallel.

Need to update for new ocm-ramen-samples layout.

branch: test
name: busybox-regional-rbd-deploy
namespace: busybox-regional-rbd-deploy
dr_policy: busybox-regional-rbd-deploy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove namespace and dr_policy and use name to simplify the configuration.

@nirs nirs force-pushed the test-demo branch 2 times, most recently from 137de63 to 7fe9165 Compare November 30, 2023 22:25
@nirs nirs force-pushed the test-demo branch 4 times, most recently from 5952314 to 9bb82f2 Compare December 11, 2023 22:16
@nirs nirs force-pushed the test-demo branch 3 times, most recently from bd59c2a to c62becc Compare January 14, 2024 10:46
@nirs nirs force-pushed the test-demo branch 2 times, most recently from 7be0ba3 to 1376b5f Compare February 29, 2024 15:02
This tiny tool reads test suites yaml and run the tests in parallel
logging test logs to separate files.

A test suite binds tests (e.g. basic-test) to application configurations
(e.g. busybox-regional-rbd-deploy).

We have 2 test suites:

    $ tree suites/
    suites/
    ├── basic-k8s.yaml
    └── basic-odr.yaml

Example run with drenv created environment:

    $ ./drtest --outdir /tmp/k8s-logs suites/basic-k8s.yaml envs/regional-dr.yaml
    2023-11-28 00:55:54,099 INFO    Running 'Basic Kubernetes Regional DR tests'
    2023-11-28 00:55:54,099 INFO    Storing output to '/tmp/k8s-logs'
    2023-11-28 00:55:54,101 INFO    Starting test 'deploymnet'
    2023-11-28 00:55:54,101 INFO    Starting test 'statefulset'
    2023-11-28 00:55:54,102 INFO    Starting test 'daemonset'
    2023-11-28 01:04:23,274 INFO    Test 'daemonset' PASS
    2023-11-28 01:04:24,161 INFO    Test 'deploymnet' PASS
    2023-11-28 01:04:53,600 INFO    Test 'statefulset' PASS
    2023-11-28 01:04:53,600 INFO    PASS (3 pass, 0 fail)

The test logs to separate file:

    $ tree /tmp/k8s-logs
    /tmp/k8s-logs
    ├── daemonset.log
    ├── deploymnet.log
    └── statefulset.log

To test with OpenShift we need to create a tiny environment file:

    $ cat env.yaml
    ramen:
      hub: hub
      clusters: [cluster1, cluster2]
      topology: regional-dr

And use a kubeconfig file with the clusters. The file can be created
with `oc login` and some `oc config` commands, or using the
oc-clusterset plugin:

    $ cat config.yaml
    clusters:
      - name: cluster1
        url: perf1.example.com:6443
        username: kubeadmin
        password: PeSkM-R6YcH-LyPZa-oTOO1
      - name: cluster2
        url: perf2.example.com:6443
        username: kubeadmin
        password: ZjIZn-SFUyR-aE4gI-fJcfL
      - name: hub
        url: perf3.example.com:6443
        username: kubeadmin
        password: 7C700-oVS3Q-25rtx-YMew5
    current-context: hub

    $ oc clusterset login --config config.yaml --kubeconfig kubeconfig

    $ oc config get-contexts --kubeconfig kubeconfig
    CURRENT   NAME       CLUSTER                  AUTHINFO                            NAMESPACE
              cluster1   perf1-example-com:6443   kube:admin/perf1-example-com:6443   default
              cluster2   perf2-example-com:6443   kube:admin/perf2-example-com:6443   default
    *         hub        perf3-example-com:6443   kube:admin/perf3-example-com:6443   default

Example run with the OpenShift environment:

    $ ./drtest --kubeconfig kubeconfig --outdir /tmp/odr-logs suites/basic-odr.yaml env.yaml
    2023-11-29 23:45:14,849 INFO    Running 'Basic OpenShift Regional DR tests'
    2023-11-29 23:45:14,849 INFO    Storing output to '/tmp/odr-logs'
    2023-11-29 23:45:14,850 INFO    Starting test 'rbd'
    2023-11-29 23:45:14,850 INFO    Starting test 'cephfs'
    2023-11-29 23:54:24,599 INFO    Test 'rbd' PASS
    2023-11-29 23:54:51,461 INFO    Test 'cephfs' PASS
    2023-11-29 23:54:51,461 INFO    PASS (2 pass, 0 fail)

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@ShyamsundarR
Copy link
Member

Closing as stale, part of general cleanup. Please reopen and update if still required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants