Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test demo #1153

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Test demo #1153

wants to merge 1 commit into from

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.

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>
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.

1 participant